ALLInterview.com :: Home Page
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Testimonials Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
   
 
Categories >> Software >> Microsoft Related >> ASP.NET
 


 

 
Question How do you create a permanent cookie?
 Question Asked In Companies ::     < I also faced this Question! >
 Question Submitted By :: guest
  Answer Posted By  
 
Answer
write this cod on submit button : ..........

HttpCookie objCookie = new HttpCookie("UserCookie");
objCookie.Values.Add("UserName", TextBox1.Text);
objCookie.Values.Add("UserPass", TextBox2.Text);

//for permanent cookie .......
objCookie.Expires = DateTime.MaxValue;

Response.Cookies.Add(objCookie);

Response.Redirect("Default2.aspx");

Is This Answer Correct ?    5 Yes 1 No


 
  surya beniwal
 
View All Answers
 
 
Please Help Members By Posting Answers For Below Questions
 
 Question Views   Select
 
Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ? 1043
what is publisher? 515
3. What goals do you have in your career? 395
How many types of server controls do we have?Also explain differance between them taking an example of ASP.NET? 1168
What should you do is you want to remove an existing component but would like to make some funtionalities? 409
Securitywise What are the Enhancements in 2.0? 399
what is meant by sitemapnode ? 391
how to include timer or counting time to display next page in asp.net 534
How can we communicate with each server in N-tier Architecture? and what are the methods? 736
1.What r collections? 2.What is .pdb file? 3.Is it possible to provide access to users in master page? 4.What is dirty n Phantom Read(SQL)? 5.What r different isolation levels(SQL)? 6.How to set authentication mode in web.config file? 587
Apart from IDE what are the enhancements in asp.net 2.0? 484
What are the versions of garbage collection? 384
What is HTTPModule and HTTPcontext? What is the use of each? 738
How to include silver light .xap page into asp.net web application and what is the purpose of using silverlight application? 979
Hi, We have a user control that have button Now we use this user control on different aspx pages. We want when we click on the user control button then button behave differently on different page (Dynamacilly). 664
E-Mail New Answers        Answer Selected Questions