c# - how to use session in hyper link selection -
this code link, want navigate if , if session not null, how can it, please me...
<asp:hyperlink id="hyperlink1" navigateurl="year1sem1sub1.aspx" runat="server" align="left" onclick=(>cis 11301 fundamentals of information systems</asp:hyperlink> <img src="images/guestpic.jpg" align="right"/>
this authentication.ascx code
public partial class webusercontrol1 : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { if (session["loggeduser"] == null) { response.redirect("logintothesite.aspx"); } } }
it's not clear want hyperlink
, think understand mean
if (session["loggeduser"] != null) { hyperlink1.navigateurl = "year1sem1sub1.aspx"; // // or response redirect here // } else { hyperlink1.visible = false; }
Comments
Post a Comment