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

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -