473,811 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp:button and response.redire ct _top

I have a site that uses frames. I made an aspx form with an asp:button
control with Onclick=test. The test sub is:

Sub Test(ByVal sender As Object, ByVal e As System.EventArg s)

Response.Redire ct("http://webserver/policies/pppindex.htm target=_blank")

End Sub

Of course, this will not work. Is there some way I can get a similar result
without using normal HTML? I don't want the page to load within the frame as
it would if I wrote it
response.redire ct(http://webserver/policies/pppindex.htm)

Thanks for your help.
Jim
Nov 19 '05 #1
5 3570
Hi Jim,

A little about HTTP:

A Response is a response to a Request. The Request comes from a browser
instance on the client. A FrameSet has multiple browser instances. When a
frame (browser instance) sends a Request, the Response is sent back to the
same client browser instance (of course). That means that Response.Redire ct,
which is a Response to a Request, is a Response to a Request from a certain
browser instance. Targeting a frame therefore, can only be done on the
client, as that is where the frames are linked by the parent browser.

What I would do is to add some JavaScript to the Response, which changes the
target frame's document.locati on property to the URL you want loaded into
that frame. That is, as the Response will come back to the browser instance
that sent the Request, it can refresh the page, and add a javascript to it,
something like the following:

<script type="text/javascript"><!--
parent.frameNam e.location = "url";
// -></script>

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jim in Arizona" <ti*******@hotm ail.com> wrote in message
news:%2******** **********@tk2m sftngp13.phx.gb l...
I have a site that uses frames. I made an aspx form with an asp:button
control with Onclick=test. The test sub is:

Sub Test(ByVal sender As Object, ByVal e As System.EventArg s)

Response.Redire ct("http://webserver/policies/pppindex.htm target=_blank")

End Sub

Of course, this will not work. Is there some way I can get a similar
result without using normal HTML? I don't want the page to load within the
frame as it would if I wrote it
response.redire ct(http://webserver/policies/pppindex.htm)

Thanks for your help.
Jim

Nov 19 '05 #2
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi Jim,

A little about HTTP:

A Response is a response to a Request. The Request comes from a browser
instance on the client. A FrameSet has multiple browser instances. When a
frame (browser instance) sends a Request, the Response is sent back to the
same client browser instance (of course). That means that
Response.Redire ct, which is a Response to a Request, is a Response to a
Request from a certain browser instance. Targeting a frame therefore, can
only be done on the client, as that is where the frames are linked by the
parent browser.

What I would do is to add some JavaScript to the Response, which changes
the target frame's document.locati on property to the URL you want loaded
into that frame. That is, as the Response will come back to the browser
instance that sent the Request, it can refresh the page, and add a
javascript to it, something like the following:

<script type="text/javascript"><!--
parent.frameNam e.location = "url";
// -></script>

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

------snip------

I should have known better. Of course, I was hopeful in some way that there
would be some simple soulution.

I have not worked with javascipt (enough) and I'm still pretty new to vb
(newer to vb.net). I wouldn't know how to implement a script like that in
any fashion.

My normal html link from before was <a href="/policies/pppindex.htm"
target=_top>lin k here</a>, which of course removed all frames and loaded the
single htm page in place of the frames. When you say
parent.framenam e.location, I don't know what portion of that is referring to
what part of my standard link.

Would there be some other way of writing the Test Subprocedure to make my
pretty graphical button work, or am I forced to use standard HTML or
javascript?

Thanks for your help Kevin.

Jim
Nov 19 '05 #3
Hi JJim,
My normal html link from before was <a href="/policies/pppindex.htm"
target=_top>lin k here</a>, which of course removed all frames and loaded
the single htm page in place of the frames. When you say
parent.framenam e.location, I don't know what portion of that is referring
to what part of my standard link.
Well, you could always have a regular link that goes to:

/policies/ppindex.htm target=frameNam e

....where "frameName" is the name of the frame you want loaded.
I have not worked with javascipt (enough) and I'm still pretty new to vb
(newer to vb.net). I wouldn't know how to implement a script like that in
any fashion.
Just one last comment: Every programmer runs into a situation in which
he/she has "not worked with " some technology, language, or other, from time
to time. The way you improve is to research the new thing when you run into
it, rather than running away from it. Just a couple of weeks ago I had the
task of adding water to a 3-D terrain mapping engine. I found the National
Land Cover Data Set on the USGS web site, but that was only the beginning.
The data was stored in GeoTiffs, which is a specialized form of Tiff file.
To make it worse, it was stored in Albers Equal Araeqa Conical projection.
Now, I knew nothing about parsing Tiff files, much less deriving Lat/Long
information from a raster image with Albers Equal Area Conical projection.
But I do now! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jim in Arizona" <ti*******@hotm ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. .. "Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi Jim,

A little about HTTP:

A Response is a response to a Request. The Request comes from a browser
instance on the client. A FrameSet has multiple browser instances. When a
frame (browser instance) sends a Request, the Response is sent back to
the same client browser instance (of course). That means that
Response.Redire ct, which is a Response to a Request, is a Response to a
Request from a certain browser instance. Targeting a frame therefore, can
only be done on the client, as that is where the frames are linked by the
parent browser.

What I would do is to add some JavaScript to the Response, which changes
the target frame's document.locati on property to the URL you want loaded
into that frame. That is, as the Response will come back to the browser
instance that sent the Request, it can refresh the page, and add a
javascript to it, something like the following:

<script type="text/javascript"><!--
parent.frameNam e.location = "url";
// -></script>

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

------snip------

I should have known better. Of course, I was hopeful in some way that
there would be some simple soulution.

I have not worked with javascipt (enough) and I'm still pretty new to vb
(newer to vb.net). I wouldn't know how to implement a script like that in
any fashion.

My normal html link from before was <a href="/policies/pppindex.htm"
target=_top>lin k here</a>, which of course removed all frames and loaded
the single htm page in place of the frames. When you say
parent.framenam e.location, I don't know what portion of that is referring
to what part of my standard link.

Would there be some other way of writing the Test Subprocedure to make my
pretty graphical button work, or am I forced to use standard HTML or
javascript?

Thanks for your help Kevin.

Jim

Nov 19 '05 #4

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:ez******** *****@TK2MSFTNG P15.phx.gbl...
Hi JJim,
My normal html link from before was <a href="/policies/pppindex.htm"
target=_top>lin k here</a>, which of course removed all frames and loaded
the single htm page in place of the frames. When you say
parent.framenam e.location, I don't know what portion of that is referring
to what part of my standard link.


Well, you could always have a regular link that goes to:

/policies/ppindex.htm target=frameNam e

...where "frameName" is the name of the frame you want loaded.
I have not worked with javascipt (enough) and I'm still pretty new to vb
(newer to vb.net). I wouldn't know how to implement a script like that in
any fashion.


Just one last comment: Every programmer runs into a situation in which
he/she has "not worked with " some technology, language, or other, from
time to time. The way you improve is to research the new thing when you
run into it, rather than running away from it. Just a couple of weeks ago
I had the task of adding water to a 3-D terrain mapping engine. I found
the National Land Cover Data Set on the USGS web site, but that was only
the beginning. The data was stored in GeoTiffs, which is a specialized
form of Tiff file. To make it worse, it was stored in Albers Equal Araeqa
Conical projection. Now, I knew nothing about parsing Tiff files, much
less deriving Lat/Long information from a raster image with Albers Equal
Area Conical projection. But I do now! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

Thanks for the insight.

I think I'm still a few days off before I open a book or pdf doc on parsing
Tiff files stored in Albers Equal Areqa Conical Projection. I tried to say
that three, then just two times fast and I couldn't do it! :)

I'll keep working on a solution. Depending on what I finally implement, I'll
let you know how it turned out. Should be amusing, and maybe informative, in
any case! :)

Jim
Nov 19 '05 #5
> I'll keep working on a solution. Depending on what I finally implement,
I'll let you know how it turned out. Should be amusing, and maybe
informative, in any case! :)
There you go man!

