ASP.NET - Is it possible to trigger a postback from server code?

前端 未结 5 718
温柔的废话
温柔的废话 2021-01-11 16:03

Is it possible to to programmatically trigger a postback from server code in ASP.NET? I know that it is possible to do a Response.Redirect or Server.Transfer to redirect to

5条回答
  •  没有蜡笔的小新
    2021-01-11 16:35

    For those using newer versions of .NET, you have to use Page.ClientScript.GetPostBackEventReference since 'this.GetPostBackEventReference(...)' is obsolete. Also probably Page.ClientScript.RegisterStartupScript(...

提交回复
热议问题