c# - Change the function of a button if Logged in -
i new c#/asp.net-scene , can't seem syntax right myself. want button's text , function change when user logged in. code have far is:
if (session["patient"] == "logged in") { button3.visible = false; button4.visible = false; } else { button3.text = "create account"; button4.text = "log in"; }
as far understand code above changes button's text,but how change button's function?
thanks in advance:-)
you can implement same switch in buttons event handler , call different methods.
if (session["patient"] == "logged in") { loggedinmethod(); } else { anonymousmethod(); }
Comments
Post a Comment