We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Control datepicker inside a FormView inside an UpdatePanel

Thread ID:

Created:

Updated:

Platform:

Replies:

142522 Feb 7,2019 03:06 PM UTC Feb 8,2019 05:23 AM UTC ASP.NET Web Forms (Classic) 2
loading
Tags: DateTimePicker
Roger Alberto
Asked On February 7, 2019 03:06 PM UTC





Every time I try to save the value of the datepicker the value comes out null, I know that this happens to be inside an updatepanel, I have put the formview as AsyncPostBackTrigger, but still if I select the value. I also put the code from the server in C # but it does not work. I take the data from a SqlDatasource.




SCREEN





C#
 protected void Persona_estudiosSqlDataSource_Inserting(object sender, SqlDataSourceCommandEventArgs e)
    {
        try
        {
            e.Command.Parameters[0].Value = Id_personaHiddenField.Value;
            e.Command.Parameters[1].Value = ((DropDownList)CentroEstudiosFormView.FindControl("CentroestudiosDropDownList")).SelectedValue;
            e.Command.Parameters[2].Value = ((Syncfusion.JavaScript.Web.DatePicker)CentroEstudiosFormView.FindControl("DesdeDatePicker")).Value;
            e.Command.Parameters[3].Value = ((Syncfusion.JavaScript.Web.DatePicker)CentroEstudiosFormView.FindControl("HastaDatePicker")).Value;
        }
        catch (Exception ex)
        {

            ErrorMessage.Text = "Insertar centro de estudios: " + ex.Message;
        }
    }

Roger Alberto
Replied On February 7, 2019 04:49 PM UTC

Already solved. I put the code below. Now I'm going to test with the other controls (combox, Dropdownlist, ETC). :)




protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            Syncfusion.JavaScript.Web.DatePicker DesdeCE_dtp = ((Syncfusion.JavaScript.Web.DatePicker)CentroEstudiosFormView.FindControl("DesdeDatePicker"));
            Syncfusion.JavaScript.Web.DatePicker hastaCE_dtp = ((Syncfusion.JavaScript.Web.DatePicker)CentroEstudiosFormView.FindControl("HastaDatePicker"));
            
            ScriptManager.GetCurrent(Page).RegisterAsyncPostBackControl(DesdeCE_dtp);
            ScriptManager.GetCurrent(Page).RegisterAsyncPostBackControl(hastaCE_dtp);
          }
     }

Prince Oliver [Syncfusion]
Replied On February 8, 2019 05:23 AM UTC

Hi Roger, 

Thank you for your update. 

We are glad the issue is resolved in your end. Please let us know, if you face any issues. 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;