Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8673841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:33:40+00:00 2026-06-12T19:33:40+00:00

I am creating a WebForm in which I have given a functionality of enabling

  • 0

I am creating a WebForm in which I have given a functionality of enabling and disabling a text box. However, when I enter the value in the TextBox and then disable it. I am not able to save the TextBox value in the database. Whenever the code try to save the value, the gets an empty value in it and therefore it stores an empty value. When I do no disable the TextBox, then the value get successfully stored in the table. Below is some code related to it…

protected void btnCreateSubAcct_Click(object sender, EventArgs e)
    {
        int subAccountID = 0;
        try
        {                
                if (Page.IsValid)
                {
                    subAccountID = SaveUpdateSubAccount();

                    if (string.IsNullOrEmpty(HiddenFieldSubAccntID.Value))
                    {
                        SessionHandler.Set(SessionHandler.SubAccountIDKey, subAccountID);
                        Response.Redirect("~/newaccountwelcome");
                    }
                    else
                    {
                        lblDialogMessage.Text = "Subaccount updated successfully!";
                        modalPage.Visible = true;
                        SetFocus(btnOK.ClientID);
                    }
                }

        }
        catch (ThreadAbortException)
        {

        }
        catch (Exception ex)
        {
            _log.Error("Error Occured While Creation of SubAccount.", ex);
            throw;
        }
    }

private int SaveUpdateSubAccount()
{
SubAccount objSubAccount = null;

        if (!string.IsNullOrEmpty(HiddenFieldSubAccntID.Value) &&         !HiddenFieldSubAccntID.Value.Equals("0"))
        {
            objSubAccount = SubAccount.GetSubAccount(Convert.ToInt32(HiddenFieldSubAccntID.Value));
        }

        if (objSubAccount == null)
        {
            objSubAccount = new SubAccount();
            objSubAccount.CreatedByUser = SessionHandler.CurrentUser.UserID;
        }
        objSubAccount.FBO1FirstName = txtFBO1FirstName.Text.Trim();
        objSubAccount.FBO1MiddleInitial = txtFBO1MiddleName.Text.Trim();
        objSubAccount.FBO1LastName = txtFBO1LastName.Text.Trim();
        objSubAccount.FBO1AccountTitling = txtFbo1AccountTitling.Text.Trim();
        objSubAccount.FBO1TaxIDType = fbo1RadioButtonList.SelectedItem.Value;
        objSubAccount.FBO1TaxID = Helpers.GetUnFormattedTIN(txtFbo1TaxId.Text.Trim());
}

//under the class SubAccount, the information is getting stored in the database

Whenever, I try to save the value of a text FBO1TaxID, when it is in disabled mode, the value under this TextBox is empty.

How will I save the value of a TextBox in disabled mode under the table in Database? Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:33:41+00:00Added an answer on June 12, 2026 at 7:33 pm

    what you can do is: add a hidden field, when disable the textbox, set its value to the hidden field. then when you need the textbox value, check whether it is NullOrEmpty first. If no, yes textbox’s value. otherwise, use the hidden field’s value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a JApplet I have 2 Text Fields, a button and a Text Area.
I am creating a webform in .net in which approximate 14 fields are there
I have the following code, which was creating a graph on the confirmation page
The default when creating a new WebForm in Visual Studio is WebForm1.aspx I always
I have an ASP.NET web site which contains some ImageButton controls that cause postbacks
I have a gridview which is being populated at runtime(using sessions) by entering the
I'm just wondering about this one. I'm creating an ASP.NET webform containing lots of
I have an MVC application that I am creating that I have to integrate
I am using Drupal 7.15, and have a Webform setup as a block that
I am creating mobile application in asp.net webform targeting IPhone, Android and blackberry. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.