Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello all....

i want to open a child window (which must be a aspx page , not an htmlpage) in my parent window on click of a link button ,...and some data goes from parent window to child window , on behalf od this i show some information on child page(which is must be a aspx page) i am unable to open this type of window. parent page and child page ..both are aspx page. how can i do this....pls give suggestion....thnx in advance...


i write this in my head section...

function openChildPopup(id)
{
window.open("childPage.aspx?id=" + id,"myWindow");
return false;
}


and this in rowdatabound event...

if(e.Row.RowType = DataControlRowType.DataRow)
{
string id = YourGridView.DataKeys[e.Row.RowIndex].Value.ToString();
Button btn = new Button();
btn = (Button)e.Row.FindControl("yourButtonID");//yourButtonID is the id of
// button in GridView row.
btn.Attributes.Add("onclick","return openChildPopup('" + id + "');");
}

but it open a same size of window as parent in new tab...(i have already do this, it's not my problem) i want to open a small size window inside parent window(, not in new tab)...thats my problem...suggest
Posted
Updated 29-Jan-13 0:01am
v2
Comments
Sergey Alexandrovich Kryukov 22-Jan-13 13:16pm    
Here is a big warning for you: stop posting all your fake "answers".
"Add your solution here" is reserved for the cases when you try to provide some help, in response to some member's question.

All your posts were not answers, but comments, or... who knows what.
Use "Improve question", add comment, reply to existing comment, but don't post it all as "solution".

Remember: this is serious enough; a number of members already lost their membership due to this kind of abuse. For now, I removed such posts for you, which can only preserve you from fatal abuse reports, but please consider yourself warned and don't do it anymore.

—SA
GDdixit 23-Jan-13 4:11am    
hello mr.Sergey Alexandrovich Kryukov ..what you want to say that i am sending a fake answers...what you want to say ?first see the solution first ...than comment here. it's more good.ok

the code provided here is not working....
you are really funny...no idea ..why post such a bad comment here on my profile
Sergey Alexandrovich Kryukov 23-Jan-13 4:24am    
Do you understand that I protected you from banning your account? I personally would not care much: you are at risk of loosing your membership, not me.

It's serious enough: it's up to you how to post, but you really risk having your account banned. So far, all accounts exposed to abuse watch were really cancelled. And the decision was done by voting of members, and the members would look at your real posts, not at my "bad" comment.

I don't understand why are you unhappy about that. Anyway, I wish you be all right.
—SA
GDdixit 23-Jan-13 5:05am    
it's ok...

you are top experts this month...

can you solve my problem...
(see solution 3)
Sergey Alexandrovich Kryukov 23-Jan-13 12:11pm    
"Top expert" it totally irrelevant, thank you.

Look, I hope nobody will report to ban your account due to Solution 3, but mostly because it's just one case (I removed others), but Solution 3 itself will be reported to abuse or removed, because we should really have to do it to keep the site in order. Here is what you need:

Remove Solution 3, and put its text into body of your question using "Improve question". Perhaps you problem is some misreading, but it's the time to do it properly.

—SA

1 solution

Add this JavaScript function in the head section of your page:
JavaScript
function openChildPopup(id)
{
window.open("childPage.aspx?id=" + id,"myWindow");
return false;
}

Add this code inside your GridView's RowDataBound event:
C#
if(e.Row.RowType = DataControlRowType.DataRow) 
{
string id = YourGridView.DataKeys[e.Row.RowIndex].Value.ToString();
Button btn = new Button();
btn = (Button)e.Row.FindControl("yourButtonID");//yourButtonID is the id of 
// button in GridView row.
btn.Attributes.Add("onclick","return openChildPopup('" + id + "');");
}

Now on your childPAge.aspx use querystring to access the details.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900