在回发页面文本框值很清楚 [英] at postback page textbox value is clear
本文介绍了在回发页面文本框值很清楚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的项目中,我有启用的文本框,当我点击按钮时我设置了弹出日历,然后它回复后显示文本框值
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
<%@ 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>
推荐答案
参考:
回发后文本框值丢失 [ ^ ]
http://stackoverflow.com/questions/8011555 / how-to-prevent-my-textbox-from-clearing-text-on-postback [ ^ ]
希望这会有所帮助。
Refer:
TextBox values are lost after postback[^]
http://stackoverflow.com/questions/8011555/how-to-prevent-my-textbox-from-clearing-text-on-postback[^]
Hope this will help.
如果某个控件被禁用,则无法对其进行编辑,并且当表单为提交。
如果控件是只读的,则无法编辑,但其内容(如果有)仍包含在提交中。
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.
这篇关于在回发页面文本框值很清楚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文