i am creating a web app and i want to redirect page on button click and i used all the textbox and button as input field i can't see much about this on internet, how can i redirect to another page on button click(if id and password is validated)
for e.g i did all sql related queries in modal and i am passing true or false from modal (if true(redirect to login page))(if false(redirect to signup page)) what i need to do on my controller
[HttpPost]
public ActionResult testlogin(string username, string password)
{
// called my modal here and creates its object(modal m=new modal();)
//what to do now
}
in my modal i have sql query like
`sql command cmd=new sqlcommand("select * from empdet where empid='"+user+"' and pass='"+password+"'",con);
con.open();
SqlDataAdapter da=new SqlDataAdapter(cmd);
dataset ds=new dataset();
da.fill(ds);
if(ds.tables[0].rows.count>0)
{
bool true;
}
else
{
bool false;
}
con.close();
bool = Convert.ToBoolean(cmd.ExecuteReader());
return user;`
if bool returns true, the page should be redirect to welcome page otherwise redirect to login page