cookies
-
protected void btnAdd_Click(object sender, EventArgs e) { Response.Cookies["message"].Value = txtCookieValue.Text; Response.Cookies["message"].Expires = DateTime.Now.AddDays(1); btnAdd.Text = "done"; if (Response.Cookies["message"] != null) Button1.Text = "null"; else Button1.Text = Response.Cookies["message"].Value; } Button1.text = "null" always. can any one tell me why?
-
protected void btnAdd_Click(object sender, EventArgs e) { Response.Cookies["message"].Value = txtCookieValue.Text; Response.Cookies["message"].Expires = DateTime.Now.AddDays(1); btnAdd.Text = "done"; if (Response.Cookies["message"] != null) Button1.Text = "null"; else Button1.Text = Response.Cookies["message"].Value; } Button1.text = "null" always. can any one tell me why?
hotthoughtguy wrote:
protected void btnAdd_Click(object sender, EventArgs e) { Response.Cookies["message"].Value = txtCookieValue.Text; Response.Cookies["message"].Expires = DateTime.Now.AddDays(1); btnAdd.Text = "done"; **if (Response.Cookies["message"] != null)**Button1.Text = "null"; else Button1.Text = Response.Cookies["message"].Value; }
It should be
protected void btnAdd_Click(object sender, EventArgs e)
{Response.Cookies["message"].Value = txtCookieValue.Text;
Response.Cookies["message"].Expires = DateTime.Now.AddDays(1);
btnAdd.Text = "done";
if (Response.Cookies["message"] == null)
Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
}Regards, Prakash Kalakoti
-
protected void btnAdd_Click(object sender, EventArgs e) { Response.Cookies["message"].Value = txtCookieValue.Text; Response.Cookies["message"].Expires = DateTime.Now.AddDays(1); btnAdd.Text = "done"; if (Response.Cookies["message"] != null) Button1.Text = "null"; else Button1.Text = Response.Cookies["message"].Value; } Button1.text = "null" always. can any one tell me why?
sessionState cookieless="true" ....add this line in web.congif
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
hotthoughtguy wrote:
protected void btnAdd_Click(object sender, EventArgs e) { Response.Cookies["message"].Value = txtCookieValue.Text; Response.Cookies["message"].Expires = DateTime.Now.AddDays(1); btnAdd.Text = "done"; **if (Response.Cookies["message"] != null)**Button1.Text = "null"; else Button1.Text = Response.Cookies["message"].Value; }
It should be
protected void btnAdd_Click(object sender, EventArgs e)
{Response.Cookies["message"].Value = txtCookieValue.Text;
Response.Cookies["message"].Expires = DateTime.Now.AddDays(1);
btnAdd.Text = "done";
if (Response.Cookies["message"] == null)
Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
}Regards, Prakash Kalakoti
hahahaha what a silly mistake i was making well thanks bro