Response.Write inside gridview with updatepanel

. Tuesday, June 5, 2012
0 comments

Hi guys, if you are using functionality which includes response.write on button click eg : export to pdf or xls etc and its inside gridview and gridview is inside content template of UpdatePanel then response.write will not work.

Why ?

because you’re firing an ajax request (xmlhttprequest) and with response.write it actually refresh the html content which is not possible.

take an example from aspx here :

 




























InvoiceNumber
CustomerName
BillerName













from code above the thing which need to note is this



 




by specifying Postback Trigger Id with Gridview control you can PostBack controls of Gridview.



Happy coding.. Thanks