Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox ReadOnly problem

Status
Not open for further replies.

liorlankril

Programmer
Nov 5, 2005
46
IL

I have a web form in .NET 2005 (c#).

My form contain a TextBox control (called "BirthDate") and ImageButton. One of the TextBox property is ReadOnly=true. Click on the button open a calendar object thatlet the user to select date. The selected date get into the TextBox control (by javascript function - client code).

I use "ReadOnly=true" since I want the user to use only the calander object to insert date.

The problem is when I try to submit the form, I try to read the TextBox value ("BirthDate.Text" - server code) but it's value is empty string and not the value that I select by the calander.

What's can be the problem? why it's happen in VS 2005 and not in 2003???
 
forum855 is better suited to asp.net questions.

you're trying to mix server side control attributes and client side functionality for this problem. I would abandon server or client and do a pure 1 sided solution.

server side might be easier, but requires many postbacks. Client side would be slightly more work (js/css), but creates a much better user experience.

there are also 3rd party controls which do this. I use a control call Basic Date Picker. MS AJAX Control Toolkit library also has a calendar, and I'm sure there are other projects as well.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top