开发者

Passing User ID in form with Submit button (Razor asp.net)

I have a list of users that is displayed from a SQL db. Each user is appended with a delete button. I am not sur ehow to retrieve the seller.id from the submitted form in Page.Request object.

@foreach(var seller in Db.GetUser())
{
  <form method="post" id="form3"> @seller.FirstName 
    <INPUT TYPE="image" SRC="deleteButton.png" VALUE="X" name="@seller.I开发者_StackOverflow中文版d">  
  </form> 
}


You should add a hidden input to the form containing the ID.
You can then add a parameter to your action with the same name.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