Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I am working with jquery calender control to display in textbox.My problem is when i use runat="server",the data selected in the calender control is not display in textbox.

Sample code:
HTML
Select Date: <input type='text' id='sel'  önclick='dispCal()'  runat="server" size=10 readonly='readonly' />
	<img src="../images/calendar.png"  runat="server"  önclick='dispCal()' style='cursor: pointer; vertical-align: middle;' />
        <table class="calendar" id="calendar" border="0" cellpadding="0" cellspacing="0">
            <tr class="monthdisp">
                <td class="navigate" align="left"><img src="../images/previous.png"  runat="server"  önclick='return prev()' /></td>
                <td align="center" id="month"></td>
                <td class="navigate" align="right"><img src="../images/next1.png"  runat="server"  önclick='return next()' /></td>
                </tr>
            <tr>
                <td colspan="3">
                    <table id="dispDays" border="0" cellpadding="4" cellspacing="4">                        
                    </table>                    
                </td>
            </tr>
        </table>

Here the textbox not shows nothing
HTML
Select Date: <input type='text' id='sel'  önclick='dispCal()' size=10 readonly='readonly' />
	<img src="../images/calendar.png"  runat="server"  önclick='dispCal()' style='cursor: pointer; vertical-align: middle;' />
        <table class="calendar" id="calendar" border="0" cellpadding="0" cellspacing="0">
            <tr class="monthdisp">
                <td class="navigate" align="left"><img src="../images/previous.png"  runat="server"  önclick='return prev()' /></td>
                <td align="center" id="month"></td>
                <td class="navigate" align="right"><img src="../images/next1.png"  runat="server"  önclick='return next()' /></td>
                </tr>
            <tr>
                <td colspan="3">
                    <table id="dispDays" border="0" cellpadding="4" cellspacing="4">                        
                    </table>                    
                </td>
            </tr>
        </table>

This code works but i want to use the value of textbox value in codeBehind?
Is possible to work with this?
Posted
v3
Comments
Thanks7872 21-Aug-13 0:59am    
If it works than grab the value in code behind using Textbox.text. What's the problem?
prabhatsp 21-Aug-13 1:11am    
i use html control for textbox, runat ="server" is the main thing to be used in all control to work with codebehind
Thanks7872 21-Aug-13 1:14am    
Why to avoid using asp textbox? Any reason? I think you just need textbox with calendar and want to access its value in code behind,right?
prabhatsp 21-Aug-13 1:38am    
calender control using jquery
http://www.hscripts.com/scripts/JavaScript/popup-calendar.php
prabhatsp 21-Aug-13 1:34am    
yes.i work with asp:textbox also,same problem .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900