By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,583 Members | 617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,583 IT Pros & Developers. It's quick & easy.

Help with this eror.. (Dataset as excel..)

P: n/a
I am programmatically adding a web user control to a webform. This User
Control displays the employee listing from a database into a datagrid. But
the calling webform should render the data as a excel spreadsheet.
I had the same logic working when the app had a simple web form with a
datagrid embedded in it. But it gives error when I separate the logic into a
pagelet. Below are the details:

<%@ Page ....%>
<%@ Reference Control ="~/emplist.ascx"%>
<link href="../styles.css" rel="stylesheet" type="text/css">
<form id="Test" method="post" runat="server"></form>

private sub Page_Load(Byval sender as System.object, ...)
response.contenttype = "application/ms-excel"

dim sPath as string = "~/modules/emplist.ascx"
dim c1 as Control = LoadControl(sPath)
dim objForm as Control = Page.FindControl('Test") ' pass the name
of the form
end sub

emplist.ascx: has a datagrid and the binds a dataset in the page_load event.

"Microsoft Excel" error prompt: Unable to read file.
"HTML Import Errors" prompt:
Problems came us in the following areas during load:
Missing fle: ...\Local Settings\Temporary Internet

Is there a better ( and easier ) approach to the above?


Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.