View Single Post
  #1 (permalink)  
Old October 30th, 2006, 03:11 PM
keaja keaja is offline
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Cross Page Post Back

I am trying to accomplish a simple cross page post back, but I am having no luck. My textbos ends up using my else statement and displaying that it didnt work.

Everything I have seems perfect, I just dont get why it isnt it working:

Default.aspx (Page1)

<script runat="server">

        public String CurrentCompany
        {
            get
            {
                return companyBox.Text;
            }
        }

</script>

//the posting button

<asp:Button ID="notifyButton" runat="server" Text="Notify" Width="74px" CssClass="button" PostBackUrl="~/statusNotifyMngment.aspx" />


// statusNotifyMngment.aspx (Page 2)

<script runat="server">

    public void submitButton_Click(object sender, EventArgs e)
    {

        if (PreviousPage != null && PreviousPage.IsCrossPagePostBack)
        {
            notesBox.Text = PreviousPage.CurrentCompany;
        }

        else
        {
              // if previous Page is NULL just redirect us
            notesBox.Text = "Didnt Work";

        }


    }

</script>

Reply With Quote