Collection of Interview Questions on  ASP.NET

1. What are the Performance Considerations in ASP.NET Applications

To achieve the goal of high performance in ASP.NET applications, we have to take care of the Design Considerations, Coding Techniques, Platform Optimizations and .NET Framework Configurations.

The main performance considerations are-

1). Design Considerations

By: Pankaj Kumar Gupta   |    On:  15 May 2011 02:48:56
ASP.NET server controls are components that run on the server and encapsulate user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes.
 
Custom con
By: Pankaj Kumar Gupta   |    On:  15 Mar 2011 00:58:11
ASP.NET is server side technology used with .NET Web Applications. The main concern with ASP.NET includes 1). Server Side Processing, 2). State Management and 3). Security Model
By: Pankaj Kumar Gupta   |    On:  15 Mar 2011 00:54:59

Answer

Just call Session.Abandon().

Example

void ClearSession()
{
Session.Abandon();
}

 

By: RRaveen   |    On:  14 Jan 2011 12:40:36

Answer:

By checking the IsPostBack property. If IsPostBack is True, the page has been posted back.

Example

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
// code
        }
     }

 

By: RRaveen   |    On:  14 Jan 2011 12:36:15

Answer:

The Master is common template to create base level or common layout for your whole application. It’s save time and unnecessary repeating layouts create again and again. Master Pages contains content placeholders to hold page specific content.

By: RRaveen   |    On:  22 Dec 2010 09:29:20

Answer:

  • Integer
  • String
  • Currency
  • Double
  • Date
By: RRaveen   |    On:  09 Dec 2010 21:18:34

Answer:

The Global.asax include its code behind file Global.asax.cs/ Global.asax.vb, it is use to implement application and session level events. This file responsible for application or session vice setting can made when application or session starts and end times and also

By: RRaveen   |    On:  08 Dec 2010 02:26:37

Answer:

The System.Web.UI.Page class.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
}

 

By: RRaveen   |    On:  08 Dec 2010 02:11:47

Answer:

The Client side validation happened on the generated html. This can be say like, it’s fully happened on the browser side. If web page accepts the user input, always have to validate data in client side before pass to server side.
The Server side validation fully happened in the server side. Before process the data in server side have to validate to ignore unnecessary errors.The server side validation is increase or overhead to server but client side validation is not.

By: RRaveen   |    On:  08 Dec 2010 02:03:41

Answer:

Page load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that view state is not fully loaded during this event.

By: RRaveen   |    On:  08 Dec 2010 01:48:59

Answer:

There are two methods to implement this

1.    Redirect
2.    Transfer

Response.Redirect()

This method is complete kill the current request and start new request and send to new page. Most of the times ignore this method to navigate one page to another page in within application. if this is best for switch one application to another.
C# code

Response.Redirect("~/home.aspx");// this is only redirect to home page
Response.Redirect("~/home.aspx",true); // this is redirect to home page and also end current response.

Server. Transfer()

This is best and less resource expensive way to redirect one page to another. You can use this redirect one page to another within application.
C# Code

Server.Transfer("~/interviwquestions/aspnet.aspx");// this is redirect to asp.net interview questions page within the application
Server.Transfer(HelpHandler, true); // this is use httphandler to redirect
Server.Transfer("~/sub/page.aspx", true); // this use the page with preserver form

 

By: RRaveen   |    On:  08 Dec 2010 01:46:14

Answer:

In the top of the page, we have to add like following

<%@ OutputCache Duration="30" VaryByParam="ID" %>

Above define tell to server the page cache for 30 minutes by querystring ID.

By: RRaveen   |    On:  08 Dec 2010 01:18:59

Answer:

The viewstate is encrypted format of the data generated by ASP.NET+IIS for first time when page has request by the browser for control existing in the page. If the information is to be shared across different controls, it can be placed in the viewstate of the page, if it is to be accessed within the scope of a single control, and then it can be placed within the viewstate of the control. The type of info one can save here may be simple data types or even complex user defined objects.further reading for viewstate here

By: RRaveen   |    On:  08 Dec 2010 01:15:58

Answer:

  1. RequiredFieldValidator
  2. RegularExpressionValidator
  3. CompareValidator
  4. CustomValidator
  5. RangeValidator
  6. ValidationSummary
     
By: RRaveen   |    On:  08 Dec 2010 01:10:01

Answer:

  1. Init()
  2. Load()
  3. PreRender()
  4. Unload()
By: RRaveen   |    On:  08 Dec 2010 01:07:09

 Answer:

Hidden fields technique is widely used in ASP.NET programming. This control enables a developer to store a non-displayed value in the rendered HTML of the page. The HiddenField control is used to store a value that needs to be persisted across multiple postbacks to the server. Hidden fields are html input control with hidden type that store hidden data in the html.

By: RRaveen   |    On:  29 Nov 2010 01:26:25

Answer:

The Fragement caching is support to cache a web part in the web page.For instance, a Web form might contain many pieces of variable information plus a single large table that almost never changes. In this case, you might place that table in a Web user control and store the response for that control in cache.

By: RRaveen   |    On:  27 Nov 2010 20:41:01
^ Scroll to Top