473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Response.Redirect("WebForm1.aspx")

Hello,

How do I return to a page using response.redirect - keeping the state
value?

Right now I have a back button - on pressing it - it send the user back
to WebForm1.aspx - but all the previously typed data is gone.
Originally there was a datagrid full of data and a textbox.

Using the browser back button it works. Using a Button and coding:

Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnBack.Click
Response.Redirect("WebForm1.aspx")
End Sub

Does not.

Help?

Nov 21 '05 #1
5 6254
If you don't do any other server side processing in the button event, javascript it on
the client with

window.back()
"Tmuld" <tm******@spliced.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
| Hello,
|
| How do I return to a page using response.redirect - keeping the state
| value?
|
| Right now I have a back button - on pressing it - it send the user back
| to WebForm1.aspx - but all the previously typed data is gone.
| Originally there was a datagrid full of data and a textbox.
|
| Using the browser back button it works. Using a Button and coding:
|
| Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As
| System.EventArgs) Handles btnBack.Click
| Response.Redirect("WebForm1.aspx")
| End Sub
|
| Does not.
|
| Help?
|

Nov 21 '05 #2
Thanks! Might have to do it that way!

I guess I am curious why it does not work in vb.net.

Nov 21 '05 #3
Thanks! Might have to do it that way!

I guess I am curious why it does not work in vb.net.

Nov 21 '05 #4
Tmuld,

Be aware that this does a renew your page and is not a postback.
See for that my other message.
Cor
Nov 21 '05 #5
I can't seem to get the back button to work via the design window.

So if I use the windows.back()

Where do I put it? Do I delete the asp design time button?

Here is the HTML:

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Detail.aspx.vb" Inherits="DB1.Detail2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Detail2</title>
<meta content="False" name="vs_snapToGrid">
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:label id="lblMain" style="Z-INDEX: 101; LEFT: 323px; WIDTH:
88px; POSITION: absolute; TOP: 33px; HEIGHT: 19px"
runat="server" Height="19">Record Detail:</asp:label><asp:datagrid
id="dgDetail" style="Z-INDEX: 102; LEFT: 162px; POSITION: absolute;
TOP: 159px"
runat="server" Width="412px" BorderColor="#999999"
BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3"
GridLines="Vertical">
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#008A8C"></SelectedItemStyle>
<AlternatingItemStyle BackColor="#DCDCDC"></AlternatingItemStyle>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#000084"></HeaderStyle>
<PagerStyle HorizontalAlign="Center" ForeColor="Black"
BackColor="#999999" Mode="NumericPages"></PagerStyle>
</asp:datagrid><asp:label id="lblRefid" style="Z-INDEX: 103; LEFT:
420px; POSITION: absolute; TOP: 34px" runat="server"
Height="19px" Width="88px"></asp:label><asp:button id="btnBack"
style="Z-INDEX: 104; LEFT: 305px; POSITION: absolute; TOP: 89px"
runat="server"
Text="Back to Query"></asp:button></form>
</body>
</HTML>

Nov 21 '05 #6

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

Similar topics

0
by: mc kim via .NET 247 | last post by:
What I am trying to is automatic bidding process in Ebay site... WebClient class can uploads form data easily. I have collected ebay url & form data to uploads.. Most of process is quite easy...
1
by: anna | last post by:
I am trying to redirect to a page to open word/excel document. The trick is that I don't know the path. I have a grid where the user selects the document to open, and based on that selection, the...
1
by: David R | last post by:
'lo This one is confusing me, causing 2 separate errors: Consider this XHTML and Javascript: <!-- ########################## --> <!-- SNIP --> <head> <script type="text/javascript"
1
by: Tim C. | last post by:
I get the error "error executing child request" when I use the Server.Transfer method to invoke a second aspx page. The following code is executed in a LinkButton click eventhandler on Page1.aspx....
2
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The...
3
by: VB Programmer | last post by:
When I run my asp.net app locally it runs perfectly. I upload it to another server it runs perfectly. I upload it to a 2nd server and the 1st page (Default.aspx) comes up fine. I then navigate...
5
by: Alan Silver | last post by:
Hello, I have a page that is supposed to do some checking, and if OK, set a session variable before redirecting to another page. The following code is a simplified version, I have hard-coded the...
2
by: ABC | last post by:
How to return the full virtual path if I pass the url as "~/default.aspx"? I expected this should result as http://aaa.bbb.com/default.aspx.
1
by: Boaz Liebes | last post by:
Sometimes the result of this statment is to redirect me to filename.aspx without the anchore How Can I Get to this InsideAnchor?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.