kalaHasti
Mar 2nd, 2005, 04:20 AM
Hi,
I am having a strange problem. I need to pop up an aspx page from an asp button click in my aspx code behind page. I am using the following code for this in the click event of the button:
Page.RegisterClientScriptBlock("New","<script language=\'javascript\'>window.open(\'template.aspx?type=2&x=\'+300,\'DetailedView\',\'width=\'+300+\',height=\'+300+\',resi zable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0\');</script>");
But when I click on the button, nothing happens. If I press the ctrl button alongwith the aspx button, then the new page appears.
Why is this happening ? I have tried with many variations of window.open and the result is the same.
If I put the window.open in a javascript method and add the attributes to the aspx button, then it works fine. I have written the Javascript method in the html as:
function Show(x,nsw,nsh)
{
window.open('template.aspx?type=2&x='+x,'DetailedView','width='+nsw+',height='+nsh+',resizable=0,scr ollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0');
return false;
}
and added the attribute in the code behind's page_load event as:
this.butSort.Attributes.Add("onclick","return Show(300,300,300);" );
But, I do need to write it in the code behind page as I have to do some logical processings before the pop up is viewed.
I am using IE6 SP1. If I choose "View in Browser" option from the popup menu of the aspx page in the .net IDE, then one new window is opened for the popup...strange...
What to do ? Thanks in advance...
I am having a strange problem. I need to pop up an aspx page from an asp button click in my aspx code behind page. I am using the following code for this in the click event of the button:
Page.RegisterClientScriptBlock("New","<script language=\'javascript\'>window.open(\'template.aspx?type=2&x=\'+300,\'DetailedView\',\'width=\'+300+\',height=\'+300+\',resi zable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0\');</script>");
But when I click on the button, nothing happens. If I press the ctrl button alongwith the aspx button, then the new page appears.
Why is this happening ? I have tried with many variations of window.open and the result is the same.
If I put the window.open in a javascript method and add the attributes to the aspx button, then it works fine. I have written the Javascript method in the html as:
function Show(x,nsw,nsh)
{
window.open('template.aspx?type=2&x='+x,'DetailedView','width='+nsw+',height='+nsh+',resizable=0,scr ollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0');
return false;
}
and added the attribute in the code behind's page_load event as:
this.butSort.Attributes.Add("onclick","return Show(300,300,300);" );
But, I do need to write it in the code behind page as I have to do some logical processings before the pop up is viewed.
I am using IE6 SP1. If I choose "View in Browser" option from the popup menu of the aspx page in the .net IDE, then one new window is opened for the popup...strange...
What to do ? Thanks in advance...