IMG-LOGO

ASP.Net Questions and Answers

andy - 20 Sep, 2013 2352 Views 0 Comment

It will be a wise idea before going for an interview, you prepare yourself to learn and read again the basic knowledge of ASP.Net. Most of senior or mid level programmers do make mistakes when they have been asked for a really simple questions and answer them wrongly. Again it is not a bad thing, but it will just give a bad impression especially when you declare yourself as a mid or senior web developer.

Those are the quick list of question and answers for ASP.Net

1. What are the difference between Literal and Label controls?

Answer: The difference of the controls are on the render html output. The Literal control will return a complete clean string while Label control will return a span html object. Other additional difference is you cannot apply css class to Literal control.

2. Can you have multiple web.config files in one website application?

Answer: Yes you can with the condition they are not kept in the same folder. The main config file will be read from the root folder.

3. What is the difference of machine.config file and web.config file?

Answer: Machine config file can be considered as a master config file contains default settings. All web.config by default contains the default master.config file and in web.config file you can override the existing settings. In a web server, you can only have 1 machine config file, while web.config file can be many, each web application will have at least 1 web.config file.

4. What is a View State?

Answer: By default View State is used by ASP.Net to store data inside a single page. It retains the data by using a hidden field in asp.net page. If you view the source code of your asp.net, you will be able to see the data is encrypted as a long string. This is automatically generated during the postbacks to the server.

5. What is the difference of Int32 and Int64?

Answer: The int32 contains 4 bytes while int64 contains 8 bytes.

6. How many bits in Int32?

Answer: As int32 contains 4 bytes and 1 bytes contains 8 bits, it means int32 contanis 32 bits.

7. What is the difference between Response.Redirect and Response.RedirectPermanent?

Answer: Response.Redirect will create 302 http response code in the response header telling the search engine that this is a temporary redirection. While the Response.RedirectPermanent will create 301 http response code to indicate the page is now completely move to another page.

8. As Http is stateless, what type of state managements offered by ASP.Net to store the data during web request?

Answer: You can use cookies, query string, view state, session state and application state

9. What is the difference between Session and Application state?

Answer: Session state is used to store a data based on individual/user request while application state apply to all users.

10. What are the type of validator controls available in ASP.Net?

Answer: The validator controls available in ASP.Net are: RequiredFieldValidator, CompareValidator, RegularExpressionValidator, RangeValidator, CustomValidator, and ValidationSummary controls.

11. What is the difference between Session and Application state?

Answer: Session state is used to store a data based on individual/user request while application state apply to all users.

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.

Related Articles

How to remove html tags from string in c#?

Sometimes you need to remove HTML tags from string to ensure there are no dangerous or malicious scripts especially when you want to store the string or data text into the database.