ASP.NET Interview Questions and Answers (1544) - Page 74

Which Properties of the GridView Control is used to display any user defined text when there is no data on the Gridview?

NOTE: This is objective type question, Please click question title for correct answer.
Which control does not have any event?

NOTE: This is objective type question, Please click question title for correct answer.
Which statements are correct about DetailsView control?

NOTE: This is objective type question, Please click question title for correct answer.
Which control is used for showing summary messages to users?

NOTE: This is objective type question, Please click question title for correct answer.
How to validate a DropDownList or ListBox using RequiredfieldValidator control?

RequiredfieldValidator has a InitialValue property ,by which we can validate dropdownlist,listbox control.
We have to set InitialValue property to 0 and dropdownlist control also has 0 value at first index as -Select- text.
Which method is used to update the UpdatePanel from server side?

Update() method is used to update an updatepanelcontrol from server-side. But make sure that, we have to se updatemode property to conditional in updatepanel definition.
What is the difference between Session.Abandon() and Session.Clear()?

The major difference is that if we call Session.Abandon() , Session_End will be fired for InProc mode, and in the next request,Session_Start will be fired. Whereas Session.Clear() just clears the session data without killing it.
How to create a folder in Asp.Net?

Using System.IO Namespace;


string path = @"c:\file1";
try
{
// check whether the directory exists.
if (Directory.Exists(path))
{
Response.Write("That path exists already.");
return;
}
// Try to create the directory.
DirectoryInfo di = Directory.CreateDirectory(path);
Response.Write("Directory create successfully at " + Directory.GetCreationTime(path));
}
catch(Exception ex)
{
Response.Write (ex.Message );
}

How to check whether folder is present in the drive or not?

We have Exist static method of File class, which comes under System.IO namespace, so we can check whether folder is present in the drive or not.

Exist returns True/False values.

Using System.IO;
if(File.Exist("Path_of_folder"))
{
Response.Write("File Exists");
}
else
{
Response.Write("File does not Exist");
}

Which DLL translates XML to SQL in IIS?

NOTE: This is objective type question, Please click question title for correct answer.
We can manage states in Asp.Net Application using?

NOTE: This is objective type question, Please click question title for correct answer.
Which is used to validate complex string pattern like an e-mail address in Asp.Net?

NOTE: This is objective type question, Please click question title for correct answer.
which is the first event which gets triggers or fires in an Aspx Page?

NOTE: This is objective type question, Please click question title for correct answer.
Which methods of the RoleProvider class determine whether a user is assigned a role or set of roles

NOTE: This is objective type question, Please click question title for correct answer.
What is the difference between view state and a hidden field in Asp.Net?

Actually both are used to store the value during the Post-back in Asp.Net.But there are some differences between them.

View State - We are not able to change the value by Client side code i.e java script.
Hidden Field - It's possible to change value by Client side code.

View State - We can store more than one value like Datatable , Dataset, Collections and Object.
Hidden Field - We can store only one value in hidden field.
How To Create a Link Without having Underline on it?

By default,Web browser will underline every link on the page.If we want to remove line,the simplest solution is to use HTML code like this:-

<a style = "text-decoration:none;" href = "http://www.dotnetfunda.com">Dot Net Funda</a>


text-decoration:none style property will remove line.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories