Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 5th, 2005, 06:40 AM
Authorized User
 
Join Date: Nov 2004
Location: mumbai, maharashtra, India.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default asp.net-opening a new window

on the click of the login button on my default.aspx page ,
i want to open a new window and open the welcomepage.aspx into it.
how do i do this for asp.net using vb.net
__________________
.Net developer
Reply With Quote
  #2 (permalink)  
Old January 5th, 2005, 06:51 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Make use of Javascript. window.open() would help you solve this.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
Reply With Quote
  #3 (permalink)  
Old January 5th, 2005, 06:56 AM
Authorized User
 
Join Date: Nov 2004
Location: mumbai, maharashtra, India.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi vadivel..
window.open() is ok but how do i show contents of the welcomepage.aspx into the same page..
suneeta

.Net developer
Reply With Quote
  #4 (permalink)  
Old January 5th, 2005, 07:16 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

I am presuming that .. you are looking for the syntax of using window.open!

It is window.open(PageName, WindowName, FeatureList).

Sample:
window.open("welcomepage.aspx") will do.

Some of the featureList which comes to my mind now are as follows:
status, toolbar, location, menubar, resizable, scrollbars, height, width etc.,

Sample 2:
window.open("dummypage.aspx", "testwindow", "location=1, width=200, height=150")

-- This new window would be of size 200x150 and it will have a location bar in it. Hope this helps!!

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
Reply With Quote
  #5 (permalink)  
Old January 5th, 2005, 07:24 AM
Authorized User
 
Join Date: Nov 2004
Location: mumbai, maharashtra, India.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi ..
i have a button2 on whose click i ave this code..
 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Response.Write("<script>window.open("welcomepage.a spx")</script>")
    End Sub

its actually generating errors..

pls chk..
suneeta

.Net developer
Reply With Quote
  #6 (permalink)  
Old January 5th, 2005, 07:36 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

1. Why do you want to have a server side button for this?

Anyway, just make use of attributes.add to overcome this. Something like this, button.attributes.add("onclick","window.open('.... ');")

2. FYI, you can fire the new window from html itself ... sample is provided below. I have written for <a href> ... you can change it according to your need.

<form id="Form1" method="post" runat="server">
            <input name="txtSearch type="text" />
            <a href="javascript:NewWindow=window.open('/default.aspx','NewWindow','width=154,height=188'); NewWindow.focus()">Search</a>
     </form>

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
Reply With Quote
  #7 (permalink)  
Old January 5th, 2005, 07:39 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Hi Suneeta,

Hope this can help you.

Just after your </form> in your aspx page, put this
<script language="javascript">
<asp:literal runat="server" id="ltScript"></asp:literal>
</script>


in your code


private void Button2_Click(object sender, ByVal EventArgs e)
{
     Literal ltScript = (Literal) Page.FindControl("ltScript");
     ltScript.Text = "window.open('welcomepage.aspx')";
}

sorry I am not familiar with the VB.Net code


Regards
Ganesh
Reply With Quote
  #8 (permalink)  
Old January 5th, 2005, 07:47 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

The other mistake in your code is you have used double quotes around th page name .. change it to single quotes as shown in my previous example. Also I thinlk you need to add button.attributes.add("onclick","window.open('.... ');")


Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
Reply With Quote
  #9 (permalink)  
Old January 5th, 2005, 08:07 AM
Authorized User
 
Join Date: Nov 2004
Location: mumbai, maharashtra, India.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Vadivel
this last step is opening a simple form..but the form that has loads of controls..tis showin a msg-> pop-up was blocked..

pls chk..
suneeta

.Net developer
Reply With Quote
  #10 (permalink)  
Old January 5th, 2005, 09:33 PM
Authorized User
 
Join Date: Mar 2004
Location: Rawang, Selangor, Malaysia.
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you using any application that blocks pop out windows? If yes, then you should turn it off.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP/JS Button opening a new window dilbert ASP.NET 2.0 Basics 3 December 23rd, 2005 01:20 PM
opening asp.net pages naidukap ASP.NET 1.0 and 1.1 Basics 0 October 17th, 2005 11:48 PM
Opening and emailing Excel sheet through ASP.Net venterjo ASP.NET 1.0 and 1.1 Basics 0 October 10th, 2005 09:55 AM
call window dialog component with asp.net/vb.net s3ng ASP.NET 1.x and 2.0 Application Design 0 June 21st, 2005 04:54 AM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM



All times are GMT -4. The time now is 08:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.