Click here to Skip to main content
16,021,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have interviewed by an interviewer theses below questions
please give me clear answers

1.Is it possible to clear the session and application objects while running the project?
if yes then how?

2.how to identify from where the exception(from which place) is thrown when a error shows while running the project?


3.what will do in page after response.redirect.
suppose i have session next to response.redirect then will it carry the session to next page
Posted

Ans. 1. Clear session or application variable using remove method of session and application class like
Session["x"]="Value";
Session.Remove("X"); remove the value of x session

Ans 2. use the pageerror event of class and then use Session.GetLastError() method of session class and also get the address of page using object of http class to find the current request page url.

Ans 3. Yes it carry the session value.
 
Share this answer
 
hi,
ans 3.
if u have a session or any lines of code after response.redirect then it will not executed as page is being redirect. in case you want to execute that code you will have to write false flag of response.redirect.

response.redirect("somepage.aspx",fasle);
your code here...

by default it is true...so page will redirect and we have not habit to write true flag....
 
Share this answer
 
Comments
PramodSawant 6-Nov-12 6:29am    
@kkakadiya- yes your right, session cannot be created if response.redirect comes first.
@kavithadev- I think instead of asking these basic que, you should do it programmatically and check the results, this will increase your programming basics

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900