Search This Blog

March 23, 2009

Asp.Net Errors and Resolution

1. Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation.
When used updatePanel and fileupload controls a client side message displays as above.

To resolve this issue follow the following instructions. orginal link
http://forums.asp.net/p/1100270/2468298.aspx#2468298


<triggers>
<asp:postbacktrigger controlid="fileUpload1">
</triggers>

This works perfect whenever the FileUpload control is a child control of the UpdatePanel's ContentTemplate.However when the FileUpload control is a child control of e.g. a DetailsViews, which is a child control of the UpdatePanel's ContentTemplate, we should not postback the FileUpload control but it's container.
So in this case you would have to postback the DetailsView by using it's ID.

<triggers>
<asp:postbacktrigger controlid="detailsView1" />
</triggers>