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

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -