PC Review


Reply
Thread Tools Rate Thread

asp.net causes line breaks in javascript

 
 
Juan Valera
Guest
Posts: n/a
 
      1st Aug 2003


I had a similar problem, my javascript has some document.write("< HTML stuff
>");

In my case the error is in the editor, when it opens the file it inserts
some breaklines after the > signs and the write() is useless. If the source
is fixed and saved the error does not occurs anymore. I tried to find the
right editor settings, but after a while I gave up. Now, every day, when the
files are first open I look for these lines (not many in may case) and I
manually fix it.


"Sasha Shevelev" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> I can;t believe no one else has had this prob but here goes...
>
> I add some javascript into my page and asp.net sometimes (not always) puts
> the js into my page with a line break rendering it useless...
>
>
> Here is my code...
>
> Dim txtDetails As TextBox = CType(e.Item.FindControl("txtDetails"),

TextBox)
> 'Create the javascript string
>
> strJS =
> "javascript:ExtendedNotes_window=window.open('extendednotes.aspx?key=" &

key
> &
>

"','ExtendedNotes_window','scrollbars=no,width=480,height=300');ExtendedNote
> s_window.focus()"
>
> txtDetails.Attributes.Add("onClick", strJS)
>
>
>
> Here is the source wjhen it runs.....
>
> When it works the source code looks like (take wrapping off) - <input
> name="dgrdTimeSheet:_ctl2:txtDetails" type="text" maxlength="20"
> readonly="readonly" id="dgrdTimeSheet__ctl2_txtDetails" class="soft"
>

onClick="javascript:ExtendedNotes_window=window.open('extendednotes.aspx?key
>

=18C2B4EB-F8B3-462B-AB74-7307D54DBEF7','ExtendedNotes_window','scrollbars=no
> ,width=480,height=300');ExtendedNotes_window.focus()" style="width:80px;"

/>
>
> When it doesn't - <input name="dgrdTimeSheet:_ctl2:txtDetails" type="text"
> maxlength="20" readonly="readonly" id="dgrdTimeSheet__ctl2_txtDetails"
> class="soft"
>

onClick="javascript:ExtendedNotes_window=window.open('extendednotes.aspx?key
> =18C2B4EB-F8B3-462B-AB74-7307D54DBEF7
>

','ExtendedNotes_window','scrollbars=no,width=480,height=300');ExtendedNotes
> _window.focus()" style="width:80px;" />
>
> This obviously causes unterminated string constant. It's not the editor I
> view my source in either. I saw another posting similar to mine and the

guy
> had checked all the characters but no one provided an answer to him.
>
> This is really urgent. Can anyone help????
>
> Thanks,
>
> Sasha
>
>
>



 
Reply With Quote
 
 
 
 
Sasha Shevelev
Guest
Posts: n/a
 
      1st Aug 2003
Hi there,

I can;t believe no one else has had this prob but here goes...

I add some javascript into my page and asp.net sometimes (not always) puts
the js into my page with a line break rendering it useless...


Here is my code...

Dim txtDetails As TextBox = CType(e.Item.FindControl("txtDetails"), TextBox)
'Create the javascript string

strJS =
"javascript:ExtendedNotes_window=window.open('extendednotes.aspx?key=" & key
&
"','ExtendedNotes_window','scrollbars=no,width=480,height=300');ExtendedNote
s_window.focus()"

txtDetails.Attributes.Add("onClick", strJS)



Here is the source wjhen it runs.....

When it works the source code looks like (take wrapping off) - <input
name="dgrdTimeSheet:_ctl2:txtDetails" type="text" maxlength="20"
readonly="readonly" id="dgrdTimeSheet__ctl2_txtDetails" class="soft"
onClick="javascript:ExtendedNotes_window=window.open('extendednotes.aspx?key
=18C2B4EB-F8B3-462B-AB74-7307D54DBEF7','ExtendedNotes_window','scrollbars=no
,width=480,height=300');ExtendedNotes_window.focus()" style="width:80px;" />

When it doesn't - <input name="dgrdTimeSheet:_ctl2:txtDetails" type="text"
maxlength="20" readonly="readonly" id="dgrdTimeSheet__ctl2_txtDetails"
class="soft"
onClick="javascript:ExtendedNotes_window=window.open('extendednotes.aspx?key
=18C2B4EB-F8B3-462B-AB74-7307D54DBEF7
','ExtendedNotes_window','scrollbars=no,width=480,height=300');ExtendedNotes
_window.focus()" style="width:80px;" />

This obviously causes unterminated string constant. It's not the editor I
view my source in either. I saw another posting similar to mine and the guy
had checked all the characters but no one provided an answer to him.

This is really urgent. Can anyone help????

Thanks,

Sasha



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to get line-breaks for a JavaScript 'alert' message using ClientScript.RegisterStartUpScript Wayne Deleersnyder Microsoft C# .NET 3 6th Feb 2007 03:22 AM
replace auto line breaks with manual line breaks DavidH Microsoft Word Document Management 4 29th Oct 2005 11:57 PM
Find & Replace Line Breaks with Paragraph Breaks Jeremy Microsoft Frontpage 9 18th May 2004 09:17 PM
Re: javascript causing line breaks PJ Microsoft ASP .NET 1 4th Aug 2003 01:56 AM
asp.net causing line breaks in javascript Sasha Shevelev Microsoft Dot NET Framework 1 1st Aug 2003 06:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 AM.