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
 
If you are using two select queries and retrieving data. how do you access second query's result set using data reader? 2454
I have an external link in my application say www.xyztest.com. Today this site works on http protocal. Tommorow it may run on https. So i cant hardcore the protocal in the site. When a user clicks on the link how can i know if the external site works on http or https and takes him to that place? 368
Contrast OOP and SOA. What are tenets of each ? 579
How we implement the multiple paypal value with gridview in my website and how we make a payment through Credit Card. 356
What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox? 290
i have 3+ exp in .net? i am going interview now but they asked me do you know any TOOL? which tool will i study please refer me? 848
is there any third party tools are using in .net technologies? what are there ? give me the brief introduction? 956
how to elimainte the similar data from the different tables 647
How Session outproc in Sqlserver stored? 1173
can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003? 768
what is meant by sitemapnode ? 406
a)COM Callable Wrapper b)Runtime Callable Which one of the above is Win32 API in .Net? 528
I have a component with 3 parameter and deployed to client side now i changed my dll method which takes 4 parameter.How can i deploy this without affecting the clent?s code ? 1239
Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ? 1076
what is command line compiler.what are the steps and how it is related to debugging. 372
E-Mail New Answers        Answer Selected Questions