BTW, I misspelled "Area" - it should read "Albers Equal Area Conical
projection." For whatever that's worth!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jim in Arizona" <ti*******@hotm ail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:ez******** *****@TK2MSFTNG P15.phx.gbl...
Hi JJim,
My normal html link from before was <a href="/policies/pppindex.htm"
target=_top>lin k here</a>, which of course removed all frames and loaded
the single htm page in place of the frames. When you say
parent.framenam e.location, I don't know what portion of that is
referring to what part of my standard link.


Well, you could always have a regular link that goes to:

/policies/ppindex.htm target=frameNam e

...where "frameName" is the name of the frame you want loaded.
I have not worked with javascipt (enough) and I'm still pretty new to vb
(newer to vb.net). I wouldn't know how to implement a script like that
in any fashion.


Just one last comment: Every programmer runs into a situation in which
he/she has "not worked with " some technology, language, or other, from
time to time. The way you improve is to research the new thing when you
run into it, rather than running away from it. Just a couple of weeks ago
I had the task of adding water to a 3-D terrain mapping engine. I found
the National Land Cover Data Set on the USGS web site, but that was only
the beginning. The data was stored in GeoTiffs, which is a specialized
form of Tiff file. To make it worse, it was stored in Albers Equal Araeqa
Conical projection. Now, I knew nothing about parsing Tiff files, much
less deriving Lat/Long information from a raster image with Albers Equal
Area Conical projection. But I do now! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

