access hidden object from java script

J

Jeff User

hi all

Using C#, .NET1.1.

I need to pass a string of text to the final html output and then
capture it with java script on the client side. I found that I can
place my string in and then access a textbox or a label from the js,
but only if the textbox or label is visible. If they are hidden (and
then need to be) then they are not created in the html output.

I also think I could access a hidden html INPUT tag, but, I dont know
how to place my string of text in an html control from the C# code.

Anyideas how I can hide a string of text from my C# and then get it
using the js?

Thanks
Jeff
 
D

Dina

hi all

Using C#, .NET1.1.

I need to pass a string of text to the final html output and then
capture it with java script on the client side. I found that I can
place my string in and then access a textbox or a label from the js,
but only if the textbox or label is visible. If they are hidden (and
then need to be) then they are not created in the html output.

I also think I could access a hidden html INPUT tag, but, I dont know
how to place my string of text in an html control from the C# code.

Anyideas how I can hide a string of text from my C# and then get it
using the js?

Thanks
Jeff

Jeff,

Just place a html INPUT Hidden tag and use Runat="Server". This would
expose the hidden Html control on the server side and u can access it
just like any other server control. use the "Text" property on the
server side to put in the value and use the "value" property in the
JS.

Hope this helps.

Regards, Dina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top