Script(s)

what I learn is what u c

Posts Tagged ‘AJAX

How to Preserve Fileupload value in Asp.net ?

leave a comment »

If you form has Fileupload control along with other controls like dropdownlist, calendar.. you will be facing standard problem of Fileupload control losing value when other controls are selected.

Click here to read the article in full…

 

Written by gchandra

May 1, 2008 at 7:35 pm

AJAX – Export to Excel / Word

with 17 comments

If you are using Update Panel and try to Export gridview contents to EXCEL or Word, your asp.net page will throw nasty error. “Sys.WebForms.PageRequestManagerParserErrorException”

Its because AJAX & Response.write don’t go together.  By calling Response.Write() directly you are bypassing the normal rendering mechanism of ASP.NET controls. The bits you write are going straight out to the client without further processing (well, mostly…). This means that UpdatePanel can’t encode the data in its special format.

There are couple of ways to solve this problem.

1. Place the Export Button outside of Update Panel.

2. By Pass the Export Button using <Triggers>

 </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID=”cmdExport” />
        </Triggers>

</asp:UpdatePanel>
if your Export button is part of UserControl then specify usercontrolid:buttonid

 </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID=”uscSelCtl:cmdExport” />
        </Triggers>
    </asp:UpdatePanel>

More Reading…

Written by gchandra

January 8, 2008 at 10:12 am