Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP ASP.NET ASP:NET ASP>NET , +
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 16-Jan-13 21:31pm
GDdixit525
Edited 29-Jan-13 1:01am
v2
Comments
Sergey Alexandrovich Kryukov at 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
khiladi786 at 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 at 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
khiladi786 at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Add this JavaScript function in the head section of your page:
function openChildPopup(id)
{
window.open("childPage.aspx?id=" + id,"myWindow");
return false;
}
Add this code inside your GridView's 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 + "');");
}
Now on your childPAge.aspx use querystring to access the details.
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100