?
Solved

Access hidden field value on an HTML page from an aspx page!

Posted on 2005-03-24
16
Medium Priority
?
590 Views
Last Modified: 2006-11-17
Hi,

We have a hidden field on our "top" framset containing a hidden field.

Without using cookies we would like to access this value from an aspx page.

It's easy from Javascript ie. top.Hidden1.value but we dont know how to do it from within our server side code.

Thanks.

James.
0
Comment
Question by:JAMES
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 4
  • +1
16 Comments
 
LVL 11

Expert Comment

by:sachiek
ID: 13619794
Is it a server control or client control?


Sachi
0
 

Author Comment

by:JAMES
ID: 13619805
The hidden field is a client control - I dont think you can have server side controls on an HTML page.

Thanks.
0
 
LVL 11

Expert Comment

by:sachiek
ID: 13619827
IN Aspx page try to have a javascript to access that frame.

Sachi
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JAMES
ID: 13619839
I can access it from Javascript but I am unsure how to pass that value back to my server side code!
0
 
LVL 11

Expert Comment

by:sachiek
ID: 13619852
After geting that value with javascript, explicitly postback from javascript.

So when postback you can pass your client value back to server control.

Sachi
0
 

Author Comment

by:JAMES
ID: 13619859
If you are thinking of passing it as a querystring I can't do that as the query is larger than the permitted size in IE!
0
 
LVL 9

Expert Comment

by:Type25
ID: 13619875
James, can you give me an idea of what you want to do with this value?
0
 
LVL 9

Expert Comment

by:Type25
ID: 13619880
on the server that is
0
 

Author Comment

by:JAMES
ID: 13619904
I want to write it to a db.
0
 
LVL 11

Expert Comment

by:sachiek
ID: 13619905
Here is how a example how to post it from Client side.

http://www.codeproject.com/aspnet/ClientObjectPostBack.asp
0
 
LVL 9

Expert Comment

by:Type25
ID: 13619953
You can't (easily)

The reason being, the page has already reached the client when you want to return the value from another frames textbox... which you can only do with client side script.

So, as sachiek has suggested..(kind of :) ) , you'll need to add some client script to your page that will submit your other frame to your aspx page and then read the value from the request object.



0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 2000 total points
ID: 13619972
have a hidden field in ur main page and make it runat=server
<input type = hidden name = "MyHiddenText" value = "" runat=server>

in the load event for the same page call a javascript function to populate this value

<body onload = "javascript:urForm.MyHiddenText.value =  top.frames("topFrameName").Hidden.value;">


u can then acces the value in the server (code-behind) using "MyHiddenText.value"
0
 
LVL 9

Expert Comment

by:Type25
ID: 13619989
Good call Rejo!
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13619995
thx :-)
0
 

Author Comment

by:JAMES
ID: 13620033
Thanks for everyones input so far.

...Im thinking on your answers
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question