I am running into an issue. Basically what I am trying to do is to create an invoice and send it via email.
So I am using Ajax CalendarExtender and I do have the Toolscrkipt manager registered at the top of my page and I am using .net 4 with VS 2010.
So after a few failure I decided to export the asp:panel containing the Invoice to a CSV and then send the CSV to email. I google a few stuff and found a few codes, so this is my code for now when I hit create invoice button:
Dim SB As New StringBuilder()
Dim SW As New StringWriter(SB)
Dim htmlTW As New HtmlTextWriter(SW)
pnCreateInvoice.RenderControl(htmlTW)
Dim strOut As String = htmlTW.ToString
Dim strCSV As String
strCSV = tbInvoiceNumber.Text & "_" & tbClientName.Text
For Each c In System.IO.Path.GetInvalidPathChars
strCSV = strCSV.Replace("c", "")
Next
strCSV = strCSV.Replace("/", "-")
Dim TargetFile As StreamWriter
Try
TargetFile = New StreamWriter("~/invoices/" & strCSV & ".csv", True)
TargetFile.Write(htmlTW)
TargetFile.WriteLine()
TargetFile.Write(strOut)
TargetFile.Close()
lblCreateInvoiceError.Text = "Completed"
Catch ex As Exception
lblCreateInvoiceError.Text = ex.Message.ToString
End Try
This is the error I get when I hit the button:
Extender control 'tbInvoiceDateCalendarExtender' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter name: extenderControlDescription:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Extender control 'tbInvoiceDateCalendarExtender' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter
name: extenderControl Source Error:
Line 364: Dim SW As New StringWriter(SB)
Line 365: Dim htmlTW As New HtmlTextWriter(SW)
Line 366: pnCreateInvoice.RenderControl(htmlTW)
Line 367: Dim strOut As String = htmlTW.ToString
I found a way around it instead of trying to save it to CSV or XML there is something I am doing wrong and with all the googeling I did for 2 days and this forums I just decided to send the invoice via email to the customer lol. Problems solve. but thanks
for all the answers.
Member
10 Points
57 Posts
Panel to CSV to Email
Jan 09, 2014 07:58 PM|BreauP|LINK
Hey guys,
I am running into an issue. Basically what I am trying to do is to create an invoice and send it via email.
So I am using Ajax CalendarExtender and I do have the Toolscrkipt manager registered at the top of my page and I am using .net 4 with VS 2010.
So after a few failure I decided to export the asp:panel containing the Invoice to a CSV and then send the CSV to email. I google a few stuff and found a few codes, so this is my code for now when I hit create invoice button:
This is the error I get when I hit the button:
Extender control 'tbInvoiceDateCalendarExtender' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter name: extenderControl Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Extender control 'tbInvoiceDateCalendarExtender' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter name: extenderControl
Source Error:
Line 364: Dim SW As New StringWriter(SB) Line 365: Dim htmlTW As New HtmlTextWriter(SW) Line 366: pnCreateInvoice.RenderControl(htmlTW) Line 367: Dim strOut As String = htmlTW.ToString
All-Star
15648 Points
2151 Posts
Re: Panel to CSV to Email
Jan 12, 2014 09:04 PM|Happy Chen - MSFT|LINK
hi,
According to your description,i have a ScriptManagerProxy followed by a small javascript codeblock like so:
Please refer to the link below:
Strange Error - "Not A Registered Extender Control"
http://forums.asp.net/t/1078866.aspx?Strange+Error+Not+A+Registered+Extender+Control+
http://forums.asp.net/t/1526155.aspx
http://blogs.msdn.com/b/mharder/archive/2006/12/20/scriptcontrol-change-from-beta2-to-rc-scriptmanager-registerscriptdescriptors.aspx
Hope they can help you.
All-Star
48393 Points
12161 Posts
Re: Panel to CSV to Email
Jan 12, 2014 10:32 PM|chetan.sarode|LINK
Refer this - http://forums.asp.net/t/1929226.aspx
Team Lead, Product Development
Approva Systems Pvt Ltd, Pune, India.
Member
10 Points
57 Posts
Re: Panel to CSV to Email
Jan 15, 2014 11:10 AM|BreauP|LINK
I found a way around it instead of trying to save it to CSV or XML there is something I am doing wrong and with all the googeling I did for 2 days and this forums I just decided to send the invoice via email to the customer lol. Problems solve. but thanks for all the answers.