• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 594
  • Last Modified:

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

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
JAMES
Asked:
JAMES
  • 5
  • 5
  • 4
  • +1
1 Solution
 
sachiekCommented:
Is it a server control or client control?


Sachi
0
 
JAMESAuthor Commented:
The hidden field is a client control - I dont think you can have server side controls on an HTML page.

Thanks.
0
 
sachiekCommented:
IN Aspx page try to have a javascript to access that frame.

Sachi
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
JAMESAuthor Commented:
I can access it from Javascript but I am unsure how to pass that value back to my server side code!
0
 
sachiekCommented:
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
 
JAMESAuthor Commented:
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
 
Type25Commented:
James, can you give me an idea of what you want to do with this value?
0
 
Type25Commented:
on the server that is
0
 
JAMESAuthor Commented:
I want to write it to a db.
0
 
sachiekCommented:
Here is how a example how to post it from Client side.

http://www.codeproject.com/aspnet/ClientObjectPostBack.asp
0
 
Type25Commented:
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
 
RejojohnyCommented:
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
 
Type25Commented:
Good call Rejo!
0
 
RejojohnyCommented:
thx :-)
0
 
JAMESAuthor Commented:
Thanks for everyones input so far.

...Im thinking on your answers
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 5
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now