<asp:TextBox ID="txtPlanFinish" runat="server" Style="position: static" CssClass="input"
Enabled="False">请点击右侧图标选择</asp:TextBox>
<img alt="日历对话框" height="17" onclick="GetDate(txtPlanFinish);return false"
src="../Date/calendar.gif" style="position: static" width="17" />图标点击后弹出一格自定义的日历对话框。 选择后会改变文本框的值, 但是在提交事件中 提交的文本框的值却是“请点击右侧图标进行选择”
为什么?
Enabled="False">请点击右侧图标选择</asp:TextBox>
<img alt="日历对话框" height="17" onclick="GetDate(txtPlanFinish);return false"
src="../Date/calendar.gif" style="position: static" width="17" />图标点击后弹出一格自定义的日历对话框。 选择后会改变文本框的值, 但是在提交事件中 提交的文本框的值却是“请点击右侧图标进行选择”
为什么?
<asp:TextBox ID="txtPlanFinish" runat="server" Style="position: static" CssClass="input"
Enabled="False" Text="请点击右侧图标选择"></asp:TextBox>
<img alt="日历对话框" height="17" onclick="GetDate(txtPlanFinish);return false"
src="../Date/calendar.gif" style="position: static" width="17" />
{
try
{
string ActivityName = this.txtActivityName.Text; int TypeId = Convert.ToInt32(ddlType.SelectedValue); string Effect = txtEffect.Text; int LinkmanId = Convert.ToInt32(ddlLinkman.SelectedValue); int CustomerId = Convert.ToInt32(ddlCustomer.SelectedValue); int ChanceId = Convert.ToInt32(ddlChance.SelectedValue); int ServiceId = Convert.ToInt32(ddlService.SelectedValue); /* string PlanStart = "";
if (txtPlanStart.Text != "请点击右侧图标选择")
{
PlanStart = this.txtPlanStart.Text;
}*/ string PlanStart = txtPlanStart.Text;
if (txtPlanStart.Text == "请点击右侧图标选择")
{
PlanStart = "";
} string PlanFinish = "";
if (txtPlanFinish.Text != "请点击右侧图标选择")
{
PlanFinish = txtPlanFinish.Text;
} string FactStart = "";
if (txtFactStart.Text != "请点击右侧图标选择")
{
FactStart = txtFactStart.Text;
} string FactFinish = "";
if (txtFactFinish.Text != "请点击右侧图标选择")
{
FactFinish = txtFactFinish.Text;
} string Bulletin = txtIntroduce.Text; int StateId = Convert.ToInt32(ddlState.SelectedValue); int PRIId = Convert.ToInt32(ddlPRI.SelectedValue); string LoginName = Session["LoginName"].ToString(); DateTime OperateTime = DateTime.Now; sql = "update Tab_Manage_Activity set ActivityName='" + ActivityName + "',TypeId='" + TypeId + "',Effect='" + Effect + "'," +
"LinkmanId='" + LinkmanId + "',CustomerId='" + CustomerId + "',ChanceId='" + ChanceId + "'," +
"ServiceId='" + ServiceId + "',PlanStartTime='" + PlanStart + "',PlanFinishTime='" + PlanFinish + "'," +
"FactStartTime='" + FactStart + "',FactFinishTime='" + FactFinish + "',StateId='" + StateId + "'," +
"PRIId='" + PRIId + "',Bulletin='" + Bulletin + "',LoginName='" + LoginName + "'," +
"OperateTime='" + OperateTime + "' where ActivityId='"+id+"'"; int n = dfun.ExecSQLDataResult(sql); if (n > 0)
{
Page.ClientScript.RegisterStartupScript(typeof(string), "1", "<script>alert('修改成功!')</script>");
}
else
{
Page.ClientScript.RegisterStartupScript(typeof(string), "1", "<script>alert('修改失败!')</script>");
}
}
catch (Exception ex)
{
Page.ClientScript.RegisterStartupScript(typeof(string), "1", "<script>alert('"+ex.Message+"')</script>");
}
}