Hi,
I used Webdate chooser in my page form. While submitting i am handlilng some validation that date got selected or not. If not selected i have to display * near of this date control. I used Required Validator like below
</CalendarLayout></ig:WebDateChooser>
<asp:RequiredFieldValidator Display="Static">*</asp:RequiredFieldValidator>
In browser * has to display after the data control. But its displaying always next line. I didn't used any <br>. If i use regular ASP:Textbox, * is getting displaying next to the control
Can you please help me to sort out this problem.
For temprary solution, i used each <td><.td> for <ig:WebDateChooser> and <asp:RequiredFieldValidator >, this is not a good solution.
Hello,
This is just because of how the control is architected. An asp.net textbox is just a standard input type =textbox. The WebDatePicker or WebDateChooser are both tables in html that contain html input controls. This is why nothing can go next to it. You can try this yourself. Create a simple <table and try to put a control next to it. It will not let you.
<table style="width:400px; height:200px; border:1 solid black;"> <tr><td></td></tr> </table><asp:RequiredFieldValidator ID="RequiredFieldValidator1" ErrorMessage="errormessage" ControlToValidate="WebDatePicker1" runat="server" />
So, there are three workarounds that I can think of.
1). Would be what you did by placing the controls inside of a table.
2). Placing the controls inside of a container dive and float the controls inside of the container div. Here is an example of that.
<div id="outerDiv"> <div style="float:left"> <ig:WebDatePicker ID="WebDatePicker1" runat="server"></ig:WebDatePicker> </div> <div style="float:left"> <asp:RequiredFieldValidator ErrorMessage="errormessage" ControlToValidate="WebDatePicker1" runat="server" /> </div> <div style="clear:left"></div></div>
3). modify the html of the control container in javascript. If you handle the initialize events for the controls, you can set the display of the table to inline.
function WebDatePicker1_Initialize(sender, eventArgs){ sender.get_element().style.display = "inline";}
function wdc1_InitializeDateChooser(oDateChooser){ oDateChooser.Element.style.display = "inline";}
I gave you code for the webDateChooser (older) and the WebDatePicker(newer) control. This will allow you to modify the html dirictly and does not require you to wrap the controls inside of anything.
I hope one of these solutions will work for you.