Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In My Project i have text-box which is enabled ,i set popup calender when i click on button and it goes post-back it clear textbox value

XML
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:TextBox ID="TextBox1" runat="server" Enabled="False" ReadOnly="True"></asp:TextBox>
    <cc1:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
        Enabled="True" PopupButtonID="Button2" TargetControlID="TextBox1">
    </cc1:CalendarExtender>
    <asp:Button ID="Button2" runat="server" Height="25px" Text="+"
        Width="39px" />
    <br />
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="add" />
</asp:Content>
Posted
Updated 14-Feb-14 0:40am
v2
Comments
King Fisher 14-Feb-14 6:42am    
Why did you 'Enabled="False" '
dhiraj mane 17-Feb-14 3:06am    
b'caz no one can change value

If a control is disabled it cannot be edited and its content is excluded when the form is submitted.

If a control is readonly it cannot be edited, but its content (if any) is still included with the submission.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900