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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -