im having a gridview in only page and on clicking a button column field Gridview1_RowCommand gets executed.What im stuck at is on how to pass a single refno(which is in the grid) to the popup page.i want to use this refno to generate a query
help on this will really be appreciated
the below code i wat i used and im stuck here..
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
Page.RegisterStartupScript("test", "<script language='javascript'>Openpopup();</script>");
}
<script language='javascript'>
var popupobj;
function Openpopup()
{
popupobj = window.open("popup.aspx", "_blank", "width=1000,height=500,statusbar=no,toolbar=no,scrollbars=no,resizable=no,navbar=no,screenX=800,screenY=800top=100,left=100");
popupobj.focus();
}
</script>
Since you are using RowCommand event, to be able to send this value to the Popup you need to set the RowIndex as a CommandArgument of the Button you are clicking to open the popup.
Set the Value(refno) to passed to Popup in DataKey.
Now in the RowCommand
This way now you have refno in the Javascript function argument. Pass this argument as a querystring in the Javascript popup function.
This way you can access refno in the Popup page.