|
 |
aspx thread: New Browser Window
Message #1 by "J Donahue" <jdonahue@f...> on Wed, 28 Aug 2002 22:30:34
|
|
I'd have a <asp:linkbutton> that goes to the server side to perform some
tasks before redirecting to a different page. Is there a way to redirect
to a new browser window after doing my server side routine???
Thanks
Message #2 by Berkay Mese <berkaymese@y...> on Wed, 28 Aug 2002 17:53:52 -0700 (PDT)
|
|
Because the <asp:linkbutton> automatically inserts a
"__doPostBack" eventHandler to the code, you may
change the linkbutton's form target as ;
<form runat=server ID="yourform" target="_blank">
or you may do like that:
After the scope of your server side script finishes,
add this client-side code..
<script language =javascript>
<% If (IsPostBack) Then %>
Form1.action = 'RedirectPage';
Form1.target = '_blank';
Form1.submit();
<% End If %>
</script>
Also, after you redirected to a 2nd page, using these
tecnhiques or Server.Transfer , the __VIEWSTATE Hidden
field is send in postBack routine. Then the
destination page checks that variable and you can have
trouble like "view state is invalid for this page and
corrupted.." , etc.. For preventing this error in the
destionation page,
You have to override the VIEWSTATE Session state
objects, like :
Protected Overrides Sub _
SavePageStateToPersistenceMedium( _
ByVal viewState As _
Object)
Session("MyViewState") = viewState
End Sub
Protected Overrides Function _
LoadPageStateFromPersistenceMedium() As Object
Return Session("MyViewState")
End Function
These override the classes in Page Object and uses
inheritance., that's good :))
Berkay
Berkay
--- J Donahue <jdonahue@f...> wrote:
> I'd have a <asp:linkbutton> that goes to the server
> side to perform some
> tasks before redirecting to a different page. Is
> there a way to redirect
> to a new browser window after doing my server side
> routine???
> Thanks
> ---
>
> ASP.NET 1.0 Namespace Reference with C#
> http://www.wrox.com/acon11.asp?ISBN=1861007442
>
> ASP.NET 1.0 Namespace Reference with VB.NET
> http://www.wrox.com/acon11.asp?ISBN=1861007450
>
> These books are a complete reference to the ASP.NET
> namespaces
> for developers who are already familiar with using
> ASP.NET.
> There is no trivial introductory material or useless
> .NET
> hype and the presentation of the namespaces, in an
> easy-to use
> alphabetical order ensures a user-friendly reference
> format.
> We provide in-depth coverage of all the major
> ASP.NET classes,
> giving you those real-world tips that the
> documentation doesn't
> offer, and demonstrating complex techniques with
> simple
> examples.
>
> ---
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Message #3 by "Lewis" <lewis@t...> on Thu, 29 Aug 2002 13:07:44 -0600
|
|
server.transfer("newpage.aspx") is best
response.redirect("newpage.aspx") also works but is slower
-----Original Message-----
From: J Donahue [mailto:jdonahue@f...]
Sent: Wednesday, August 28, 2002 10:31 PM
To: ASP+
Subject: [aspx] New Browser Window
I'd have a <asp:linkbutton> that goes to the server side to perform some
tasks before redirecting to a different page. Is there a way to redirect
to a new browser window after doing my server side routine???
Thanks
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
|
|
 |