ASP.NET Error
I have written this piece of code to export grid data to excel. And I get this error on debugging.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.








Sanjeeb LenkaPosted Jul 15, 2013, 2:59 AM
i checked your code just check you forgot to add this in both BSP and APP:
for Bsp:
for APP:
Sanjeeb LenkaPosted Jul 15, 2013, 5:47 AM
just try it in a separate page and check. 1st remove the javascript form the button click and check.
Vignesh KumarPosted Jul 15, 2013, 5:35 AM
Saw the link and looks like they have used Clear method in the program. So do you think this has to be added to the program.
Sanjeeb LenkaPosted Jul 15, 2013, 5:25 AM
I checked that problem . its came due to the buttons and other controls.
so i giving you a link just check that link its not in Jquery. you just check and reply.
http://stackoverflow.com/questions/7525537/how-to-exporting-to-excel-parent-and-nested-gridview-data
Vignesh KumarPosted Jul 15, 2013, 3:23 AM
Vignesh KumarPosted Jul 15, 2013, 2:36 AM
I have added the Jquery to the library already. Totally I HAVE THREE PAGES, where it works for LOB and doesn't works for BSP and APP pages in the attchment.
Sanjeeb LenkaPosted Jul 15, 2013, 2:20 AM
you forgot to add Jquery library in both the form just add that and check.
Mark it as answered if it helps you.
Vignesh KumarPosted Jul 15, 2013, 2:13 AM
I have attached two pages where I need to bring this functionality and I get the same error for these two pages.
Sanjeeb LenkaPosted Jul 15, 2013, 2:08 AM
Vignesh KumarPosted Jul 15, 2013, 1:58 AM
I tried your code and its still the same. Please look into the attachment for the error message.
Sanjeeb LenkaPosted Jul 12, 2013, 2:59 PM
You forgot to give the div id in your code. Means which div you write for grid. so i modified the code and attached it. just check it carefully before update it. Don't forget to attach the jquery.
if it helps you mark it as answered.
Vignesh KumarPosted Jul 12, 2013, 9:14 AM
THIS ATTACHMENT IS A DIFFERENT PAGE WHICH HAS NESTED GRID.
<
html = $.trim(html);
html = html.replace(/>/g,
html = html.replace(/$(
}
script language="javascript" type="text/javascript">function ExportDivDataToExcel() {var html = $("#divprint").html();'>');'<');"input[id$='HdnValue']").val(html);script>
t
Vignesh KumarPosted Jul 12, 2013, 8:56 AM
Sanjeeb LenkaPosted Jul 12, 2013, 8:31 AM
just add this line after the div end and before the content at last line of aspx.