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

What are the differences between Classes and Structures?
































Sno Class Structure
1 Reference Type Value Type
2 Stored in heap Stored in stack
3 Inheritance is available Not
4 Protected Modifier is allowed Not
5 Construtor is mandatory Not
5 Objects are destroyed in GC Not


 

What is SQL Cache Dependency in ASP.NET?


Is a feature which invalidates your cache when its dependent database table is changed. That is you cache some data from a table and the cache will automatically get invalidated when anything is changed in the table.


www.codecollege.NET

What are all the ways you can maintain state in asp.net?


Server-side:
1. Session
2. Application
3. Cache

Client-side:
1. Hidden fields
2. Hidden frames
3. View state
4. Cookies
5. Query String


www.codecollege.NET

What are the different modes ASP.NET sessions can be stored?


Asp.net session can be stored in 3 different modes:
1. In-Process
In this mode state is stored in asp.net worker process (aspnet_wp.exe). This is the default mode. The disadvantage is if IIS is restarted state will be lost.
2. State Server
In this mode state is stored in state server (which solves the IIS restart issue as the state server(aspnet_state.exe) can be kept in a separate machine). In this state is serialized and stored.
3. SQL server
Here state is serialized and stored in sql server.


www.codecollege.NET

What is scavenging ?


Scavenging is the process of removing items from cache when memory is scarce. Items are removed either when they are not accessed for some time or when they are marked as low priority when added to cache. Asp.net uses CacheItemPriority object to determine which items to be removed first.


www.codecollege.NET

what are sharepoint features ?


Features add new functionality to a SharePoint 2007 farm, site collection, or site.


www.codecollege.NET

From which base class do the Event receivers inherit from?


They inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase)


www.codecollege.NET

What are event receivers?


Event Receivers are classes which provide some functionality for an event happened. For Ex: adding an item to document library.


www.codecollege.NET

What is CAML, and what is the use of it?


What is CAML?
CAML is Collaborative Application Markup Language. CAML is the XML-based language that is used to build and customize Web sites based on SharePoint™ Team Services from Microsoft®.
Its Use:
It is generally used to Provide schema definition to the Web site provisioning system about how the site looks and acts, Define views and forms for data and page rendering or execution,Act as a rendering language that performs functions in the DLL like pulling a value from a particular field,Provide batch functionality for posting multiple commands to the server using protocol.


www.codecollege.NET

What are the safe control entries in Sharepoint?


A safe control entry is an entry in the web.config file you make when you want to use your custom assembly with your sharepoint webpart.


www.codecollege.NET
Blog Widget by LinkWithin