c# - MVC QueryString is an empty collection -
i want use redirection requested url user wanted access after login somehow returnurl null. (i did research on topic half hour , didn't find solution working me.)
i debugged login view of app , i'm trying returnurl with
new { returnurl = request.querystring["returnurl"] }
inside of @using()
tag. saw querystring empty collection , tried use without querystring or viewbag.returnurl
neither 1 nor other worked me.
the controller has right parameters , redirect via redirecttolocal(returnurl)
doesn't matter if returnurl null.
in action methods,use code
redirecttoaction("login", "controllername", new { returnurl = request.url.absolutepath });
in login action method use
public actionresult login(loginviewmodel model, string returnurl){//code}
Comments
Post a Comment