• +91 9723535972
  • info@interviewmaterial.com

ASP Interview Questions and Answers

ASP Interview Questions and Answers

Question - 101 : - What is the role of Postback in ASP.NET?

Answer - 101 : -

Postback is a request sent from a client to the server from the page on which the user is working. It posts the complete page back to the server for a new page.

Postback is submitted to a server before processing the page and holds credentials such as verification like username and passwords using a database.

Question - 102 : - Explain Client-Side Script events

Answer - 102 : -

Client-Side Script runs on the browser and speeds up the execution of the page.

  • onclick: It is used when the control is clicked.
  • onfocus: It is used when the control receives the focus.
  • onchange: It is used when the value of the control is changed.
  • onblur: It is used when the control loses focus.
  • onkeypress: It is used when the user presses the key.

Question - 103 : - What is Anonymous Personalization?

Answer - 103 : -

Anonymous Personalization helps and allows the user to personalize the site before identifying themselves.

Example: 


     cookieTimeout="20000" cookiePath="/" cookieRequiresSSL="false"

cookieSlidingExpiration="true" cookieprotection="Encryption"

cookieless="User"/>

Question - 104 : - What is Form-Based Authentication?

Answer - 104 : -

Form-Based authentication is used to edit the web configuration files and add a login page to authenticate. It is used for web applications.

Form-based authentication also provides a way to handle authentication using custom logics in ASP.NET applications.

Question - 105 : - Define Configuration files?

Answer - 105 : -

Configuration files help to manage the settings of a website. Settings of configuration files are stored as XML files which are separate from the application.

Configuration files are two types:

  • Web Configuration: It contains the machine-specific value for all settings of the application.
  • Machine Configuration: It helps to extend, restrict and override the settings.

Question - 106 : - List different types of cookies used in ASP.NET

Answer - 106 : -

Cookies are a small piece of information stored at the client side.

    The cookies in ASP.NET are divided into two types:

  • Session Cookie: valid for a single session.
  • Persistent Cookie: valid for multiple sessions.

Question - 107 : -
Write code to send e-mail from an ASP.NET application?

Answer - 107 : -

MailMessage mailMess = new MailMessage ();
mailMess.From = "abc@gmail.com";
mailMess.To = "xyz@gmail.com";
mailMess.Subject = "Test email";
mailMess.Body = "Hi This is a test mail.";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (mailMess);
MailMessage and SmtpMail are classes defined System.Web.Mail namespace.

Question - 108 : - How can we prevent browser from caching an ASPX page?

Answer - 108 : -

We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property:

  • Response.Cache.SetNoStore ();
  • Response.Write (DateTime.Now.ToLongTimeString ());

Question - 109 : - What is the good practice to implement validations in aspx page?

Answer - 109 : -

Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.

Question - 110 : - What are the event handlers that we can have in Global.asax file?

Answer - 110 : -

Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute,Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache

Session Events: Session_Start,Session_End


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners