I have method like
UrlHelper.Action("login", "Authentication", HttpContext.Current.Request.Url.Scheme);
I want to pass query string parameter like "referrer?" = pageName to this method. How can I do it?
You can consider passing each of the individual properties for your object using something like this : @Url. Action("Action","Controller", new { PropertyA = Model. PropertyA, PropertyB = Model.
Action Method Parameters are most important in MVC. If you want to handle post request in action methods; MVC framework provided types of Action Methods Parameters. Action Method Parameters. We can organize the action methods for GET and POST requests separately.
You just have to decalre your parameter like this:
UrlHelper.Action("login", "Authentication", new { referrer = "Page Name" })
Then get the parameter in your Action:
Request.Params["referrer"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With