asp.net questions and answers
Whether azure supports all OS?
No it supports Windows 7, Vista, Windows 2008 server.
What is the difference between document.getElementById('<%= btnMakeUpdate.ClientID %>').name AND document.getElementById('<%= btnMakeUpdate.UniqueID %>')?
There is no difference. Both will use control's id seperated using $ sign.
MaintainScrollPositionOnPostback will work in Ajax Postback.
NOTE: This is objective type question, Please click question title for correct answer.
You are going to deploy a website on live server. Which build option you will select while building the website? 1. Debug 2. Release
You should select Release .
Your site is deployed on testing server and you make some change in web.config file stored on the server. What will happen to the user's who are accessing site at that time?
When you make any change in web.config file then IIS restarts automatically so all the session and application variables get reset. This can affect user drastically as their session is lost.
Can you add title to browser history point?
Yes, we can add.
Can you hash state information of URL ?
NOTE: This is objective type question, Please click question title for correct answer.
Can you have multiple form tags in a page?
YES.
Page can have multiple form tags but only one of them can contain runat=”server” atrribute at a time.
asp.net questions and answers
What are the various ways of securing a web site that could prevent from hacking etc .. ?
1) Authentication/Authorization
2) Encryption/Decryption
3) Maintaining web servers outside the corporate firewall. etc.,
Name the validation control available in asp.net?.
RequiredField, RangeValidator,RegularExpression,Custom validator,compare Validator
What is a PostBack?
The process in which a Web page sends data back to the same page on the server.
ASP.NET Page Life Cycle Overview
| Stage | Description |
| Page request | The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page. |
| Start | In the start step, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets theIsPostBack property. Additionally, during the start step, the page's UICulture property is set. |
| Page initialization | During page initialization, controls on the page are available and each control's UniqueIDproperty is set. Any themes are also applied to the page. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state. |
| Load | During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state. |
| Validation | During validation, the Validate method of all validator controls is called, which sets the IsValidproperty of individual validator controls and of the page. |
| Postback event handling | If the request is a postback, any event handlers are called. |
| Rendering | Before rendering, view state is saved for the page and all controls. During the rendering phase, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property. |
| Unload | Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and any cleanup is performed. |
Interview questions for ASP.NET (UI) Developers
- What three Session State providers are available in ASP.NET 1.1? What are the pros and cons of each?
- What is Web Gardening? How would using it affect a design?
- Given one ASP.NET application, how many application objects does it have on a single proc box? A dual? A dual with Web Gardening enabled? How would this affect a design?
- Describe how a browser-based Form POST becomes a Server-Side event like Button1_OnClick.
- What is a PostBack?
- What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?
- What is the <machinekey> element and what two ASP.NET technologies is it used for?
- Describe ways to present an arbitrary endpoint (URL) and route requests to that endpoint to ASP.NET.
- Explain how cookies work. Give an example of Cookie abuse.
- Explain the importance of HttpRequest.ValidateInput()?
- How does VaryByCustom work?
- How would one implement ASP.NET HTML output caching, caching outgoing versions of pages generated via all values of q= except where q=5 (as in http://localhost/page.aspx?q=5)?
- What kind of data is passed via HTTP Headers?
- Juxtapose the HTTP verbs GET and POST. What is HEAD?
- Name and describe at least a half dozen HTTP Status Codes and what they express to the requesting client.
- How does if-not-modified-since work? How can it be programmatically implemented with ASP.NET?
Explain <@OutputCache%> and the usage of VaryByParam, VaryByHeader. - Are threads reused in ASP.NET between reqeusts? Does every HttpRequest get its own thread? Should you use Thread Local storage with ASP.NET?
- Is the [ThreadStatic] attribute useful in ASP.NET? Are there side effects? Good or bad?
- Give an example of how using an HttpHandler could simplify an existing design that serves Check Images from an .aspx page.
- What kinds of events can an HttpModule subscribe to? What influence can they have on an implementation? What can be done without recompiling the ASP.NET Application?