469,898 Members | 1,591 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Setting HiddenField .Value

Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.

In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by &lt; .

How can I change this behavior.
Thanks,
Efi

May 3 '07 #1
8 2204
You don't. Technically, this is very correct as < is only valid for HTML
elements. If it's anything else, it needs to be an &lt and that goes for
text as well as form field values. What you should do is run the
Server.HtmlDecode on the value of the hidden field value when you're
accessing it.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.

In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by &lt; .

How can I change this behavior.
Thanks,
Efi

May 3 '07 #2
You can't. The '<' and '>' characters are not legal values in a form field,
or anywhere else in an HTML document except as element brackets. That is why
they are HtmlEncoded when you put the string into the Hidden form field.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.

In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by &lt; .

How can I change this behavior.
Thanks,
Efi

May 3 '07 #3

Kevin Spencer כתב:
You can't. The '<' and '>' characters are not legal values in a form field,
or anywhere else in an HTML document except as element brackets. That is why
they are HtmlEncoded when you put the string into the Hidden form field.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.

In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by &lt; .

How can I change this behavior.
Thanks,
Efi
Thanks to both of you,
The Xml control does manage to output my xml as correct html, so why
it can and I can't (I sound like a little boy :-) )

May 3 '07 #4
That's because the Xml control is specifically designed to render (as HTML)
the result of an XSLT Transform on an XmlDocument. You were talking about a
hidden form field. Two different animals.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:
>
Kevin Spencer כתב:
You can't. The '<' and '>' characters are not legal values in a form field,
or anywhere else in an HTML document except as element brackets. That is why
they are HtmlEncoded when you put the string into the Hidden form field.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.
>
In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by < .
>
How can I change this behavior.
Thanks,
Efi
>

Thanks to both of you,
The Xml control does manage to output my xml as correct html, so why
it can and I can't (I sound like a little boy :-) )

May 3 '07 #5
Thanks.
Maybe you can help me solve my problem, in order to decrease the
number of times a user has to fetch data from the server, I'm saving
data in an hidden field, so when the user decides to display the new
data I'm using javascript to display it.

Do you have another idea how can I implement such a behavior ?

Thank you,
Efi
Peter wrote:
That's because the Xml control is specifically designed to render (as HTML)
the result of an XSLT Transform on an XmlDocument. You were talking abouta
hidden form field. Two different animals.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:

Kevin Spencer כתב:
You can't. The '<' and '>' characters are not legal values in a formfield,
or anywhere else in an HTML document except as element brackets. Thatis why
they are HtmlEncoded when you put the string into the Hidden form field.
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
>
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
>
"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.

In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by < .

How can I change this behavior.
Thanks,
Efi
Thanks to both of you,
The Xml control does manage to output my xml as correct html, so why
it can and I can't (I sound like a little boy :-) )
May 3 '07 #6
store it in Session (user-specific) or Cache (application specific) or even
Application state.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:
Thanks.
Maybe you can help me solve my problem, in order to decrease the
number of times a user has to fetch data from the server, I'm saving
data in an hidden field, so when the user decides to display the new
data I'm using javascript to display it.

Do you have another idea how can I implement such a behavior ?

Thank you,
Efi
Peter wrote:
That's because the Xml control is specifically designed to render (as HTML)
the result of an XSLT Transform on an XmlDocument. You were talking about a
hidden form field. Two different animals.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:
>
Kevin Spencer כתב:
You can't. The '<' and '>' characters are not legal values in a form field,
or anywhere else in an HTML document except as element brackets. That is why
they are HtmlEncoded when you put the string into the Hidden form field.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.
>
In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by < .
>
How can I change this behavior.
Thanks,
Efi
>
>
Thanks to both of you,
The Xml control does manage to output my xml as correct html, so why
it can and I can't (I sound like a little boy :-) )
>
>

May 3 '07 #7
Can Session data written by asp.net be read by javascript ?
Peter wrote:
store it in Session (user-specific) or Cache (application specific) or even
Application state.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:
Thanks.
Maybe you can help me solve my problem, in order to decrease the
number of times a user has to fetch data from the server, I'm saving
data in an hidden field, so when the user decides to display the new
data I'm using javascript to display it.

Do you have another idea how can I implement such a behavior ?

Thank you,
Efi
Peter wrote:
That's because the Xml control is specifically designed to render (asHTML)
the result of an XSLT Transform on an XmlDocument. You were talking about a
hidden form field. Two different animals.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"Efi Merdler" wrote:
>

Kevin Spencer כתב:
You can't. The '<' and '>' characters are not legal values in a form field,
or anywhere else in an HTML document except as element brackets. That is why
they are HtmlEncoded when you put the string into the Hidden formfield.
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
>
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
>
"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.

In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by < .

How can I change this behavior.
Thanks,
Efi


Thanks to both of you,
The Xml control does manage to output my xml as correct html, so why
it can and I can't (I sound like a little boy :-) )
May 3 '07 #8
Session data is server-side; javascript normally implies "client side" (in
the browser). You can marshal any server-side data to the client as long as
it can be converted to a string representation or JSON encoding, and make it
available in the browser to use via script.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:
Can Session data written by asp.net be read by javascript ?
Peter wrote:
store it in Session (user-specific) or Cache (application specific) or even
Application state.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Efi Merdler" wrote:
Thanks.
Maybe you can help me solve my problem, in order to decrease the
number of times a user has to fetch data from the server, I'm saving
data in an hidden field, so when the user decides to display the new
data I'm using javascript to display it.
>
Do you have another idea how can I implement such a behavior ?
>
Thank you,
Efi
>
>
Peter wrote:
That's because the Xml control is specifically designed to render (as HTML)
the result of an XSLT Transform on an XmlDocument. You were talking about a
hidden form field. Two different animals.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"Efi Merdler" wrote:

>
Kevin Spencer כתב:
You can't. The '<' and '>' characters are not legal values in a form field,
or anywhere else in an HTML document except as element brackets. That is why
they are HtmlEncoded when you put the string into the Hidden form field.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Efi Merdler" <fo****@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi,
In my code I'm doing some xml transformation, at the end I receive a
fully transformed html file.
I'm setting the Value property of an hidden field control to have the
content of this html file.
>
In the debugger I can see that the control contains the value
correctly, however when the page is displayed in a browser all <
symbols are replaced by < .
>
How can I change this behavior.
Thanks,
Efi
>
>
Thanks to both of you,
The Xml control does manage to output my xml as correct html, so why
it can and I can't (I sound like a little boy :-) )
>
>
>
>

May 4 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by sklett | last post: by
5 posts views Thread by hharry | last post: by
1 post views Thread by win | last post: by
7 posts views Thread by imbirek8 | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.