Get POST data in C#/ASP.NET

后端 未结 4 543
刺人心
刺人心 2020-11-27 06:06

I am trying to get POST data, but I\'m having no luck. My code is below. When I click the form button nothing happens.

I expected at least my IDE to snap at A.

4条回答
  •  隐瞒了意图╮
    2020-11-27 07:01

    Try using:

    string ap = c.Request["AP"];
    

    That reads from the cookies, form, query string or server variables.

    Alternatively:

    string ap = c.Request.Form["AP"];
    

    to just read from the form's data.

提交回复
热议问题