Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Cross page posting problem

Thread Tools

Cross page posting problem
Posts: n/a
I have a simple page (testForm1a.aspx) with master page. I use
PostBackUrl on the button and send the form to second page
(testForm2.aspx). However, it seems can't get the data.
The following is the code.

<%@ Page Language="VB" MasterPageFile="~/masterPage1.master"
AutoEventWireup="false" CodeFile="testForm1a.aspx.vb"
Inherits="testForm1a" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contentScript"
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button"

Then I want to show the TextBox1 text on second page. However, it can
find the control.
Partial Class testForm2
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsNothing(Me.PreviousPage) Then
Dim textbox1 As TextBox
textbox1 = CType(Me.PreviousPage.FindControl("TextBox1"),
If IsNothing(textbox1) Then
Response.Write("textbox not found" & "<br>")
Response.Write("textbox: " & textbox1.Text)
End If
End If
End Sub
End Class

Do anyone have suggestion?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross page posting with Master page =?Utf-8?B?QXR1bCBCYWhs?= ASP .Net 8 11-24-2010 06:00 PM
Cross Page Posting using public property on previous page =?Utf-8?B?dGhlV2l6YXJkMQ==?= ASP .Net 2 04-20-2006 08:27 PM
CROSS-POSTING, OR MULTI-POSTING, OR NEITHER? Colin D Digital Photography 56 03-08-2006 08:31 PM
How do I do cross page posting from a master page? Alan Silver ASP .Net 4 01-22-2006 11:01 AM
How to handle cross-page posting problem? =?Utf-8?B?QW5kcmV3?= ASP .Net 6 12-06-2005 08:44 AM