ASP.NET MVC doesn't work with ViewState and Postback?

后端 未结 3 1312
故里飘歌
故里飘歌 2020-12-02 15:49

Perhaps this is a naive question. In my understanding, ASP.NET MVC cannot work with ViewState and Postback which is fundamentals of ASP.NET forms. Is that correct?

I

3条回答
  •  死守一世寂寞
    2020-12-02 16:42

    This might surprise you, but I accidentally dropped a Button on a MVC page, and implemented the Click event, and it actually worked!

    Please correct me if I'm wrong, but I think the does not need a ViewState. It should create a simple HTML tag , and if you don't change the properties of the button at run-time (text, event, ...), no VIEWSTATE will be needed.

    Maybe that's the reason why it worked.

提交回复
热议问题