Click here to Skip to main content
15,892,575 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to open Excel file in asp.net Pin
vivekdeshpande13-Oct-06 19:16
vivekdeshpande13-Oct-06 19:16 
AnswerRe: How to open Excel file in asp.net Pin
islamkalil13-Oct-06 23:47
islamkalil13-Oct-06 23:47 
Questionupload gif/doc file to database Pin
Nizha J13-Oct-06 19:16
Nizha J13-Oct-06 19:16 
Questionpassing parameter using postbackURL property... Pin
Naif_Prof13-Oct-06 12:06
Naif_Prof13-Oct-06 12:06 
AnswerRe: postbackURL property..... [modified] Pin
Jay_se13-Oct-06 19:01
Jay_se13-Oct-06 19:01 
QuestionReportViewer Issue Pin
Christopher Stratmann13-Oct-06 9:13
Christopher Stratmann13-Oct-06 9:13 
AnswerRe: ReportViewer Issue Pin
Andy Brummer13-Oct-06 10:22
sitebuilderAndy Brummer13-Oct-06 10:22 
Questionjavascript alert function breaks with linefeed character Pin
#realJSOP13-Oct-06 9:00
mve#realJSOP13-Oct-06 9:00 
I have a aps.net website where I'm trying to show an alert via javascript.

I'm setting a string variable to the following in the code-behind:

m_strAssemblyMisMatch  = "<script language=\"javascript\">alert(\"" +
                         "This website may not function as expected due to assembly version \n" +
             "mis-matches that were detected during application initialization.  The \n" +
             "following mis-matches were found:\n\n" +
             strBadAss +
                     "\nPlease login and notify a support representative." +
                     "\");</script>";


The strBadAss variable contains text like
"\tAssemblyNameOne\n\tAssemblyNameTwo\n\tAssemblyNameThree\n"
.


I'm rendering this string in the aspx page with the following statement:

<%=m_strAssemblyMisMatch%>


If I leave the linefeed characters in the string, I get a javascript error claiming there's an un-terminated string constant, and the alert dialog is NOT displayed. If I remove all of the linefeeds, the alert dialog IS displayed (with everything on one line of course).

In an attempt to see if there was indeed an un-terminated string, I tried the following:

m_strAssemblyMisMatch  = "<script language=\"javascript\">alert(\"" +
                         "This website may not function as expected due to assembly version \n" +
                     "\");</script>";


Once again, if I left the linefeed in the string, it wouldn't work, but if I removed the linefeed character, it was fine.

Can anyone tell me what I'm doing wrong?






"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


AnswerRe: javascript alert function breaks with linefeed character Pin
Shog913-Oct-06 9:23
sitebuilderShog913-Oct-06 9:23 
GeneralRe: javascript alert function breaks with linefeed character Pin
#realJSOP13-Oct-06 9:43
mve#realJSOP13-Oct-06 9:43 
AnswerRe: javascript alert function breaks with linefeed character Pin
Rama Krishna Vavilala13-Oct-06 9:25
Rama Krishna Vavilala13-Oct-06 9:25 
GeneralRe: javascript alert function breaks with linefeed character Pin
#realJSOP13-Oct-06 9:44
mve#realJSOP13-Oct-06 9:44 
GeneralRe: javascript alert function breaks with linefeed character Pin
Rama Krishna Vavilala13-Oct-06 9:47
Rama Krishna Vavilala13-Oct-06 9:47 
GeneralRe: javascript alert function breaks with linefeed character Pin
Guffa13-Oct-06 16:28
Guffa13-Oct-06 16:28 
QuestionSending Audio content from ASPX page. Pin
hectorpc200613-Oct-06 8:34
hectorpc200613-Oct-06 8:34 
AnswerRe: Sending Audio content from ASPX page. Pin
WillemM13-Oct-06 9:12
WillemM13-Oct-06 9:12 
GeneralRe: Sending Audio content from ASPX page. Pin
hectorpc200613-Oct-06 10:12
hectorpc200613-Oct-06 10:12 
GeneralRe: Sending Audio content from ASPX page. Pin
WillemM13-Oct-06 21:22
WillemM13-Oct-06 21:22 
QuestionDisplay data as table in Crystal Report Pin
bins8813-Oct-06 8:03
bins8813-Oct-06 8:03 
AnswerRe: Grid view paging error Pin
WillemM13-Oct-06 9:14
WillemM13-Oct-06 9:14 
Questionsql delete statement error in asp page Pin
keroed_edmond13-Oct-06 6:29
keroed_edmond13-Oct-06 6:29 
AnswerRe: sql delete statement error in asp page Pin
Guffa13-Oct-06 7:14
Guffa13-Oct-06 7:14 
GeneralRe: sql delete statement error in asp page Pin
keroed_edmond13-Oct-06 12:36
keroed_edmond13-Oct-06 12:36 
AnswerRe: sql delete statement error in asp page Pin
Guffa13-Oct-06 15:34
Guffa13-Oct-06 15:34 
QuestionUpload large files Pin
felopater13-Oct-06 5:28
felopater13-Oct-06 5:28 

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.