Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > access hidden object from java script

Reply
Thread Tools

access hidden object from java script

 
 
Jeff User
Guest
Posts: n/a
 
      01-03-2008
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
 
Reply With Quote
 
 
 
 
Dina
Guest
Posts: n/a
 
      01-03-2008
On Jan 3, 9:25 am, Jeff User <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
Win 7 folders hidden despite 'show hidden' checked Boppy NZ Computing 10 01-23-2010 02:56 AM
How to refer to aspx hidden field from a Java script RuthG Javascript 5 06-18-2009 10:48 AM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
How would I discover the text in a block element hidden by overflow:hidden style being set? SolarCanine Javascript 2 09-20-2005 06:27 PM



Advertisments