• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

Asp.Net Interview Questions Answers

Question - 101 : - How can you provide an alternating color scheme in a Repeater control?

Answer - 101 : -   AlternatingItemTemplate Like the ItemTemplate element, but rendered for every other row (alternating items) in the Repeater control. You can specify a different appearance for the AlternatingItemTemplate element by setting its style properties.

Question - 102 : - How do I send e-mail from an ASP.NET application?

Answer - 102 : -   MailMessage message = new MailMessage ();         message.From = <email>;         message.To = <email>;         message.Subject = "Scheduled Power Outage";         message.Body = "Our servers will be down tonight.";         SmtpMail.SmtpServer = "localhost";         SmtpMail.Send (message);  MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's  System.Web.Mail namespace. Due to a security change made to ASP.NET just before it shipped,  you need to set SmtpMail's SmtpServer property to "localhost" even though "localhost" is  the default. In addition, you must use the IIS configuration applet to enable localhost  ( to relay messages through the local SMTP service.

Question - 103 : - True or False: A Web service can only be written in .NET?

Answer - 103 : - False

Question - 104 : - What are the different types of Session state management options available with ASP.NET?

Answer - 104 : - ASP.NET provides In-Process and Out-of-Process state management.  In-Process stores the session in memory on the web server.  This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server.  Out-of-Process Session state management stores data in an external data source.  The external data source may be either a SQL Server or a State Server service.  Out-of-Process state management requires that all objects stored in session are serializable.

Question - 105 : - What is the lifespan for items stored in ViewState?

Answer - 105 : - Item stored in ViewState exist for the life of the current page.  This includes postbacks (to the same page).

Question - 106 : - What does AspCompat="true" mean and when should I use it?

Answer - 106 : -   AspCompat is an aid in migrating ASP pages to ASPX pages. It defaults to false but should be set to true in any ASPX file that creates apartment-threaded COM objects--that is, COM objects registered ThreadingModel=Apartment. That includes all COM objects written with  Visual Basic 6.0. AspCompat should also be set to true (regardless of threading  model)  if the page creates COM objects that access intrinsic ASP objects such as Request and Response. The following directive sets AspCompat to true:          <%@ Page AspCompat="true" %>  Setting AspCompat to true does two things. First, it makes intrinsic ASP objects available      to the COM components by placing unmanaged wrappers around the equivalent ASP.NET objects. Second, it improves the performance of calls that the page places to apartment- threaded COM objects by ensuring that the page (actually, the thread that processes the  request for the page) and the COM objects it creates share an apartment. AspCompat="true" forces ASP.NET request threads into single-threaded apartments (STAs). If those threads create COM objects marked ThreadingModel=Apartment, then the objects are created in the same STAs as the threads that created them. Without AspCompat="true," request threads run in a multi

Question - 107 : - What method do you use to explicitly kill a user s session?

Answer - 107 : -   You can dump (Kill) the session yourself by calling the method Session.Abandon. ASP.NET automatically deletes a user's Session object, dumping its contents, after it has been idle for a configurable timeout interval. This interval, in minutes, is set in the <SESSIONSTATE>section of the web.config file. The default is 20 minutes.

Question - 108 : -   What is CTS (Common Type System)?

Answer - 108 : -   It defines about how Objects should be declard, defined and used within .NET. CLS is the subset of CTS.

Question - 109 : -   Can you edit data in the Repeater control?

Answer - 109 : -     No, it just reads the information from its data source.  

Question - 110 : -   1.                  Previous Next

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners