Hi All,
I need to set the value in the hidden input control (which i have used in the child page) from the parent page. I don't want to use session, since i want to set it from the client-side of the parent page and i have to access the value in the server-side of the child page. I tried using javascript but the value didnt get set. I'm in need of a solution urgently.
Thanks & Regards
Aishwaria
![]() |
0 |
![]() |
hello my friend,
My suggestion is using querystring to send the value to the child page
code sample
parent page
<input id="Button1" type="button" value="button" onclick="window.open('Child.aspx?value=123')"/>
child page
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["value"] != "")
{
HiddenField1.Value = Request.QueryString["value"];
}
}hope it helps,
Jessica
Jessica Cao
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
![]() |
0 |
![]() |
I have the child page inside the frame and on click of the button in the parent page, i have submitted the page,
frameUpdater.document.forms[0].submit();
So that the page load method in the child page is called, and, based on the hiddenfield value certain operations are done in the page load. I just can't use window.open at this scenario, since i'm submitting the page which is already opened. So i need a way to set the hidden field value b4 the page is submitted.
![]() |
0 |
![]() |
I have the child page inside the frame and on click of the button in the parent page, i have submitted the page,
frameUpdater.document.forms[0].submit();
So that the page load method in the child page is called, and, based on the hiddenfield value certain operations are done in the page load. I just can't use window.open at this scenario, since i'm submitting the page which is already opened. i need a way to set the hidden field value before the page is submitted.
![]() |
0 |
![]() |
I'm not sure if I understand your problem, but I'll give it a shot.
In my application, my frame is called "flashdisplay" and I needed to pass a value to the page..so i did in javascript
if (window.frames.flashdisplay && window.frames.flashdisplay.doPassVar) {
window.frames.flashdisplay.doPassVar(flashindex);
flashindex++;
}
else{
//alert("flash object null");
}
where doPassVar is a javascript function inside the chidl page.
Child page
------------------------function doPassVar(args){
var sendText = args.value;
//do whatever with my value
}so you might want to mess around your javascript a little bit before your parent page is submitted. good luck
Liming Xu
Jumptree ASP.NET 2.0 Project Management - With Source Code, Free to Non Profit Org and Effectively Manage Projects/Tasks/Milestones
![]() |
0 |
![]() |
I've got one other problem. I've a requirement, suppose there are 3 pages(A, B & C) for which the design is exactly same as the other. In this scenario i have reused a single page for all the three. And as i told earlier i have places these three pages inside a frame. On click of the button i'd determine which page should be loaded in the frame with the change of appropriate display names and values. After the page is submitted from the parent page, in the client side of the child page i have used a javascript which initializes the page to be loaded in the frame. Though the frame source is assigned, the page load method in the child page doesn't get called and the previously loaded page gets called. For example, when we move from A-> B, on click of the button in B, it doesnt go C, it goes to A and on click of the button the next time it moves to C.
The code which i've used,
Client side - child page if(document.DatabaseInfo.hdnNavigatePage.value != "" && window.top.appMain != null) { window.top.appMain.ChangeFrame(document.DatabaseInfo.hdnNavigatePage.value); } Java script this.ChangeFrame = function(source) { if(source != "") this.frameElements.src = source; }Client side - child page
if(document.DatabaseInfo.hdnNavigatePage.value != "" && window.top.appMain != null)
{ window.top.appMain.ChangeFrame(document.DatabaseInfo.hdnNavigatePage.value); }
Java script
this
.ChangeFrame = function(source){
if(source != "")
this.frameElements.src = source;
}
![]() |
0 |
![]() |