Monali
Monali

Reputation: 51

__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.

Upvotes: 0

Views: 567

Answers (1)

Hans Derks
Hans Derks

Reputation: 1027

You could at this to Page_PreRender

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

Upvotes: 1

Related Questions