REAL TIME QUESTOINS ASP.NET PART THREE

1 • How do you turn off cookies for one page in your site?

Use Cookie.Discard property, Gets or sets the discard flag set by the server. When true, this property instructs the client application not to save the Cookie on the user's hard disk when a session ends.

2 • Which two properties are on every validation control?

We have two common properties for every validation controls

1. Control to Validate,
2. Error Message.

3 • What tags do you need to add within the asp:datagrid tags to bind columns manually?


< id="dgCart" autogeneratecolumns="False" cellpadding="4" width="448px" runat="server">
<>
< headertext="SELECT" text="SELECT" commandname="select">< /asp:ButtonColumn >
< datafield="ProductId" headertext="Product ID">< /asp:BoundColumn >
< datafield="ProductName" headertext="Product Name">< /asp:BoundColumn >
< datafield="UnitPrice" headertext="UnitPrice">< /asp:BoundColumn >
< /Columns >
< /asp:DataGrid >

4 • How do you create a permanent cookie?

Permanent cookies are the ones that are most useful. Permanent cookies are available until a specified expiration date, and are stored on the hard disk. The location of cookies differs with each browser, but this doesn’t matter, as this is all handled by your browser and the server. If you want to create a permanent cookie called Name with a value of Nigel, which expires in one month, you’d use the following code
Response.Cookies ("Name") = "Nigel"
Response.Cookies ("Name"). Expires = DateAdd ("m", 1, Now ())

5 • How do you register JavaScript for webcontrols ?

You can register javascript for controls using Attribtues.Add(scriptname,scripttext) method.

6 • When do you set "" ?

Identity is a webconfig declaration under System.web, which helps to control the application Identity of the web applicaton. Which can be at any level(Machine,Site,application,subdirectory,or page), attribute impersonate with "true" as value specifies that client impersonation is used.

7 • What are different templates available in Repeater,DataList and Datagrid ?
Templates enable one to apply complicated formatting to each of the items displayed by a control.Repeater control supports five types of templates.HeaderTemplate controls how the header of the repeater control is formatted.

ItemTemplate controls the formatting of each item displayed.AlternatingItemTemplate controls how alternate items are formatted and the SeparatorTemplate displays a separator between each item displyed.FooterTemplate is used for controlling how the footer of the repeater control is formatted.The DataList and Datagrid supports two templates in addition to the above five.SelectedItem Template controls how a selected item is formatted and EditItemTemplate controls how an item selected for editing is formatted.

8 • What is ViewState ? and how it is managed ?

ASP.NET ViewState is a new kind of state service that developers can use to track UI state on a per-user basis. Internally it uses an an old Web programming trick-roundtripping state in a hidden form field and bakes it right into the page-processing framework.It needs less code to write and maintain state in your Web-based forms.

9 • What is web.config file ?

Web.config file is the configuration file for the Asp.net web application. There is one web.config file for one asp.net application which configures
the particular application. Web.config file is written in XML with specific tags having specific meanings.It includes databa which includes
connections,Session States,Error Handling,Security etc.

For example :
<>
<>
< key="ConnectionString" value="server=localhost;uid=sa;pwd=;database=MyDB">
< /appSettings >
< /configuration >


10• What is advantage of viewstate and what are benefits?

When a form is submitted in classic ASP, all form values are cleared. Suppose you have submitted a form with a lot of information and the server comes back with an error. You will have to go back to the form and correct the information. You click the back button, and what happens.......ALL form values are CLEARED, and you will have to start all over again! The site did not maintain your ViewState.With ASP .NET, the form reappears in the browser window together with all form values.This is because ASP .NET maintains your ViewState. The ViewState indicates the status of the page when submitted to the server.

11• What tags do you need to add within the asp:datagrid tags to bind columns manually?

Set AutoGenerateColumns Property to false on the datagrid tag and then use Column tag and an ASP:databound tag
< runat="server" id="ManualColumnBinding" autogeneratecolumns="False">
<>
< headertext="Column1" datafield="Column1">
< headertext="Column2" datafield="Column2">
< /Columns >
< /asp:DataGrid >

12 • Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

DataTextField and DataValueField

RELATED POST

ASP.NET INTERVIEW QUESTIONS AND ANSWERS PART ONE

ASP.NET INTERVIEW QUESTIONS AND ANSWERS PART TWO

ASP.NET INTERVIEW QUESTIONS AND ANSWERS PART THREE

ASP.NET INTERVIEW QUESTIONS AND ANSWERS PART FOUR

ASP.NET INTERVIEW QUESTIONS AND ANSWERS PART FIVE

ADO.NET INTERVIEW QUESTIONS AND ANSWERS PART ONE

ADO.NET INTERVIEW QUESTIONS AND ANSWERS PART TWO

You can also learn the concept of frame work concept in detail with questions and answers in the following place.

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART ONE

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART TWO

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART THREE

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART FOUR

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART FIVE

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART SIX

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART SEVEN

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART EIGHT

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART NINE

MICROSOFT DOT NET FRAME WORK QUESTIONS AND ANSWERS PART TEN

No comments:

Post a Comment