开发者

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

开发者 https://www.devze.com 2023-04-12 00:00 出处:网络
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.

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

精彩评论

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