Click here to Skip to main content
15,910,886 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Blazor component debugging Pin
Super Lloyd24-Aug-23 17:27
Super Lloyd24-Aug-23 17:27 
QuestionHTML SELECT CONTROL WITH RUNAT="SERVER Pin
tchia_k30-Jul-23 3:53
professionaltchia_k30-Jul-23 3:53 
AnswerRe: HTML SELECT CONTROL WITH RUNAT="SERVER Pin
Richard Deeming30-Jul-23 22:14
mveRichard Deeming30-Jul-23 22:14 
Question"Context.UserIdentifier" of SignalR is always null when I use CustomAuthenticationStateProvider in Blazor Server App Pin
Alex Wright 202221-Jul-23 3:45
Alex Wright 202221-Jul-23 3:45 
SuggestionRe: "Context.UserIdentifier" of SignalR is always null when I use CustomAuthenticationStateProvider in Blazor Server App Pin
Richard Deeming23-Jul-23 23:17
mveRichard Deeming23-Jul-23 23:17 
QuestionIs is possible to import an excel file with hyperlinks? Pin
samflex16-Jul-23 17:25
samflex16-Jul-23 17:25 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
Richard MacCutchan16-Jul-23 21:45
mveRichard MacCutchan16-Jul-23 21:45 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
samflex17-Jul-23 5:26
samflex17-Jul-23 5:26 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
Richard MacCutchan17-Jul-23 5:29
mveRichard MacCutchan17-Jul-23 5:29 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
samflex18-Jul-23 3:43
samflex18-Jul-23 3:43 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
Richard MacCutchan18-Jul-23 4:40
mveRichard MacCutchan18-Jul-23 4:40 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
RedDk18-Jul-23 7:19
RedDk18-Jul-23 7:19 
AnswerRe: Is is possible to import an excel file with hyperlinks? Pin
Andre Oosthuizen16-Jul-23 23:59
mveAndre Oosthuizen16-Jul-23 23:59 
AnswerRe: Is is possible to import an excel file with hyperlinks? Pin
Richard Andrew x6424-Jul-23 3:19
professionalRichard Andrew x6424-Jul-23 3:19 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
samflex24-Jul-23 6:34
samflex24-Jul-23 6:34 
QuestionIllustrating ad emails Pin
Ali Al Omairi(Abu AlHassan)10-Jul-23 2:35
professionalAli Al Omairi(Abu AlHassan)10-Jul-23 2:35 
QuestionAdvise on how to reuse code behind in asp.net VB pages Pin
Member 875830229-Jun-23 16:25
Member 875830229-Jun-23 16:25 
AnswerRe: Advise on how to reuse code behind in asp.net VB pages Pin
Andre Oosthuizen3-Jul-23 0:49
mveAndre Oosthuizen3-Jul-23 0:49 
GeneralRe: Advise on how to reuse code behind in asp.net VB pages Pin
Member 87583024-Jul-23 3:04
Member 87583024-Jul-23 3:04 
GeneralRe: Advise on how to reuse code behind in asp.net VB pages Pin
Andre Oosthuizen4-Jul-23 3:40
mveAndre Oosthuizen4-Jul-23 3:40 
AnswerRe: Advise on how to reuse code behind in asp.net VB pages Pin
Gerry Schmitz3-Jul-23 4:54
mveGerry Schmitz3-Jul-23 4:54 
GeneralRe: Advise on how to reuse code behind in asp.net VB pages Pin
Member 87583024-Jul-23 3:07
Member 87583024-Jul-23 3:07 
Question(SOLVED) StringBuilder error Pin
samflex23-Jun-23 4:43
samflex23-Jun-23 4:43 
Hi all,

We are currently having problem with data exported to excel.

When we review the exported file, some show values with exponential format.

To try to work around that, I have the code below with stringbuilder to fix the exponential format issue.

Public Sub GetExcel(ByVal dt As DataTable)
    Dim fileName As String = "file" & DateTime.Now.ToString("MMddyyyy") & ".xls"
    Response.AddHeader("content-disposition", "attachment;filename=" & fileName)
    Response.ContentType = "application/vnd.ms-excel"
    Dim stringWriter As StringWriter = New StringWriter()
    Dim htmlWrite As HtmlTextWriter = New HtmlTextWriter(stringWriter)
    Dim dtExportExcel As DataGrid = New DataGrid()
    dtExportExcel.DataSource = dt
    dtExportExcel.DataBind()
    dtExportExcel.RenderControl(htmlWrite)
    Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder()
    sb.Append("<html xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:o=""urn:schemas-microsoft-com:office:office"" xmlns:x=""urn:schemas-microsoft-com:office:xlExcel8"" xmlns=""http://www.w3.org/TR/REC-html40""> <head><style> table { mso-number-format:'0'; } </style></head> <body></html>")
    sb.Append(stringWriter & "</body></html>")
    Response.Write(sb.ToString())
    Response.[End]()
End Sub


When I run the code, I get an error on this line:
sb.Append(stringWriter & "</body></html>")


The error says, Operator '&' is s not defined for types 'StringWriter' and 'String'

Any ideas what this means?

Thanks in advance

modified 5-Jul-23 21:43pm.

AnswerRe: StringBuilder error Pin
Richard MacCutchan23-Jun-23 5:33
mveRichard MacCutchan23-Jun-23 5:33 
GeneralRe: StringBuilder error Pin
samflex23-Jun-23 5:47
samflex23-Jun-23 5:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.