Reputation:
I have a regular page.When i clicked on a button it will be open in that page with some asp controls. what i need is that i want to open that page in a pop up page with close button inside it.I searched but i didn't find a properly cod for this. can any body help me? thanks
Upvotes: 1
Views: 33664
Reputation: 51
hi all Kindly use the below code
function ShowPopup() {
$("#panOne").dialog({
autoOpen: true,
appendTo: "form",
height: 600,
width: 900
});
}
appendTo: "form"
is Important as if you are not using it will autopostback
all values
Upvotes: 0
Reputation: 34
<script type="text/javascript">
function OpenPopup() {
window.open("ProductClass.aspx", "List", "toolbar=no, location=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width=900,height=500,left=430,top=100");
return false;
}
</script>
Upvotes: 1
Reputation: 163
Use the below code
ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "window.location.href = 'Home.aspx';", true);
Upvotes: 1
Reputation: 17614
Use return before your function
<html>
<body>
<script type="text/javascript">
function windowOpen() {
myWindow=window.open('http://myurl.com','_blank','width=200,height=100, scrollbars=no,resizable=no')
myWindow.focus()
return false;
}
</script>
<asp:button id="btnClick" text="Open Window" onClientClick="return windowOpen()">
</body>
</html>
Upvotes: 1
Reputation: 10561
You can use windows.open in javascript.
<html>
<body>
<script type="text/javascript">
function windowOpen() {
myWindow=window.open('http://myurl.com','_blank','width=200,height=100, scrollbars=no,resizable=no')
myWindow.focus()
}
</script>
<input type="button" value="Open Window" onclick="windowOpen()">
</body>
</html>
Upvotes: 1