Textbox text property is blank???

dakota97

Centurion
Joined
Nov 14, 2003
Messages
116
Location
Pennsylvania
Hi All,

I'm running into a very annoying problem, and cannot for the life of me figure it out.

I have 2 web pages that I'm working with in a registration process, Register.aspx and ProcessRegistration.aspx. The first page has 2 textboxes for existing users to login at the top, and a registration form for a new user to fill out. However, when I fill out the registration form and submit it, the page does not keep the form data so that it can be processed.

At first I tried processing the data in the click event of the submit button on the Register.aspx page. If the information was correctly processed, then it sent the user to a success page. But, I believe that I was running into a problem with the postback for that page. It is my understanding that what was happening was the page was re-initializing the controls, and that's why the text boxes has no text values. So I tried looking at cross-page posting by sending the data to the ProcessRegistration.aspx page, but am still having no luck.

Can anyone give me some advice on how I need to do this? This is a big project for a client, and I'm totally stuck on this, and it's a major part of the application. Any help would be greatly appreciated.

Thanks in advance,

Chris
 
Unless there's something funky going on that I don't know about, the answer is no. That's why it's throwing me off as to what the problems is. Here's my Page_Load code:

Code:
protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LBSRegistering"] == null)
        {
            Session.Add("LBSRegistering", "1");
        }

        //Determine if the user has previously logged in
        if (Session["LBSUsername"] != null)
        {
            txtUsername.Visible = false;
            txtPassword.Visible = false;
            Label4.Visible = false;
            Label3.Text = "Welcome back " + Session["LBSUsername"].ToString() + "!";
            btnLogin.Text = "Logout";
        }

        if (!Page.IsPostBack)
        {
            //Load the site sponsors
            LoadSiteSponsors();

            //Update the AJAX controls
            UpdateStats();
            UpdateBanner();
            UpdateListings();
            UpdateEndingSoon();

            tmrUpdateBanner.Enabled = true;
            tmrUpdateListings.Enabled = true;
            tmrUpdateStats.Enabled = true;

            ScriptManager1.RegisterAsyncPostBackControl(tmrUpdateStats);
            ScriptManager1.RegisterAsyncPostBackControl(tmrUpdateBanner);
            ScriptManager1.RegisterAsyncPostBackControl(tmrUpdateListings);
        }
    }

None of the update methods do anything with the textboxes either. They simply load data into UpdatePanels from the database.

Temporaily I've done a workaround just so I can keep moving forward. I'm doing HTML form-style passing, but I've lost my page validation functionality by doing that which isn't a good thing.

Any suggestions?

-Chris
 
Well, I finally figured out what is was. I had a second <form> tag on my page that for some reason was resetting the original text value of all textboxes on the page. Anyone have any idea why this happens? I'd really be interested in an explanation.
 
Back
Top