c# - Contains Method doesnt work -


using code below, want compare usertype, if "student" want redirect student profile, etc.

but gets last else statement , writes error.

the returnquery method works because returns value "student".

string emailid = session["new"].tostring(); string usertype = returnquery(     "select usertype registration email = '" + lblemail.text + "'");  if (usertype.contains("student")) {              response.redirect("profile.aspx?email=" + emailid.tostring()); } else if (usertype.contains("company")) {      response.redirect("companyprofile.aspx?email=" + emailid.tostring()); } else if(usertype.contains("admin")) {     response.redirect("adminprofile.aspx?email=" + emailid.tostring()); } else     response.write("error"); 

if usertype="student" can use usertype.equals("student"); determine variable. here method.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -