Pls somebody answer the following question.
Q1. Suppose there is many lines of code in try block, and there is error in first line only..then that error will be caught by catch block, then the control will go in finally block. Finally error message will be printed in screen. This is normally happen, but since there is no error second line onwards in try block, so in spite of having error in first line all the code should be executed at a time i mean after throwing first line error execution should not stop. how can i do this pls help me with code....
Q2. There is no try catch finally or any exception handling block of code... still application throw an error. Who and how it throws???
Q3. How server got to know the request is coming from which address or how its checking the request address is valid or invalid?? For example while we are typing www.google.com or www.yahoo.com, how google server or yahoo server will confirm that the request is for www.google.com or for www.yahoo.com
Q4.By default how many viewstate object is created in asp.net 2.0???
Q5. Application state variable is used to used to store the values of each user details and their session. If i am admin of my website and want to see last one month how many user total has logged in to my website, i can get get from application variable?? Bot how how can i do this pls help me with code...
Q6.If interviewer ask how did you manage session in your project. What is the best to way say this answer???? Suppose i am storing the session in inproc, cookiless=false
Thanks,
Programmer
Amit ChoudharyPosted Feb 22, 2010, 6:10 AM
Read following blog for this:
http://www.west-wind.com/WebLog/posts/1986.aspx
Amit ChoudharyPosted Feb 22, 2010, 5:58 AM
Ans I: Do one thing just put only those line in the try catch those can throw the exception rest if you want to execute after the exception has been thrown then put them in Finally block just after the catch.
Ans II: Your CLR automatically throw the exception if there is not try and catch.
Ans III: when you type www.google.com it goes to DNS server check for address and then see its source where to redirect it. then after checking of existing it is redirect to the server where you have hosted the website.
Ans IV: Not clear with the question. as i understood byDefault PageLevel Viewstate and Control level Viewstate are defined.
Ans V: Logged in users and Website visitors... there is two type of users and both have differe types of way to store the information about them.
Ans VI:
Session can be maintained in 3 different ways as seen below.
InProc - session kept as live objects in web server (aspnet_wp.exe). Use "cookieless" configuration in web.config to "munge" the sessionId onto the URL (solves cookie/domain/path RFC problems too!)
StateServer - session serialized and stored in memory in a separate process (aspnet_state.exe). State Server can run on another machine
SQLServer - session serialized and stored in SQL server
Don't Forget to mark it as answer.