简体   繁体   中英

__doPostBack is not working in .net 4.0

I have website in asp.net 4.0, where i used,

litAlert.Text = "<script language=javascript>alert('Some Error(s) occured while processing your request. Click Ok to view the Error Details.');__doPostBack('btnTemp','')</script>";                                            

But when i am trying to debug, it will not call btnTemp onclick event.

Please give me solution regarding this issue.

You could at this to Page_PreRender

protected void Page_PreRender(object sender, EventArgs e)
{
    this.Page.ClientScript.GetPostBackEventReference(litAlert, string.Empty);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM