Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i use linkbutton with name as signin in master page for go to login form. after i go to login form by using linkbutton then i want to change the name of linkbutton as signout in master page.

VB
Partial Class Site
    Inherits System.Web.UI.MasterPage



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.Label1.Text = Session("name")
        Me.Label1.Visible = True
        Me.Label3.Visible = True
    End Sub

    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click



        Me.LinkButton1.Text = "Sign out"
        Me.Response.Redirect("Login.aspx")




    End Sub
End Class


i used this it not work.how can i do it
Posted
Comments
John C Rayan 20-Feb-15 14:05pm    
Explain a bit more. Did you debug it to see if it goes to the click event. What's in the login form
ZurdoDev 20-Feb-15 15:07pm    
What's the question?

1 solution

Since LinkButton1 is the control that triggers this event, why don't you handle the current sender here?

VB
Dim button As LinkButton = TryCast(sender, LinkButton)
button.Text = "Sign out"


Are you sure you're required to redirect the user to login.aspx page once he has logged in? For me, this seems to be a logical error here.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900