Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

redirect after reading cookies

$
0
0

hi 

i want to open links  after reading and chick the value of cookies i do something like that but it gets error 

<%
    string username = "admin";
    if (Request.Cookies["loginfile"]!=null)
	{
        if (Request.Cookies["loginfile"].Value=username)
        {
            Response.Write("<a href='Logout.aspx'>Logout</a> <a href='admin.aspx'>admincp</a>");
        }
        else
        {
            Response.Write("<a href='Logout.aspx'>Logout</a>");
        }
	}
      else
	{
            Response.Write("<a href='Login.aspx'>Login</a>    <a href='Register.aspx'>register</a>");
	}
 %>

what is the correct code to do like that ??


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>