troubleshooting Question

Change hyperlink NavigateURL

Avatar of Darebear
Darebear asked on
.NET ProgrammingASP.NET
8 Comments1 Solution1581 ViewsLast Modified:
Hello.

When a user logs in I'm trying to change a Hyperlink NavigateURL based on their role. The code seems to work and the values get assigned to the hyperlink control if I debug the code but the actual Hyperlink on the page does not get refreshed. The hypelink and login control is is on my master page. How can I redraw or refresh the link?

 Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
        If Roles.IsUserInRole(Login1.UserName, "Role1") Then
            HyperLinkAdmin.NavigateUrl = "page1.aspx"
            HyperLinkAdmin.Text = "Admin Role 1"
         End If
        If Roles.IsUserInRole(Login1.UserName, "Role2") Then
            HyperLinkAdmin.NavigateUrl = "page2.aspx"
            HyperLinkAdmin.Text = "Admin Role 2"
           
        End If
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros