Ask a Question related to ASP.NET General, Design and Development.
-
Kevin Spencer #1
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
-
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.... -
ASPX Pages till opening with MS Visual Studio
I stared this thread (http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=263& ;threadid=980583&enterthread=y) but it keeps... -
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... -
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... -
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... -
Juan Dent #2
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
functionality available in>-----Original Message-----
>On the client-side you are restricted to theWhat the user sees>HTML. It doesn't matter what you have on the server side.first>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 theits>> 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 inmean,>> own window at the start.
>>
>> What I want is a *managed* way to accomplish this. Iyou>> in Windows.Forms when you want to open another windowin>> create it and then Show() it. Is there nothing similaris>> ASP.NET??? I can't believe that the functionality thatand>> available at the HTML level, with objects like windowInherits="SimpleWebForms.WebForm1">> 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">>> %>
>> <!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
-
Yan-Hong Huang[MSFT] #3
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



Reply With Quote

