AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Open Popup window from Gridview Select column in asp.net(C#)
Posted by Poornima on  10/14/2009 2:05:34 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int i = GridView1.SelectedRow.RowIndex;
string number = GridView1.SelectedRow.Cells[3].Text;
Session["filenumber"] = number;

Response.Redirect("history.aspx");

}
so when i click on select column in gridview ,it will take that number and go to another page 'history.aspx' ,there it will display the file in gridview with that particular number.
but now i want it to happen in another pop up window.

Post Your Reply Post New Question

 Viewer's Reply
Opening New Window And Redirect to Next Page from GridView Select Command
Answered By Moderator1 on 10/14/2009 9:49:16 PM
Hi,

Follow the code below,

In the GridView RowCommand Event, write the below code,

string number = GridView1.SelectedRow.Cells[3].Text;
Session["filenumber"] = number;

string strScript = "<script> ";
strScript += "var newWindow = window.open('History.aspx', '_blank','height=450, center:yes, width=600, status=no, resizable= yes, menubar=no, toolbar=no, location=yes, scrollbars=no, status=no');";
strScript += "window.location='History.aspx';";
strScript += "</script>";
Page.RegisterClientScriptBlock("strScript", strScript);

Instead of Session, you can also pass filenumber as query string.
Hope this code will help you and I will put this code in Tips & Tricks section.

Thanks.
 
create pop up window in datagrid
Answered By Irfan on 10/10/2011 12:26:47 AM
hai I want to display a pop up window when i click any of the rows in a datagrid and the id of particular grid should be displayed

plz reply me soon
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Oracle Magazine
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
Washington Technology