"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
Adil is you use second parameter in window.open which is absent in your code, give him name to second parameter of
window.open
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
adilahmedmd@...
Participant
1089 Points
625 Posts
Page.ClientScript.RegisterStartupScript
Dec 15, 2008 08:14 AM|LINK
Hi, all
In asp.net What does Page do, how we use it,
here i am using it to open a window , but it giving me. error Invalid argument
Page.ClientScript.RegisterStartupScript(
Me.GetType(), "client", "window.open('test.aspx','Height=300px, Width=700px, menubar=No, toolbar=no, scrollbars=yes');", True)manjul.dube
Participant
786 Points
167 Posts
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 08:21 AM|LINK
Page is calss within interface System.Web.UI..
Any aspx page is object or instance of this class. All Operation of Aspx page from creation to rendering is handled by this class.
sudhanva
Member
276 Points
124 Posts
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 08:21 AM|LINK
Page.RegisterStartupScript(
"clientScript", "<script>window.open('test.aspx",'Height=300px, Width=700px, menubar=No, toolbar=no, scrollbars=yes');</script>");Try this.
Mr^B
Star
12726 Points
2245 Posts
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 08:45 AM|LINK
Erm, why are you specifying <script> in the script tag? That's the whole point of Page.RegisterStartupScript, you don't need to specify that.
The script seems to work fine with FireFox, but not with IE, so it's probably IEs popupblocker that you are having trouble with.
Best advice? Don't use window.open, it's ugly and not likely to work very well. Instead consider using an AJAX popup instead:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PopupControl/PopupControl.aspx
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 08:53 AM|LINK
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
dotnet_bug
Member
365 Points
151 Posts
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 09:24 AM|LINK
Hi,
call this javascript function
<script language="javascript" type="text/javascript">
function calendarPicker(strTxtRef)
{
window.open('./Your PopUp page.aspx?field=' + strTxtRef + '','Popup','titlebar=no,left=470,top=100,' + 'width=300,height=250,resizable=no');
}
</script>
Mark as answer if it helped!!
adilahmedmd@...
Participant
1089 Points
625 Posts
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 11:12 AM|LINK
Hi,
i am still unable to open my page in new window using
Page.ClientScript.RegisterStartupScript()
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 11:21 AM|LINK
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
adilahmedmd@...
Participant
1089 Points
625 Posts
Re: Page.ClientScript.RegisterStartupScript
Dec 15, 2008 12:11 PM|LINK
Page.ClientScript.RegisterStartupScript(
Me.GetType(), "client", "window.open('sender.aspx','_blank','Height=300px, Width=700px, menubar=No, toolbar=no, scrollbars=yes');", True)This works fine for me now,
Here what is the uses of page class and Gettype() how it works,