Por alguna razón, no se actualizará ningún CalendarExtenders en un sitio ASP.NET en el que se esté trabajando. Ya he comprobado todos los lugares obvios (como AutoPostBack y AutoEventHandler). El problema es que cuando selecciono una fecha del Calendario y la publico en el formulario, se está actualizando el TextBox que se está ampliando, pero la fecha del extensor del calendario simplemente no se está actualizando (por ejemplo, SelectedDate sigue siendo el mismo que antes) . Busqué en Google cualquier posible solución pero ninguna ha funcionado.ASP.NET Ajax CalendarExtender no actualizará el valor SelectedDate
Aquí está el código:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeBehind="ThePage.aspx.cs" Inherits="ThePage" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:TextBox runat="server" ID="txtBlah" />
<asp:CalendarExtender ID="txtBlahExtender" runat="server" TargetControlID="txtBlah" Format="MMMM d, yyyy" />
<asp:Button runat="server" ID="btnSubmit" CausesValidation="false" />
y el código subyacente:
public partial class ThePage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtBlahExtender.SelectedDate = DateTime.Today.AddDays(4);
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
//do postback actions
}
}
}
Cuando mi código llega a "hacer las acciones de devolución de datos", txtBlahExtender.SelectedDate es SIEMPRE DateTime.Today.AddDays (4) . Simplemente no registra el cambio.
¿Alguna idea?
Gracias, Logain Smith
(¿Es posible dar formato a una pregunta?)
Me encuentro con el mismo problema – Starwfanatic