Thanks for the insight.

I think I'm still a few days off before I open a book or pdf doc on
parsing Tiff files stored in Albers Equal Areqa Conical Projection. I
tried to say that three, then just two times fast and I couldn't do it! :)

I'll keep working on a solution. Depending on what I finally implement,
I'll let you know how it turned out. Should be amusing, and maybe
informative, in any case! :)

Jim

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1580
by: Maziar Aflatoun | last post by:
Hi everyone, I have the following shopping cart (basket view). However, Delete button in my datagrid doesn't fire any events. Does anyone know why? (It's a user web control) <%@ Control Language="c#" AutoEventWireup="false" Codebehind="ShoppingCart.ascx.cs" Inherits="TPShoppingCart.ShoppingCart1" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> <asp:datagrid id="DGShoppingCart" AutoGenerateColumns="False" Width="650"
2
14333
by: Chris Fink | last post by:
Hello, I have a datalist that contains an asp button. I have the need to pass a value that is bound to my datalist along the button when the on_click event is fired. My datalist creates a button for each row in my datasource, so each button needs to pass a unique value. My questions are: 1. How do I pass the value with the button without making it visible on the button or form. 2. Is there a way to grab this value in the button's...
2
2125
by: giant food | last post by:
Hi, I'm writing an asp app. I have a text box with a validator and a submit button. Here is code from my .aspx file.... <asp:TextBox ID="txName" TextMode="SingleLine" Runat="server" /> <asp:RequiredFieldValidator ID="vName" Runat=server ControlToValidate="txName" /> <asp:Button ID="btnSave" CssClass="button" Runat="server" />
15
15455
by: Drebin | last post by:
I am retrofitting a central login application and want to be able to read the Request.ServerVariables so that when they have logged on, I can send them back to wherever they were trying to go.. If you try to load a legacy ASP app, I do this: If Len(SessionID) <> 40 Then Response.Redirect "/WAS/Default.aspx?AppCode=2400" End If
4
1747
by: Roy | last post by:
Ok, I feel silly asking this because it seems like such a simple thing but I haven't been able to figure it out. Is it possible to create an asp:button that functions just like an asp:linkbutton? What I'm trying to do is when a user clicks a button (a pushbutton) it will open a new page (not response.redirect but an entirely different browser window). Seems simple, but the answer evades me. :(
7
1936
by: Lam | last post by:
I want to dynamic generate a asp:button in C# class, not in the HTML code so that it can call the methods in the c# class, I try to use "Response.Write("<asp:button...>") it didn't show the button Can anyone help? Thanks a lot
1
1067
by: amit | last post by:
I have a web service that returns a string when invoked by an onclick event on a href. I know need to bind this string to the commandArgument of an ASP:Button so that when the button is pressed, I can use the returned argument in the code behind page to process the appropriate method. Any ideas how I can do this? I have manage to return the string from the service and display it on
4
1706
by: R.A.M. | last post by:
Hi I have very simple problem - I need to process asp:Button click at server. I have written (my experience is little) in .aspx: <asp:Button ID="GoTo" runat="server" Text="Go To" OnClick="GoTo_Click" /> and in .aspx.cs I have written: .... protected void Page_Load(object sender, EventArgs e)
1
1613
by: R.A.M. | last post by:
Hello, I have very simple problem which I present here second time, because I haven't got a solution. I need to process asp:Button click at server. I have written (my experience is little) in .aspx: <asp:Button ID="GoTo" runat="server" Text="Go To" OnClick="GoTo_Click" /> and in .aspx.cs I have written with Visual Studio:
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.