ASP.NET Interview Questions and Answers For Experienced
Q1. What is ASP.NET?
ASP.NET was evolved in direct acknowledgment to the problems that developers had with standard ASP. Since ASP is in such wide use, Microsoft guaranteed that ASP scripts execute without modification on a machine with the.NET Framework (the ASP engine, ASP.DLL, is not modified when installing the.NET Framework). Thus, IIS can house both ASP and ASP.NET scripts on the same machine.
Q2. What is XHTML? Are ASP.NET Pages compliant with XHTML?
In plain words, XHTML is a stricter and cleaner version of HTML. XHTML stands for EXtensible Hypertext Markup Language and is a W3C Recommendation.
Yes, ASP.NET 2.0 Pages are XHTML compliant. However the facility has been given to the user to add the applicable document type declaration.
Q3. Does ViewState affect performance? What is the ideal size of a ViewState? How can you compress a viewstate?
Viewstate stores the state of controls in HTML hidden fields. At times, this information can grow in capacity. This does affect the comprehensive responsiveness of the page, thereby affecting performance. The optimal size of a viewstate should be not more than 25-30% of the page size.
ViewState can be compressed to almost 50% of its size..NET also provides the GZipStream orDeflateStream to compress viewstate
Q4. How can you detect if a viewstate has been tampered?
By setting the EnableViewStateMac to true in the @Page directive. This attribute checks the encoded and encrypted viewstate for tampering.
Q5. Can the App_Code folder contain source code files in different programming languages?
No. All source code files stored in the root App_Code folder must be in the same programming language. However, you can create two subfolders inside the App_Code and then add both C# and VB.NET in the respective subfolders. You also have to add configuration settings in the web.config for this to work.
Q6. Can I deploy the application without deploying the source code on the server?
Yes. You can complicate your code by using a new precompilation process called ‘precompilation for deployment’. You can use the aspnet_compiler.exe to precompile a site. This process builds each page in your web application into a single application DLL and some placeholder files. These files can then be deployed to the server.
You can also conclude the same task using Visual Studio 2005 by using the Build->Publish menu.
Q7. Can I use different programming languages in the same application?
Yes. Each page can be written with a different programming language in the same application. You can create a few pages in C# and a few in VB.NET.
Q8. How to secure your connection string information?
By using the Protected Configuration feature.
>>Read More>>
https://www.mytectra.com/interview-question/asp-net-interview-questions-for-experienced/