Opening other ASPX pages

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Opening other ASPX pages

    On the client-side you are restricted to the functionality available in
    HTML. It doesn't matter what you have on the server side. What the user sees
    in their browser is pure HTML.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "Juan Dent" <juan5@dev.com> wrote in message
    news:049201c33b74$61a1e1b0$a601280a@phx.gbl...
    > Hi,
    >
    > If I have an ASPX page open and I press something that
    > posts back to the server, then I want to open up an
    > additional ASPX page passing it information from the first
    > page without closing the original page.
    >
    > I have achieved some degree of success using client side
    > scripting but am not really happy. It really does not do
    > what I need - it just manages to open another page in its
    > own window at the start.
    >
    > What I want is a *managed* way to accomplish this. I mean,
    > in Windows.Forms when you want to open another window you
    > create it and then Show() it. Is there nothing similar in
    > ASP.NET??? I can't believe that the functionality that is
    > available at the HTML level, with objects like window and
    > document, is not accessible from managed (compiled)
    > ASP.NET code. I have been searching for classes like
    > HtmlDocument or HtmlWindow with no success. If I am
    > approaching this problem in the wrong manner, could
    > someone please tell me the right path?
    >
    > The following is the ASPX page that opens another one:
    >
    > -----------------
    > <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
    > AutoEventWireup="false" Inherits="SimpleWebForms.WebForm1"
    > %>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    > Transitional//EN" >
    > <HTML>
    > <HEAD>
    > <title>WebForm1</title>
    > <meta name="GENERATOR" Content="Microsoft
    > Visual Studio 7.0">
    > <meta name="CODE_LANGUAGE" Content="C#">
    > <meta name="vs_defaultClientScript"
    > content="JavaScript">
    > <meta name="vs_targetSchema"
    > content="http://schemas.microsoft.com/intellisense/ie5">
    > </HEAD>
    > <body MS_POSITIONING="GridLayout" onload="return
    > OpenAnother()" >
    > <form id="Form1" method="post"
    > runat="server">
    > <asp:Label ID="explain"
    > Runat="server"/>
    > <br>
    > <asp:Button ID="btn" Font-
    > Bold="True" Text="No runat server" />
    > <asp:Button ID="ServerBtn" Font-
    > Bold="True" Text="Server Button" Runat="server" />
    > <input type="checkbox" name="chk"
    > onclick="return ChkClick()" >
    > <input type="text" name="txt" >
    > <input type="hidden" id="hidden"
    > name="hidden" runat= "server" >
    > </form>
    > <script language=javascript>
    > <!--
    > function ChkClick()
    > {
    > Form1.txt.value= "High!";
    > Form1.hidden.value = Form1.ServerBtn.value
    > = "Changed";
    > return true;
    > }
    > //-->
    > </script>
    > <script language=javascript>
    > <!--
    > function OpenAnother()
    > {
    > window.showModelessDialog( "RequestForm.aspx");
    > }
    > //-->
    > </script>
    > </body>
    > </HTML>
    > -----------------
    >
    >
    > Thanks!
    > Juan Dent

    Kevin Spencer Guest

  2. Similar Questions and Discussions

    1. ASPX pages opening with Visual Studio
      I am making a search and results page with asp and an access database. However, when I test it with my localhost the page open with Visual Studio....
    2. ASPX Pages till opening with MS Visual Studio
      I stared this thread (http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=263&amp ;threadid=980583&amp;enterthread=y) but it keeps...
    3. aspx pages not displaying in ie6
      When aspx pages are made in vs.net, loading on the local host displays the labels all in the top left corner of the screen. Also, all textboxes and...
    4. aspx pages not viewable
      We have just purchased .net ent. edition for our company. I have installed .net on my desktop where I do the developing of our aspx, and vb.net...
    5. opening aspx-files in frontpage?
      Hello everybody, I have created a webform using ASP.NET/C# as a part of my bachelor thiesis on the behalf of a Community school. The form should...
  3. #2

    Default Re: Opening other ASPX pages

    Thanks! I here what you are saying. Nevertheless is there
    no way to open a second window from the aspx.cs file in C#?

    Thanks again,
    Juan Dent
    >-----Original Message-----
    >On the client-side you are restricted to the
    functionality available in
    >HTML. It doesn't matter what you have on the server side.
    What the user sees
    >in their browser is pure HTML.
    >
    >HTH,
    >
    >Kevin Spencer
    >Microsoft FrontPage MVP
    >Internet Developer
    >[url]http://www.takempis.com[/url]
    >Big things are made up of
    >lots of Little things.
    >
    >"Juan Dent" <juan5@dev.com> wrote in message
    >news:049201c33b74$61a1e1b0$a601280a@phx.gbl...
    >> Hi,
    >>
    >> If I have an ASPX page open and I press something that
    >> posts back to the server, then I want to open up an
    >> additional ASPX page passing it information from the
    first
    >> page without closing the original page.
    >>
    >> I have achieved some degree of success using client side
    >> scripting but am not really happy. It really does not do
    >> what I need - it just manages to open another page in
    its
    >> own window at the start.
    >>
    >> What I want is a *managed* way to accomplish this. I
    mean,
    >> in Windows.Forms when you want to open another window
    you
    >> create it and then Show() it. Is there nothing similar
    in
    >> ASP.NET??? I can't believe that the functionality that
    is
    >> available at the HTML level, with objects like window
    and
    >> document, is not accessible from managed (compiled)
    >> ASP.NET code. I have been searching for classes like
    >> HtmlDocument or HtmlWindow with no success. If I am
    >> approaching this problem in the wrong manner, could
    >> someone please tell me the right path?
    >>
    >> The following is the ASPX page that opens another one:
    >>
    >> -----------------
    >> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
    >> AutoEventWireup="false"
    Inherits="SimpleWebForms.WebForm1"
    >> %>
    >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    >> Transitional//EN" >
    >> <HTML>
    >> <HEAD>
    >> <title>WebForm1</title>
    >> <meta name="GENERATOR" Content="Microsoft
    >> Visual Studio 7.0">
    >> <meta name="CODE_LANGUAGE" Content="C#">
    >> <meta name="vs_defaultClientScript"
    >> content="JavaScript">
    >> <meta name="vs_targetSchema"
    >> content="http://schemas.microsoft.com/intellisense/ie5">
    >> </HEAD>
    >> <body MS_POSITIONING="GridLayout" onload="return
    >> OpenAnother()" >
    >> <form id="Form1" method="post"
    >> runat="server">
    >> <asp:Label ID="explain"
    >> Runat="server"/>
    >> <br>
    >> <asp:Button ID="btn" Font-
    >> Bold="True" Text="No runat server" />
    >> <asp:Button ID="ServerBtn" Font-
    >> Bold="True" Text="Server Button" Runat="server" />
    >> <input type="checkbox" name="chk"
    >> onclick="return ChkClick()" >
    >> <input type="text" name="txt" >
    >> <input type="hidden" id="hidden"
    >> name="hidden" runat= "server" >
    >> </form>
    >> <script language=javascript>
    >> <!--
    >> function ChkClick()
    >> {
    >> Form1.txt.value= "High!";
    >> Form1.hidden.value = Form1.ServerBtn.value
    >> = "Changed";
    >> return true;
    >> }
    >> //-->
    >> </script>
    >> <script language=javascript>
    >> <!--
    >> function OpenAnother()
    >> {
    >> window.showModelessDialog( "RequestForm.aspx");
    >> }
    >> //-->
    >> </script>
    >> </body>
    >> </HTML>
    >> -----------------
    >>
    >>
    >> Thanks!
    >> Juan Dent
    >
    >
    >.
    >
    Juan Dent Guest

  4. #3

    Default Re: Opening other ASPX pages

    Hello Juan,

    I've set up a modal dialog using an .aspx page that handles a data update
    event on the postback and then closes itself. It's a little clunky but it
    works.

    The important thing is to make sure that the form submit targets the same
    window, otherwise the browser will open a new one. This can be done by
    using the following in the window.onload

    window.name = "windowName";
    Form1.target = "windowName";

    The second thing is communicating to the client from the postback that the
    window is to be closed. I did this with a hidden input field with
    runat=server, the value of thisa is checked in the window.onload of the
    dialog, and if it's set to a particular value, the window is closed. I've
    also communicated the value from the server back through another hidden
    field.

    The big fat caveat with this is it only seems to work in IE 6 - the
    form.target property for modal dialogs is ignored in IE 5 (don't know about
    IE 5.5 yet). As I have the luxury of developing a fixed IE6+ client, it's
    not a problem.

    I've attached a demo, and the source here.

    Hope it helps...

    Best regards,
    yhhuang
    VS.NET, Visual C++
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? [url]http://www.gotdotnet.com[/url]
    --------------------
    !Content-Class: urn:content-classes:message
    !From: "Juan Dent" <juan5@dev.com>
    !Sender: "Juan Dent" <juan5@dev.com>
    !References: <049201c33b74$61a1e1b0$a601280a@phx.gbl>
    <OfH1p09ODHA.2224@TK2MSFTNGP10.phx.gbl>
    !Subject: Re: Opening other ASPX pages
    !Date: Thu, 26 Jun 2003 09:40:13 -0700
    !Lines: 121
    !Message-ID: <007901c33c01$9ddcc130$a401280a@phx.gbl>
    !MIME-Version: 1.0
    !Content-Type: text/plain;
    ! charset="iso-8859-1"
    !Content-Transfer-Encoding: 7bit
    !X-Newsreader: Microsoft CDO for Windows 2000
    !Thread-Index: AcM8AZ3cmThxGY7qRw+s473yMPXqFQ==
    !X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !Path: cpmsftngxa06.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:155155
    !NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Thanks! I here what you are saying. Nevertheless is there
    !no way to open a second window from the aspx.cs file in C#?
    !
    !Thanks again,
    !Juan Dent
    !
    !>-----Original Message-----
    !>On the client-side you are restricted to the
    !functionality available in
    !>HTML. It doesn't matter what you have on the server side.
    !What the user sees
    !>in their browser is pure HTML.
    !>
    !>HTH,
    !>
    !>Kevin Spencer
    !>Microsoft FrontPage MVP
    !>Internet Developer
    !>[url]http://www.takempis.com[/url]
    !>Big things are made up of
    !>lots of Little things.
    !>
    !>"Juan Dent" <juan5@dev.com> wrote in message
    !>news:049201c33b74$61a1e1b0$a601280a@phx.gbl...
    !>> Hi,
    !>>
    !>> If I have an ASPX page open and I press something that
    !>> posts back to the server, then I want to open up an
    !>> additional ASPX page passing it information from the
    !first
    !>> page without closing the original page.
    !>>
    !>> I have achieved some degree of success using client side
    !>> scripting but am not really happy. It really does not do
    !>> what I need - it just manages to open another page in
    !its
    !>> own window at the start.
    !>>
    !>> What I want is a *managed* way to accomplish this. I
    !mean,
    !>> in Windows.Forms when you want to open another window
    !you
    !>> create it and then Show() it. Is there nothing similar
    !in
    !>> ASP.NET??? I can't believe that the functionality that
    !is
    !>> available at the HTML level, with objects like window
    !and
    !>> document, is not accessible from managed (compiled)
    !>> ASP.NET code. I have been searching for classes like
    !>> HtmlDocument or HtmlWindow with no success. If I am
    !>> approaching this problem in the wrong manner, could
    !>> someone please tell me the right path?
    !>>
    !>> The following is the ASPX page that opens another one:
    !>>
    !>> -----------------
    !>> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
    !>> AutoEventWireup="false"
    !Inherits="SimpleWebForms.WebForm1"
    !>> %>
    !>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    !>> Transitional//EN" >
    !>> <HTML>
    !>> <HEAD>
    !>> <title>WebForm1</title>
    !>> <meta name="GENERATOR" Content="Microsoft
    !>> Visual Studio 7.0">
    !>> <meta name="CODE_LANGUAGE" Content="C#">
    !>> <meta name="vs_defaultClientScript"
    !>> content="JavaScript">
    !>> <meta name="vs_targetSchema"
    !>> content="http://schemas.microsoft.com/intellisense/ie5">
    !>> </HEAD>
    !>> <body MS_POSITIONING="GridLayout" onload="return
    !>> OpenAnother()" >
    !>> <form id="Form1" method="post"
    !>> runat="server">
    !>> <asp:Label ID="explain"
    !>> Runat="server"/>
    !>> <br>
    !>> <asp:Button ID="btn" Font-
    !>> Bold="True" Text="No runat server" />
    !>> <asp:Button ID="ServerBtn" Font-
    !>> Bold="True" Text="Server Button" Runat="server" />
    !>> <input type="checkbox" name="chk"
    !>> onclick="return ChkClick()" >
    !>> <input type="text" name="txt" >
    !>> <input type="hidden" id="hidden"
    !>> name="hidden" runat= "server" >
    !>> </form>
    !>> <script language=javascript>
    !>> <!--
    !>> function ChkClick()
    !>> {
    !>> Form1.txt.value= "High!";
    !>> Form1.hidden.value = Form1.ServerBtn.value
    !>> = "Changed";
    !>> return true;
    !>> }
    !>> //-->
    !>> </script>
    !>> <script language=javascript>
    !>> <!--
    !>> function OpenAnother()
    !>> {
    !>> window.showModelessDialog( "RequestForm.aspx");
    !>> }
    !>> //-->
    !>> </script>
    !>> </body>
    !>> </HTML>
    !>> -----------------
    !>>
    !>>
    !>> Thanks!
    !>> Juan Dent
    !>
    !>
    !>.
    !>
    !
    Yan-Hong Huang[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139