开发者

MVC actionlink parameter access from resulting view

开发者 https://www.devze.com 2023-04-12 17:51 出处:网络
I have my URL /Admin/EditUser/18094c7d-4013-4723-81d2-0f2a8开发者_StackOverflow中文版63341db?pwchange=True which is got my passing parameters via an action link new { id = ID, pwchange = true} . How d

I have my URL /Admin/EditUser/18094c7d-4013-4723-81d2-0f2a8开发者_StackOverflow中文版63341db?pwchange=True which is got my passing parameters via an action link new { id = ID, pwchange = true} . How do i access the pwchange from the view?

I can do this in other web languages such as PHP with a simple _GET, in MVC however, i can't seem to find an option


You could do something like this in your controller -

var pwchange = Request.QueryString["pwchange"].ToString(); 

Then pass your value to the view via a view object or in the ViewBag

0

精彩评论

暂无评论...
验证码 换一张
取 消