Get Child window values to parent window..

Posted by Gopal_nivas under ASP.NET on 2/22/2011 | Points: 10 | Views : 5449 | Status : [Member] | Replies : 11
hi..
i have two pages a and b;
in a i want to call the page b and page b contains gridview with image and price.
if i clicked a particular image the corresponding image url and corresponding image price should be displayed in my page a.

(for image i used <img> tag and for price i used label & hyperlink)
i.e)parent and child window concept..

how to do this..

need ur suggestions with example..

regards
gopal.s




Responses

Posted by: Madhu.b.rokkam on: 2/22/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Incase b is a pop up you can do this using javascript function where you need to set the
window.returnvalue which gets returned to the parent window.

If its a different independent page u can do this either by passing values using session or querystring.


Thanks and Regards
Madhu

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 2/22/2011 [Member] Starter | Points: 25

Up
0
Down
hi madhu..

thanks for ur reply..

yes b is pop up window only..

i was used java script only to get the values..
it returns image url value perfectly into parent window..
but it doesnot return the corresponding price . but it returns only the 1st row price.

this is my java script in my child window.

function GetRowValue(val) {
debugger;
var price = document.getElementById("ctrlCustomizeProduct_dlInsertCategories_ctl00_hdnfd").innerText;
window.opener.GetLogoUrl(val.href, price);
window.close();
}
(for image i used <img> tag.)
here the price id differs for each row in gridview.
so dynamically how to get corresponding row price during image click in my child window and pass the url and corresponding price to parent window..


need ur suggetsions with example...
regards
gopal.s




Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 2/22/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Gopal_nivas



u use pass your value as a querystring . then second page fetch querystring and Fill your Gridview with images . .

Best Regard's
Prabhakar

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/22/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi gopal,
Please refer to my article
http://www.dotnetfunda.com/articles/article1182-calculate-running-total-in-a-grid-view-and-display-.aspx
How we obtain the values using javascript.

Let me know if you still have any issues.

Thanks and Regards
Madhu

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 2/22/2011 [Member] Starter | Points: 25

Up
0
Down
hi prabha..

thanks for ur reply..

but my requirement is through javascript to achieve this..

how to do this..

need ur suggestions
regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 2/22/2011 [Member] Starter | Points: 25

Up
0
Down
hi madhu..

thanks for ur reply..

but my requirement is to pass child window(pop up) values to the parent window.

ho do to that..
for my coding its working partially i.e) it sends url info. correctly but not price.

need ur suggetsions with example

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/22/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
I will try to do a sample on this and will post that.

Check if you are getting the correct price in this function itself using alert if you are getting you can concatnate and pass to parent window using window.returnvalue

If you are not getting the correct price then u need to correct you code to pick the right price.

Thanks and Regards
Madhu

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 2/22/2011 [Member] Starter | Points: 25

Up
0
Down
no madhu

i am not getting the correct price..
it returns 1st row price only if i clicked 3 rd row.

need ur suggetsions

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/22/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi Gopal,

I have posted an article on this. You can use that.
Let me know if you still have any issues.


Thanks and Regards
Madhu

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 2/23/2011 [Member] Starter | Points: 25

Up
0
Down
hi madhu..

nice artilce..
it helped me lot..

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/23/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
I think recently Madhu has submitted the article, you can see that, very nice one :)

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response