sys_daw
December 13th, 2006, 11:12 AM
I have created a page called Page1.aspx - code as follows:
<SCRIPT language=VB runat="server">
Public Sub Page_Load(Source As Object, E As EventArgs)
Dim strTest as String
Context.Items.Add("strTest",TextBox1.Text)
End Sub
Public Sub CreateJob(Source As Object, E As EventArgs)
Server.Transfer("Page2.aspx",True)
End Sub
</SCRIPT>
<HTML>
<HEAD>
<link rel="stylesheet" href="style.css" type="text/css" />
<TITLE>Outstanding Time Sheets</TITLE>
</HEAD>
<BODY>
<FORM ID="frmPage1" Method="post" runat="server" style="LEFT: 35px; POSITION: absolute; TOP: 32px; WIDTH=582px; HEIGHT=40">
<asp:Button ID="btnImportData" runat="server" OnClick="CreateJob" Text="Import Data" />
<BR><BR>
<h2><asp:TextBox id="TextBox1" runat="server"></asp:TextBox></h2>
</FORM>
</BODY>
</HTML>
This page takes the value within TextBox1 and sends it to a page called Page2.aspx - code for Page2 as follows:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<SCRIPT language=VB runat="server">
Public strJobName as String
Public Sub Page_Load(Source As Object, E As EventArgs)
If Not IsPostBack Then
TextBox2.Text = Context.Items("strTest")
End If
End Sub
</SCRIPT>
<HTML>
<HEAD>
<link rel="stylesheet" href="style.css" type="text/css" />
<TITLE>Outstanding Time Sheets</TITLE>
</HEAD>
<META HTTP-EQUIV="refresh" CONTENT="2">
<BODY>
<FORM ID="frmPage2" Method="GET" runat="server" style="LEFT: 35px; POSITION: absolute; TOP: 32px; WIDTH=582px; HEIGHT=40">
<h2><asp:TextBox id="TextBox2" runat="server"></asp:TextBox></h2>
</FORM>
</BODY>
</HTML>
The idea is to transfer the text of TextBox1 on Page1 to TextBox2 on Page 2. Page2 is set to refresh every two seconds but here is where the problem is. Everytime Page2 refreshes it reloads Page1. I want it to stay on Page2 and to retain the value passed to it from Page1. Hope this makes sense!!
<SCRIPT language=VB runat="server">
Public Sub Page_Load(Source As Object, E As EventArgs)
Dim strTest as String
Context.Items.Add("strTest",TextBox1.Text)
End Sub
Public Sub CreateJob(Source As Object, E As EventArgs)
Server.Transfer("Page2.aspx",True)
End Sub
</SCRIPT>
<HTML>
<HEAD>
<link rel="stylesheet" href="style.css" type="text/css" />
<TITLE>Outstanding Time Sheets</TITLE>
</HEAD>
<BODY>
<FORM ID="frmPage1" Method="post" runat="server" style="LEFT: 35px; POSITION: absolute; TOP: 32px; WIDTH=582px; HEIGHT=40">
<asp:Button ID="btnImportData" runat="server" OnClick="CreateJob" Text="Import Data" />
<BR><BR>
<h2><asp:TextBox id="TextBox1" runat="server"></asp:TextBox></h2>
</FORM>
</BODY>
</HTML>
This page takes the value within TextBox1 and sends it to a page called Page2.aspx - code for Page2 as follows:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<SCRIPT language=VB runat="server">
Public strJobName as String
Public Sub Page_Load(Source As Object, E As EventArgs)
If Not IsPostBack Then
TextBox2.Text = Context.Items("strTest")
End If
End Sub
</SCRIPT>
<HTML>
<HEAD>
<link rel="stylesheet" href="style.css" type="text/css" />
<TITLE>Outstanding Time Sheets</TITLE>
</HEAD>
<META HTTP-EQUIV="refresh" CONTENT="2">
<BODY>
<FORM ID="frmPage2" Method="GET" runat="server" style="LEFT: 35px; POSITION: absolute; TOP: 32px; WIDTH=582px; HEIGHT=40">
<h2><asp:TextBox id="TextBox2" runat="server"></asp:TextBox></h2>
</FORM>
</BODY>
</HTML>
The idea is to transfer the text of TextBox1 on Page1 to TextBox2 on Page 2. Page2 is set to refresh every two seconds but here is where the problem is. Everytime Page2 refreshes it reloads Page1. I want it to stay on Page2 and to retain the value passed to it from Page1. Hope this makes sense!!