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

  • SEARCH
  • Home
  • 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 6018555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:17:31+00:00 2026-05-23T03:17:31+00:00

I am dynamically generating the form based on the drop down selected. The form

  • 0

I am dynamically generating the form based on the drop down selected.
The form consists of fields (data entry for decimal values + few text fields). Have to add all the decimal values at the end and update the Total TextBox with that value. Total Textbox is disabled.

When I click Save button on the form after the user have entered their values, whole form is persisted in viewstate except the disabled textbox. When I enable the textbox, everything works fine. Mind you, I am dynamically generating the form and updating the value of the total textbox using javascript to calculate (adding all decimal fields).

P.S. I am doing everything right for persisting the viewstate.

So what has the enabled/disabled got bearing on the viewstate

  • 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-05-23T03:17:32+00:00Added an answer on May 23, 2026 at 3:17 am

    Basically, I added two statements to get it working.

    txtBox.Attributes.Add("readonly", "readonly");
    txtBox.Style.Add("color","gray");
    

    When I used txtBox.Enabled = false, it didn’t persist viewstate but did it alternatively using above two statements in my code-behind page

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

Sidebar

Related Questions

I am dynamically creating forms based on values in a database. Each form element
Thanks for reading this. I am dynamically generating some data which includes a select
A very general question. I am dynamically generating a form that is split into
I'm dynamically generating a Windows Forms form by reading an XML file. (Actually I
I'm generating PDFs dynamically using PHP and PDFlib and some of the fields require
I am dynamically generating a div and want to change its content via html()/text(),
I would like to dynamically modify the values of certain form elements, more specifically
i'm generating controls dynamically on my asp.net page by xslt transformation from an xml
What are some pros/cons for using the Reflection.Emit library versus CodeDOM for dynamically generating
I am dynamically generating controls, and sometimes I want to create a control and

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.