Total Page Preview:   000000004616

asp.net interview questions and answers for freshers

 

Question 1: What is ASP.Net?

Answer: ASP.NET is a specification developed by Microsoft to create dynamic Web applications, Web sites, and Web services. It is a part of .NET Framework. You can create ASP.NET applications in most of the .NET compatible languages, such as Visual Basic, C#, and J#.

 

Question 2: What is the basic difference between ASP and ASP.NET?

Answer : The basic difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is executed, it is interpreted. On the other hand, ASP.NET uses .NET languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language (MSIL).

 

Question 3: What are the different validators in ASP.NET?

Answer : Asp.net validators is :

  1. Required field Validator
  2. Range Validator
  3. Compare Validator
  4. Custom Validator
  5. Regular expression Validator
  6. Summary Validator

 

Question 4: How long the items in ViewState exists?

Answer : They exist for the life of the current page.

 

Question 5: what is boxing and unboxing?

Answer : Boxing: Convert a value type to reference type variable.

Unboxing: Convert a reference type to value type variable.

 

Question 6: List the events in page life cycle in asp.net.

Answer : List of page life cycle:

  1. Page_PreInit
  2. Page_Init
  3. Page_InitComplete
  4. Page_PreLoad
  5. Page_Load
  6. Page_LoadComplete
  7. Page_PreRender
  8. Render

 

Question 7: Can we have a web application running without web.Config file?

Answer : Yes.

 

Question 8: From which base class all Web Forms are inherited?

Answer : Page class.

 

Question 9: Can we add code files of different languages in App_Code folder?

Answer : No. The code files must be in same language to be kept in App_code folder.

 

Question 10: In which event are the controls fully loaded?

Answer : Page load event.

 

Question 11: Where the viewstate is stored after the page postback?

Answer : ViewState is stored in a hidden field on the page at client side. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.

 

Question 12: List all templates of the Repeater control ?

Answer : List of templates of the repeater control :

  1. ItemTemplate
  2. AlternatingltemTemplate
  3. SeparatorTemplate
  4. HeaderTemplate
  5. FooterTemplate

 

Question 13: Which validator control you use if you need to make sure the values in two different controls matched?

Answer : Compare Validator control.

 

Question 14: What is ViewState?

Answer : ViewState is used to retain the state of server-side objects between page post backs.

 

Question 15: What is Protected Configuration?

Answer : It is a feature used to secure connection string information.

 

Question 16: How do you register JavaScript for webcontrols ?

Answer : We can register javascript for controls using <CONTROL -name> Attribtues.Add(scriptname,scripttext) method.

 

Question 17: Which data type does the Range Validator control support?

Answer : The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date.

 

Question 18: What is the file extension of web service?

Answer : Web services have file extension .asmx.

 

Question 19: Difference between web.config and machine.config 

Answer : Click here
 
Question 20:How many types of Server controls are supported by ASP.NET?
 
Answer : There are mainly four different types of  Server-side controls in ASP.NET :
                     HTML server controls
                     Web Server controls
                     User controls
                     Validation controls
 
Question 21:What are the constructor types present in C# .NET?
Answer : There are five main types of constructor classes in C# as listed below:
  • Copy constructor
  • Default constructor
  • Parameterized constructor
  • Private constructor
  • Static constructor

Question 22:Is it possible to manually set a timeout for a session in .NET?

Answer :Yes, it is possible to manually set a session’s out time. It can easily be done by manipulating the web.config file.
 
Question 23:What is the meaning of AutoPostBack in .NET?
Answer :AutoPostBack is a property in the .NET framework, which provides automatic postback whenever an event starts its execution cycle. To use AutoPostBack, you have to set the property to True.
 
Question 24:How to display validation messages in one control?
Answer :By the help of ValidationSummary control, we can display all validation messages in one control.
 
Question 25:What is the difference between early binding and late binding?
Answer :
 Early Binding: In early binding, a non-virtual method is called which is decided at a compile time.
 Late Binding: In late binding, a virtual method is called which is decided at runtime.
 
Question 26:What is a cookie?
Answer : A Cookie is a small piece of information which is stored at the client side. There are two types of cookie:
  • Session/Temporary Cookie: valid for a single session
  • Persistent Cookie: valid for multiple session
Question 27:What is the default timeout for a cookie?
Answer :30 minutes.
 
Question 28:Why the Form1_Load () event is used?
Answer :You can see that Form1_Load is the event handler for Load event of the form. So, as the event name itself says, this event fires when the form is loading. If you want to do some task when the form is loading, you can do that in Load event handler.
 
Question 29:Why Multiple inheritance does not support in C#?
Answer :C# does not support multiple inheritance because it might raise the issue of ambiguity. The ambiguity arises when two parent classes have the same child class, and each parent class has a function with the same name. This will confuse the compiler to access the function of which parent class since both of them has the same name for the function. 
 

 

 

Thanks

Brijesh Kumar

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: