need code for opening new window on button click (without using javascript)
-
i need code for when click on button it opens a new html window and automatically saves that page . :((
modified on Tuesday, January 20, 2009 5:03
window.open('url') from javascript.
Abhishek Sur
-
i need code for when click on button it opens a new html window and automatically saves that page . :((
modified on Tuesday, January 20, 2009 5:03
Use Javascript
javascript:var w=window.open('TestPage.aspx','', 'width=625,height=760,scrollbars=yes,resizeable=yes');
Hope it helpsVuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswam@its.co.za
-
Use Javascript
javascript:var w=window.open('TestPage.aspx','', 'width=625,height=760,scrollbars=yes,resizeable=yes');
Hope it helpsVuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswam@its.co.za
-
hi sir this only creates the page not save the page . can u tell how to write it without javascript.
-
hi sir this only creates the page not save the page . can u tell how to write it without javascript.
When you save a Page i don't understand what you mean , can you please elaborate. Thanks
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswam@its.co.za
-
hi sir this only creates the page not save the page . can u tell how to write it without javascript.
Jas 007 wrote:
can u tell how to write it without javascript.
then use Page.ClientScript.RegisterClientScriptBlock from codebehind
cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net
-
Jas 007 wrote:
can u tell how to write it without javascript.
then use Page.ClientScript.RegisterClientScriptBlock from codebehind
cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net
-
<%@ Page Language="C#"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> public void Page_Load(Object sender, EventArgs e) { // Define the name and type of the client scripts on the page. String csname1 = "PopupScript"; String csname2 = "ButtonClickScript"; Type cstype = this.GetType(); // Get a ClientScriptManager reference from the Page class. ClientScriptManager cs = Page.ClientScript; // Check to see if the startup script is already registered. if (!cs.IsStartupScriptRegistered(cstype, csname1)) { String cstext1 = "alert('Hello World');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true); } // Check to see if the client script is already registered. if (!cs.IsClientScriptBlockRegistered(cstype, csname2)) { StringBuilder cstext2 = new StringBuilder(); cstext2.Append("<script type=\"text/javascript\"> function DoClick() {"); cstext2.Append("Form1.Message.value='Text from client script.'} </"); cstext2.Append("script>"); cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false); } } </script> <html > <head> <title>ClientScriptManager Example</title> </head> <body> <form id="Form1" runat="server"> <input type="text" id="Message" /> <input type="button" value="ClickMe" onclick="DoClick()" /> </form> </body> </html>
Sathesh. Blessed is the season which engages the whole world in a conspiracy of love.
-
i need code for when click on button it opens a new html window and automatically saves that page . :((
modified on Tuesday, January 20, 2009 5:03
Jas 007 wrote:
i need code for when click on button it opens a new html window
That is not possible without Javascript. The only thing that a button can do without Javascript is to post a form to the server. You can use a link with
target="_blank"
to open it in a new window (or a new tab depending on browser settings).Jas 007 wrote:
and automatically saves that page
That is not possible, with or without Javascript. You can't do anything at all that involves the file system on the client computer without the interaction of the user.
Despite everything, the person most likely to be fooling you next is yourself.
-
Jas 007 wrote:
can u tell how to write it without javascript.
then use Page.ClientScript.RegisterClientScriptBlock from codebehind
cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net
-
<%@ Page Language="C#"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> public void Page_Load(Object sender, EventArgs e) { // Define the name and type of the client scripts on the page. String csname1 = "PopupScript"; String csname2 = "ButtonClickScript"; Type cstype = this.GetType(); // Get a ClientScriptManager reference from the Page class. ClientScriptManager cs = Page.ClientScript; // Check to see if the startup script is already registered. if (!cs.IsStartupScriptRegistered(cstype, csname1)) { String cstext1 = "alert('Hello World');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true); } // Check to see if the client script is already registered. if (!cs.IsClientScriptBlockRegistered(cstype, csname2)) { StringBuilder cstext2 = new StringBuilder(); cstext2.Append("<script type=\"text/javascript\"> function DoClick() {"); cstext2.Append("Form1.Message.value='Text from client script.'} </"); cstext2.Append("script>"); cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false); } } </script> <html > <head> <title>ClientScriptManager Example</title> </head> <body> <form id="Form1" runat="server"> <input type="text" id="Message" /> <input type="button" value="ClickMe" onclick="DoClick()" /> </form> </body> </html>
Sathesh. Blessed is the season which engages the whole world in a conspiracy of love.