action方法接收瀏覽器引數的方式有4種:
1、模型繫結
2、request方法
3、根據url的規則來接收
4、formcollection form
1、模型繫結
效果圖:
後臺接收:
**:models:(在這裡我建立了一個student實體)
public class student
public string id
}介面:
controller:
[httppost]
public actionresult add(models.student model)
其他三種方式 也很類似,總之四種傳遞方式很相似,用哪個都可以,把介面上的值設定好了,name屬性的使用,form action,以及type屬性的使用,這幾個寫好了,其他的都一樣了。