Page Validation Properties

Generally used page validation properties while coding.

Page.IsAsync()
Value – true / false
True if the page is processed in asynchronously.

Page.IsCallBack()
Value – true / false
If the Page requested as the result of call back from then true else false

Page.IsCrossPagePostBack()
Value – true / false
CrossPage posting feature in ASP.NET 2.0 allows user to post control values of parent page to target page,we can check parent page is being accessed as a PreviousPage and values are getting posted using IsCrossPagePostBack. For Details – Cross Page Posting

Page.IsPostBack()
Value – true / false
If the page is being loaded for the first time IsPostBack returns false.
If the page is being loaded after some button click / Autopostback event in short any response to a client postback IsPostBack returns true .

Page.IsValid()
Value – true / false
True when page validation is occurred successfully.
We use Page.IsValid if the page contains any of the validation controls.We should generally call Page.IsValid after calling Page.Validate() If we are using Validation group then we should call Page.Validate(“ValidationGroup”) – Validate controls of the ValidationGroup.In ASP.NET 2.0, controls no longer call the Page.Validate method; they use the Page.Validate(String) method instead. If you use the Page.Validate method on an ASP.NET 2.0 page, validation groups are ignored and all controls are validated.

REF MSDN

Also if we set CausesValidation=”true” for server controls then we check it in OnClick event of the controls. Server controls include – Button, ImageButton, and LinkButton Web server controls, The HtmlInputButton, HtmlInputImage, and HtmlButton HTML server controls, and controls that can automatically post back to the server such as the TextBox, CheckBox, ListControl, and BulletedList controls.

Page.IsPostBackEventControlRegistered ( NEW in 3.5)
Gets a value indicating whether the control of the page that submits a postback is registered.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s