Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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
 
Old November 3rd, 2004, 12:19 PM
Authorized User
 
Join Date: Oct 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem of Button in Frame

 have "file1.aspx" that contain 2 frames:
left which is "left.aspx" and right which is "right.aspx"
In "left.aspx" I have this button:

<asp:Button id="Button1" runat="server" Text="Contact" BorderStyle="None">
</asp:Button>

In "left.aspx.vb" I have this code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Response.Redirect("ContactUs.aspx")
End Sub

But I want that "ContactUs.aspx" will be open in the right frame (The right frame will be the target)

How to do it???

 
Old November 3rd, 2004, 02:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can't do thar directly with ASP.NET. ASPX pages up to version 1.1 will always post back to themselves.

There are a few work arounds:

1. In the click handler for the button, send out some JavaScript that reloads the left frame. All you need to do is send a <script> block that sets the location.href for the other frame.

2. Don't use an ASP.NET button. If all you need to do is reload a page in the other frame, a simple <input type="button" /> will do.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Lateralus by Tool (Track 9 from the album: Lateralus) What's This?
 
Old November 4th, 2004, 02:32 AM
Authorized User
 
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can write this in the click event:

Response.Write("<script language=javascript>top.NAME_OF_FRAME.location='ht tp://servername/vdirname/ContactUs.aspx';</script>")

:)Cheers
Spacy





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set one frame src from other frame akumarp2p ASP.NET 1.x and 2.0 Application Design 2 March 13th, 2007 04:13 AM
parsing form data from frame to other frame audio-catalyst Classic ASP Basics 5 January 3rd, 2006 02:57 PM
Call right frame Page_Load event from left frame. ochanarachel Classic ASP Basics 0 January 28th, 2005 05:13 AM
Refresh a frame from another frame czambran Javascript 3 October 21st, 2004 11:20 AM
frame problem hosefo81 HTML Code Clinic 4 January 26th, 2004 10:17 AM





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