MVC razor form with multiple different submit buttons?

前端 未结 13 1961
-上瘾入骨i
-上瘾入骨i 2020-12-04 12:59

A Razor view has 3 buttons inside a form. All button\'s actions will need form values which are basically values coming input fields.

Every time I click any of butto

13条回答
  •  萌比男神i
    2020-12-04 13:33

    In case you're using pure razor, i.e. no MVC controller:

    
    
    @if (IsPost)
    {
        

    @Request.Form["SubmitForm"]

    }

    Clicking each of the buttons should render out Hello and World.

提交回复
热议问题