troubleshooting Question

Creating a Read-Only Editable TextBox

Avatar of foleyp2007
foleyp2007 asked on
ASP.NET
6 Comments1 Solution1925 ViewsLast Modified:
Hi,
As you can see below I have a text box and a popup calendar. Is there a way to make the TextBox ReadOnly or Enabled=False so only the popup calendar can edit the textbox. I only want the user to be able to change the date via the popup control, but if it is ReadOnly or Disabled, it shows the new values but it dosen't hold them as the value.


<%@ Control Language="C#" AutoEventWireup="true" Inherits="PaymentsLog.Web.Controls.DatePicker"
    Codebehind="DatePicker.ascx.cs" %>
<span style="white-space: nowrap;">
    
<asp:TextBox ID="txtDate" runat="server" Columns="10"></asp:TextBox>
    <asp:ImageButton ID="imgButton" OnClientClick="return false;" runat="server" ImageUrl="~/App_Themes/Default/img/calendar.jpg" />
    
<act:CalendarExtender ID="calExt" runat="server" FirstDayOfWeek="Monday" PopupButtonID="imgButton"
        TargetControlID="txtDate" Format="yyyy/MM/dd" Animated="False">
    </act:CalendarExtender>
</span>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros