How to Pass textbox value using @html.actionlink in asp.net mvc 3

后端 未结 4 2061
盖世英雄少女心
盖世英雄少女心 2020-12-11 01:55

How to Pass value from text using @html.actionlink in asp.net mvc3 ?

4条回答
  •  旧时难觅i
    2020-12-11 02:15

    you can use this code (YourValue = TextBox.Text)

    Html.ActionLink("Test", new { controller = "YourController", action = "YourAction", new { id = YourValue }, null );
    
    public class YourController : Controller
    {
            public ActionResult YourAction(int id)
            {
                return View("here your value", id);
            }
    }
    

提交回复
热议问题