\r\n

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
the code below isn't working...

tblcel.Attributes.Add("onclick", "var frm=window.open('page1.aspx?abc=" +
"\r\nzzzaaa" +
"','_form1_','width=200,height=200,top=0,left=0,location=0, resizable=0,
scrollbars=0');frm.focus();");

without the "\r\n" it's working fine ? any idea why ?
 
if my class has a property that has "\r\n"-> _cls_.rem

tblcel.Attributes.Add("onclick", "var frm=window.open('page1.aspx?abc=" +
_cls_.rem +
"','_form1_','width=200,height=200,top=0,left=0,location=0, resizable=0,
scrollbars=0');frm.focus();");

still don't work...
 
Hi,
hi,
the code below isn't working...

tblcel.Attributes.Add("onclick", "var frm=window.open('page1.aspx?abc=" +
"\r\nzzzaaa" +
"','_form1_','width=200,height=200,top=0,left=0,location=0, resizable=0,
scrollbars=0');frm.focus();");

without the "\r\n" it's working fine ? any idea why ?

Because JavaScript strings, unlike HTML, cannot be placed on more than
one line. Your best choice for onclick attributes and the likes is to
use a JavaScript function to place your code in, and to call this
function from the onclick attribute.

tblcel.Attributes.Add( "onclick", "myJavaScriptFunction();");

HTH,
Laurent
 
Oren said:
tblcel.Attributes.Add("onclick", "var frm=window.open('page1.aspx?abc=" +
"\r\nzzzaaa" +
"','_form1_','width=200,height=200,top=0,left=0,location=0, resizable=0,
scrollbars=0');frm.focus();");

"\r\n" = "%0d%0a" = server.URLEncode(chr(13))+ server.URLEncode(chr(10))

try google keywords like url encoding asp.net
 
Back
Top