access hidden object from java script

access hidden object from java script

am 03.01.2008 05:25:55 von 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

Re: access hidden object from java script

am 03.01.2008 05:31:54 von Dina

On Jan 3, 9:25 am, Jeff User wrote:
> 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