Hey Guys,
I am calling a funtions in master page to create cookie
the function looks like this
public void savecookie(string cookiename, string cookievalue, string cookieexp)
{
HttpCookie cookie = new HttpCookie(cookiename);
cookie.Value = cookievalue;
cookie.Expires.AddDays(Con
vert.ToDou
ble(cookie
exp));
Response.Cookies.Add(cooki
e);
}
The call looks like this
mast.savecookie("zipcodeco
ok", zipcode.Text.ToString(), "10");
I continue to get this error
Exception Details: System.NullReferenceExcept
ion: Object reference not set to an instance of an object.
Source Error:
Line 74: cookie.Value = cookievalue;
Line 75: cookie.Expires.AddDays(Con
vert.ToDou
ble(cookie
exp));
Line 76: Response.Cookies.Add(cooki
e);
Line 77: }
Line 78: #endregion
If I create a cookie on the page it works finr just not in the master page code file it doesn't
Start Free Trial