How will you Disable Validation for ASP.NET Server Controls ?

Monday, July 13, 2009


On some pages you will allow users to post even if validations fail. By doing this setting you ask asp.net to by pass validations both at the client and server

For example to bypass validations use this skip button,
<asp:Button id="Button1" runat="server"
Text="Skip" CausesValidation="False">
</asp:Button>

To disable validation at server:

change the validation control's Enabled property to false.

To disable validation at client:

Change the validation control's EnableClientScript property to false.



www.codecollege.NET

How will you know whether the page validation succeeded or not?


By calling

IsValid();


www.codecollege.NET

How will you know whether a page is involved in cross-page postback?


By calling

IsCrossPagePostBack();


www.codecollege.NET

How will you know whether the page request is the result of a callback?


By calling

IsCallBack();


www.codecollege.NET

Daily Tips- Tip #4 - How will you know whether the page is posted back or not?


By calling,

IsPostBack();



www.codecollege.NET

Can we have different access modifiers on get and set?


By calling

No. For a property access modifier is same for get and set.


www.codecollege.NET

How will you suppress the finalize method?


By calling

GC.SuppressFinalize();


www.codecollege.NET
Blog Widget by LinkWithin