|
Home > Archive > Commerce Server General > March 2004 > how to stop HTML character conversion in the codebehind
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to stop HTML character conversion in the codebehind
|
|
| Dinesh Chadha 2004-03-01, 10:37 am |
| try putting "java script:" in front of code like this:
tb.Attributes.Add("onkeydown", "java script:if
((event.which && event.which == 13)...
-Dinesh Chadha
>-----Original Message-----
>Hi,
>When I programattically add javascript to an HTML element
using the
>codebehind, any ampersands get converted to HTML
character codes which ruins
>some logic elements. eg
>
>THIS
>tb.Attributes.Add("onkeydown", @"if ((event.which &&
event.which == 13)...
>
>TURNS INTO
>tb.Attributes.Add("onkeydown", @"if ((event.which &&
event.which ==
>13)...
>
>How can I stop this from happening? Is there some sort
of switch to use?
>
>Thanks,
>Lance
>
>
>
>.
>
| |
|
| Thanks, but that doesn't work - the ampersands are still rendered as &
Any other ideas?
"Dinesh Chadha" <anonymous@discussions.microsoft.com> wrote in message
news:498801c3ffa0$9d50bbf0$a001280a@phx.gbl...[color=darkred]
> try putting "java script:" in front of code like this:
>
> tb.Attributes.Add("onkeydown", "java script:if
> ((event.which && event.which == 13)...
>
> -Dinesh Chadha
>
>
> using the
> character codes which ruins
> event.which == 13)...
> event.which ==
> of switch to use?
| |
| Dinesh Chadha 2004-03-02, 4:37 pm |
| Try putting Javascript in the html and just put the name
here... Like this:
tb.Attributes.Add("onkeydown", "java script:return
javascriptfunctionname()");
I have used this lot of times and it works..
Good Luck
Dinesh Chadha
>-----Original Message-----
>Thanks, but that doesn't work - the ampersands are still
rendered as &
>Any other ideas?
>
>
>"Dinesh Chadha" <anonymous@discussions.microsoft.com>
wrote in message
>news:498801c3ffa0$9d50bbf0$a001280a@phx.gbl...
element[color=darkred]
>
>
>.
>
|
|
|
|
|