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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -