DotnetPrograming

Dotnet Programing : Dotnet Interview Questions,CrystalReports-Datagrid-DotnetRemoting-DropDownList-LINQ-ListView-N-Tier Architecture-Serialization-smartClinetApplications-UserControls-ValidationControls-WebServices.

Archive for the ‘Asp.Net’ Category

The RequiredFieldValidation Control

Posted by dotnetprograming on April 29, 2009

The first control we have is the RequiredFieldValidation Control. As it’s obvious, it make sure that a user inputs a value. Here is how it’s used:
Required field:
*

>

In this example, we have a textbox which will not be valid until the user types something in. Inside the validator tag, we have a single *. The text in the innerhtml will be shown in the controltovalidate if the control is not valid. It should be noted that the ErrorMessage attribute is not what is shown. The ErrorMessage tag is shown in the Validation Summary (see below).

Posted in Asp.Net | Leave a Comment »

Can you edit data in the Repeater control?

Posted by dotnetprograming on April 29, 2009

No, it just reads the information from its data source.

Posted in Asp.Net | Leave a Comment »

Which method do you invoke on the DataAdapter control to load your generated dataset with data?

Posted by dotnetprograming on April 29, 2009

The Fill() method.

Posted in Asp.Net | Leave a Comment »

Whats MSIL, and why should my developers need an appreciation of it if at all?

Posted by dotnetprograming on April 29, 2009

MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

Posted in Asp.Net | Leave a Comment »

Explain what a diffgram is, and a good use for one?

Posted by dotnetprograming on April 29, 2009

The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.

Posted in Asp.Net | Leave a Comment »

Describe the difference between inline and code behind.

Posted by dotnetprograming on April 29, 2009

Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

Posted in Asp.Net | Leave a Comment »

What is AutoPostBack property? How is it difference from IsPostBack property?

Posted by dotnetprograming on April 29, 2009

AutoPostBack is a property to cause postback for controls (such as dropdownlist and checkbox) that otherwise do not cause postback. Set this property to true to make dropdownlist to cause postback when user selects a diffent item in the dropdownlist.

IsPostBack is a property of Page class,which returns true if page is called because of postback.

Posted in Asp.Net | Leave a Comment »

What events fire when a page life cycle?

Posted by dotnetprograming on April 29, 2009

The following major events occurs in the life cycle of a page.

PreInit
Init
InitComplete
PreLoad
Load
LoadComplete
PreRender
SaveStateComplete
Render
Unload

For more details regarding page life cycle, see article in msdn

Posted in Asp.Net | Leave a Comment »

What is AutoEventWireup atttribute in Page directive?

Posted by dotnetprograming on April 29, 2009

When you set the value of the AutoEventWireup attribute to true, the ASP.NET runtime does not require events to specify event handlers like the Page_Load event or the Page_Init event.

When you set the value of the AutoEventWireup attribute to false, you must manually hook up events to event handlers. When you set the value of the AutoEventWireup attribute to true, the ASP.NET page framework can automatically raise events.

If the value of the AutoEventWireup attribute is set to false, you must override the OnInit function, and then you must add a new delegate for Page_Load event handler explicitly.

The following example shows the difference between setting AutoEventWireup to true and false. Run the page by first setting AutoEventWireup to false. Click on the button. Then set AutoEventWireup to true and run again. Click on the button. You can see difference between these two.
AutoEventDemo.aspx

AutoEventDemo.aspx.cs

using System;

public partial class AutoEventDemo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(“Page Load “);

}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(“You Clicked On Button”);
}
}

If performance is a key consideration, do not set the value of the AutoEventWireup attribute to true. The AutoEventWireup attribute requires the ASP.NET page framework to make a call to the CreateDelegate function for every ASP.NET Web Form page. Instead of using automatic hookup, you must manually override the events from the page

Posted in Asp.Net | Leave a Comment »

Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Posted by dotnetprograming on April 29, 2009

Valid answers are:
• A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
• A DataSet is designed to work without any continuing connection to the original data source.
• Data in a DataSet is bulk-loaded, rather than being loaded on demand.
• There’s no concept of cursor types in a DataSet.
• DataSets have no current record pointer You can use For Each loops to move through the data.
• You can store many edits in a DataSet, and write them to the original data source in a single operation.
• Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

Posted in Asp.Net | Leave a Comment »