| re: asp.net causes line breaks in javascript
I had a similar problem, my javascript has some document.write("< HTML stuff[color=blue]
>");[/color]
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" <sashashev@hotmail.com> wrote in message
news:ufN3HJEWDHA.2364@TK2MSFTNGP09.phx.gbl...[color=blue]
> 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"),[/color]
TextBox)[color=blue]
> 'Create the javascript string
>
> strJS =
> "javascript:ExtendedNotes_window=window.open('exte ndednotes.aspx?key=" &[/color]
key[color=blue]
> &
>[/color]
"','ExtendedNotes_window','scrollbars=no,width=480 ,height=300');ExtendedNote[color=blue]
> 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"
>[/color]
onClick="javascript:ExtendedNotes_window=window.op en('extendednotes.aspx?key[color=blue]
>[/color]
=18C2B4EB-F8B3-462B-AB74-7307D54DBEF7','ExtendedNotes_window','scrollbars=n o[color=blue]
> ,width=480,height=300');ExtendedNotes_window.focus ()" style="width:80px;"[/color]
/>[color=blue]
>
> When it doesn't - <input name="dgrdTimeSheet:_ctl2:txtDetails" type="text"
> maxlength="20" readonly="readonly" id="dgrdTimeSheet__ctl2_txtDetails"
> class="soft"
>[/color]
onClick="javascript:ExtendedNotes_window=window.op en('extendednotes.aspx?key[color=blue]
> =18C2B4EB-F8B3-462B-AB74-7307D54DBEF7
>[/color]
','ExtendedNotes_window','scrollbars=no,width=480, height=300');ExtendedNotes[color=blue]
> _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[/color]
guy[color=blue]
> had checked all the characters but no one provided an answer to him.
>
> This is really urgent. Can anyone help????
>
> Thanks,
>
> Sasha
>
>
>[/color] |