Cookie only displayed on refresh?

前端 未结 2 1868
深忆病人
深忆病人 2021-01-26 12:45

I have some trouble understanding this one so here it is.

I\'m trying to set a cookie and display the value on the page using ASP.NET + C#.

he

2条回答
  •  无人及你
    2021-01-26 13:37

    The lblChangeToSmall_Click event is fired after the Page_Load event. Therefore the cookie write won't be available on the Request until the subsequent postback.

    It will be avaialable on the client immediately though.

提交回复
热议问题