How to get textbox value when textbox properties is readonly or enabled false

Hi ,

I have one problem, If u have idea please solve  it

To dispaly canlendercontrol iam using ajax canlender control, after selecting dateof birth into textbox

In textbox keeping textbox properites as readonly or enabled equal false,  getting that textbox value into lable,





5/14/2008 6:58:23 AM 9760 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 11
Get it on Google Play
Get it on Apple App Store

Just get the Textbox.Text value?

Don't forget to click "Mark as Answer" on the post that helped you.
5/14/2008 7:43:30 AM
If I understand you correctly, you have a textbox that is disabled/readonly. You use some code to change the value in the textbox, and you want that value to be returned to your code-behind.

As far as I remember, ignores changes to a disabled controls. This is a good thing - prevents people from hacking. The way to get around this is to put a hidden field on your page, and update that value along with the textbox. Then, in your code-behind, you can retrive the value from the hidden field.

Here is a page describing the hidden field - All you need to do it put a runat="server" attribute onto it and you should be able to access this from the code-behind.
Intelligence is a burden.
Jagdip Singh Ajimal
Manchester (and yes, I am a Manchester United fan)
5/14/2008 7:44:05 AM

I found this problem a short time ago.

In PageLoad or PageInit add to yourcode this: MyTextBox.Attributes.Add("readonly", "readonly");

It's a work around that add manualy "readonly" HTML keyword to the result tag, without any modify to the " part" of the object.

Wamba {WamBlog}
Dont forget to click "Mark as Answer" on the post that helped you.
This credits the member,earns you a point & marks your thread as Resolved.
5/14/2008 7:44:24 AM

To set focus and select text of a you have to use the following:

ScriptManager.RegisterStartupScript(this, this.GetType(), "selectAndFocus", "$get('" + myTextBox.ClientID + "').focus();$get('" + myTextBox.ClientID + "').select();", true);

Chetan Sarode
Software Engineer,
Approva Systems Pvt Ltd,
Pune, India.
5/15/2008 3:14:41 AM

Web resources about - How to get textbox value when textbox properties is readonly or enabled false -

General Growth Properties - Wikipedia, the free encyclopedia
Chicago , Illinois , U.S. General Growth Properties, Inc. is an American real estate investment trust , headquartered at 110 North Wacker Drive ...

RentalRoost Brings Facebook Into Process Of Matching Up Home Seekers, Available Properties
... places to live , as RentalRoost , a San Francisco Bay-area-based website that incorporates Facebook data into its rankings of available properties, ...

Extended Profile Properties - Facebook-Entwickler
These Permissions cannot be revoked in the Login Dialog during the login flow, meaning they are non-optional for Users when logging into your ...

PortPerry Properties (@brian14mckinlay) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Hawaii Real Estate Properties for iPad on the App Store on iTunes
Get Hawaii Real Estate Properties for iPad on the App Store. See screenshots and ratings, and read customer reviews.

Qld climate change pilot study shows 4400 properties could flood in Townsville
The Queensland Government is silently preparing Queensland for an 80cm sea rise, which would impact tens of thousands of homes by the end of ...

Smart Buys: Sydney properties for less than $1 million
Domain's choice of smart Sydney properties this week.

Australian Federal Police raid properties in new CFMEU-linked investigation
Federal Police have raided properties as part of an investigation into a CFMEU organiser suspected by authorities of being bribed.

Sydney gateway: Rail line to be moved, properties affected under plan to link WestConnex to airport
A key rail line linking Sydney's west with Port Botany will need to be shifted under tentative plans to build separate motorways to Sydney Airport. ...

Queensland storms: Roofs ripped off houses in Warwick, 19,000 properties left without power
... roofs in Warwick, as wild storms move across south-east Queensland. More than a dozen homes have lost their roofs and close to 19,000 properties ...

Resources last updated: 1/2/2016 2:22:44 PM