Object reference not set to an instance of an object.
if (username1.Text == usernametxt.Text && password1.Text == password)
{
Response.Write("Login Sucessfull");
DateTime now = DateTime.Now;
myCookie.Value = username1.Text + '-' + roleid2;
myCookie.Expires = now.AddMinutes(1);
Response.Cookies.Add(myCookie);
getroles(roleid2, username1.Text);
...
Go to the complete details ...