Вы находитесь на странице: 1из 3

What are the three types

of SessionState modes?
1.InProc - Session kept as a live object in the web server(aspnet_wp.exe)
2.StateServer - Session serialized and stored in the memory as a seperate
process(aspnet_state.exe), we can use it for webfarm architecture
3.SQLServer - Session serialized and stored in the sql server
What are the 6 types of validation controls in ASP.NET?
1. Required Field Validator 2. Range Validator 3. Regular Expression Validator 4.
Compare Validator 5. Custom Validator 6. Validation Summary
Which property to be set for avoiding validations for a button?
CausesValidation=False
What are the three types of caching in ASP.NET?
1. Output Caching(Page Caching)- stores the responses from an asp.net page(aspx)
or user control(.ascx).
2.Fragment Caching(Partial Caching) - Only stores the portion of a page.
3. Data Caching - is the programmatic way to your objects to a managed cache.
//Add item
Cache["TopProducts"] = objTopProductsDataset;
//Retrieve item
objDataset = Cache["TopProducts"];
How to Manage state in ASP.NET?
we can manage the state in two ways
Clent based techniques are Viewstate, Query strings and Cookies.
Server based techniques are Application and Session
Which are the two properties on every validation control?
ControlToValidate & ErrorMessage
What is the different between Server.Transfer and Response.Redirect
Server.Transfer used to transfer the contents from one page to another(same
webserver)
Response.Redirect used to transfer the contents from one server to external server
too
What are ASP.NET 2.0 Page Life Cycle Events?
1.PreInit, 2.Init, 3.InitComplete, 4.PreLoad, 5.Load, 6.Control events,
7.LoadComplete, 8.PreRender, 9. SaveStateComplete, 10. Render, 11.Unload
What are the differences between HTML controls and Web controls?
Web Server Controls HTML Server Controls
Web Controls are feature rich controls.
HTML controls are small and light
Calendar controls,Datagrid,Repeater,
weight.
validation controls.
Viewstate support No viewstate support
Inherit from
Inherit from System.Web.UI.WebControls
System.Web.UI.HTMLControls
How can I use IIS to test my pages in VS.NET, and not use the internal server?
In the Solution Explorer, right-click the name of the Web site for which you
want to specify a Web server, and then click Property Pages.
In the Property Pages dialog box, click the Start Options tab.
Under Server, click Use custom server.

In the Base URL box, type the URL that Visual Web Developer
should start when running the current Web site. You can use localhost.

From that point on, the VS.NET IDE will not use the internal web server,
but will use IIS to open your pages, i.e., if you are working on default.aspx,
it will be opened as : http://localhost/default.aspx

How do I use AppSettings in the web.config file?


Here is a sample:

in the web.config file...


-----------------
<configuration>
<appSettings>
<add key="MyConn" value="Initial Catalog=pubs;Data Source=localhost;uid=sa;pwd=;" />
</appSettings>
</configuration>
-----------------
in your code...
-----------------
string ConnStr;
ConnStr = (string)ConfigurationSettings.AppSettings("MyConn");

-----------------
How can I place multiple forms on a single ASP.Net page?
You can have multiple HTML forms on an ASP.Net page, but you can only have one form
designated as runat="server".

In ASP.Net you can create the appearance of two forms by putting all of your fields in a single
server-side form and using multiple submit buttons. You can then write seperate code for the
click event of each button and only deal with the appropriate fields.

If you choose to use standard HTML forms, you can just use Request.Form to access the fields.
Diff between Dataset.Clone and Dataset.Copy?
DataSet.Clone method copies the structure of the DataSet, including all DataTable schemas,
relations, and constraints. But it does not copy any data.
DataSet.Copy method copies both the structure and data.
What is typed Dataset?
you can create a strongly-typed Data Set by creating an XSD. When you use a data set to
assign values to instance members in your business objects, the data set type must match your
business object member or you must convert the type from object to the type. Creating a
strongly-typed dataset also ensures that a dataset does not change (in the case of a modified
stored procedure) and enables intellisense rather than dictionary-based access.
what is an Delegate?
A strongly typed function pointer. Delegate holds the reference of a method.
what is Multicast Delegates?
It is a Delegate which holds the reference of more than one method.
Multicast Delegates must contain only methods that return void, else it will cause run-time
exception.
Do I have to use a single programming language for all the Web pages in my app?
No. Each page can be written in a different programming language if you want, even in the
same application.
If you are creating source code files and putting them in the \App_Code folder to be compiled
at run time, all the code in must be in the same language.
However, you can create subfolders in the \App_Code folder and use subfolders to store
components written in different programming languages.
How to prevent cross site scripting in ASP.NET?
a)Constraint input(Validate input type, length, format, and range.)
b)Encode output.
To prevent cross-site scripting, perform the following steps:

Step 1. Check that ASP.NET request validation is enabled.


Step 2. Review ASP.NET code that generates HTML output.
Step 3. Determine whether HTML output includes input parameters.
Step 4. Review potentially dangerous HTML tags and attributes.
Step 5. Evaluate countermeasures.
what are ASP.NET 3.5 Features?
- ListView and DataPager Controls are the new controls in ASP.NET 3.5
- Viewstate must be enabled both of them to work.

VS 2008 Multi-Targeting Support


VS 2008 JavaScript Intellisense
VS 2008 JavaScript Debugging
VS 2008 ASP.NET AJAX Control Extender Support
VS 2008 JavaScript Intellisense for Silverlight
VS 2008 Web Designer and CSS Support
VS 2008 Nested Master Page Support
VS 2008 Vertical Split View Support
VS 2008 Support to Treat CSS and JavaScript Validation Issues as Warnings instead of Errors
What are AJAX toolKit Controls?
a.TabControl
<ajaxToolkit:TabContainer runat="server" BorderColor="AliceBlue" >
<ajaxToolkit:TabPanel ID="TabPanel4" HeaderText="Tab1" runat="server"
BackColor="Brown">

b.ValidatorCallOutExtender
<ajaxToolkit:ValidatorCalloutExtender>

c.CalenderExtender
<ajaxToolkit:CalendarExtender>

d.The History Extensions to ASP.NET AJAX


<asp:ScriptManager runat="server" ID="ScriptManager2" EnableHistory="true"
OnNavigate="OnNavigateHistory" />