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

DatePicker Value Null inside Dialog

Thread ID:





128994 Feb 20,2017 06:23 PM UTC Feb 23,2017 05:11 AM UTC ASP.NET Web Forms 5
Tags: DatePicker
Asked On February 20, 2017 06:23 PM UTC

I Have Date Picker inside the ejDialog control, and I want to save in database, I testing different option what I find in forum,  but every time I receive null.
var Fe = dp1.Value ; result null.
var Fe = dp1.Value.Value; result null
DateTime Fe = dp1.Value.Value; result null.

Thank You

Replied On February 21, 2017 05:30 PM UTC

The problem is with ej:Dialog, put controls out side the dialog work fine, and the same when i create small form in bootstrap modal window.

Replied On February 21, 2017 05:32 PM UTC

The problem is with ej:Dialog, put controls out side the dialog work fine, and the same when i create small form in bootstrap modal window.

Mabe is necessary us in codebehind "FindControl" option ?

Sasikala Nagarajan [Syncfusion]
Replied On February 22, 2017 12:29 PM UTC

Hi Tomasz,   
Sorry for the delay.  
We have checked with the reported query and we suspect that the issue may be caused due to components are not placed inside the form. This will happen if you didn’t specify the target id for Dialog control while rendering and in this case, Dialog will be appended to body tag (default behavior of Dialog) and which make all the components appended to body (outside of form).  So, these components won’t return their value in server side since it’s not taken into an account in form post (this is behavior in web forms).    
So, to resolve this issue please specify the targeted selector through API Target (Dialog will be displayed (positioned) based on its container).   
Please refer the below code example. Here we have kept the dialog inside the div element which is placed inside the form.   
<div ID="sample"> 
  <ej:Dialog ID="Dialog1" runat="server" Target="#sample"> 
          <p>This is a simple datepicker control</p>             
         <ej:DatePicker ID="Datepicker1" runat="server"></ej:DatePicker> 
       <ej:Button ID="Button1" Text="submit" OnClick="btn_Click" runat="server" ></ej:Button> 
For more information about EJ components, please check below link: 
Sasikala Nagarajan   

Replied On February 22, 2017 08:13 PM UTC

Thank You. Exactly like you said, but, as I have site master for all the pages I have put id for form tag for example "frm" and the next one in dialog I have put Target = "# frm", and it goes well.
thank you so much

Sasikala Nagarajan [Syncfusion]
Replied On February 23, 2017 05:11 AM UTC

Hi Tomasz,   
We are glad to hear that the problem is resolved at your end. Please let us know if you need any further assistance on this.  
We will happy to help you.  
Sasikala Nagarajan  


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

or the page will be automatically redirected to 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