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 ? 1074
8. Why do you want to work here? 446
Can we make activex dll also ti execute in some process as that of client ? How can we do? 2224
benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks 584
If you are using components in your application, how can you handle exceptions raised in a component? 844
What are Session states available and its Uses? 624
hi .net gurus. plz if any one has dumps on 70-631 and 70-541 on windows sharepoint services kindly mail me. 302
What is the syntax for datagrid and specifying columns? 1093
Is LINQ performance wise better or using sqlcommand? 2353
How we implement the multiple paypal value with gridview in my website and how we make a payment through Credit Card. 353
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 ? 1238
explain code with datachaching with example 616
is there any third party tools are using in .net technologies? what are there ? give me the brief introduction? 954
6. Tell us about a time when you failed to meet a deadline. What were the repercussions? 666
Hi this is the coding for adding data in to an xml table i want the coding for update and delete Try Dim emp_xml_doc As New XmlDocument If System.IO.File.Exists(Server.MapPath("emp.xml")) Then emp_xml_doc.Load(Server.MapPath("emp.xml")) Dim myrow_element As XmlElement myrow_element = emp_xml_doc.CreateElement("EmpDetails") Dim str As String str = "<EmpID>" & TxtEmpId.Text & "</EmpID>" & _ "<Empname>" & TxtName.Text & "</Empname>" & _ "<EmpSalary>" & TxtSalary.Text & "</EmpSalary>" myrow_element.InnerXml = str emp_xml_doc.DocumentElement.AppendChild(myrow_element) emp_xml_doc.Save(Server.MapPath("emp.xml")) Response.Write("Record Saved") Dim ds As New DataSet ds.ReadXml(Server.MapPath("emp.xml")) GridView1.DataSource = ds GridView1.DataBind() Else Response.Write("File does not exist.") End If Catch ex As Exception Response.Write(ex.ToString) End Try *********************** this is the xml file <?xml version="1.0" encoding="utf-8" ?> <Employee> <empdetails> <empid>100</empid> <empname>xxx</empname> <empsalary>2000</empsalary> </empdetails> <EmpDetails> <EmpID>yyy</EmpID> <Empname>dddd</Empname> <EmpSalary>77777</EmpSalary> </EmpDetails> <EmpDetails> <EmpID>rrrr</EmpID> <Empname>rrrr</Empname> <EmpSalary>6666</EmpSalary> </EmpDetails> <EmpDetails> <EmpID>qaqa</EmpID> <Empname>sini</Empname> <EmpSalary>50000</EmpSalary> </EmpDetails> <EmpDetails> <EmpID>errrrrrrrr</EmpID> <Empname>rrrrrrrrr</Empname> <EmpSalary>677777</EmpSalary> </EmpDetails> <EmpDetails> <EmpID>rrr</EmpID> <Empname>rrr</Empname> <EmpSalary>33</EmpSalary> </EmpDetails> </Employee> 392
E-Mail New Answers        Answer Selected Questions