Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jquery UI datepicker

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
I can't find anywhere how I use jquery UI datepicker with Asp.net

I am trying to retrieve booked dates from a database and colour them a specific colour in the calendar.

Anyone have code for this or can point me in the right direction.

Thanks
 
jquery works on the client, with the rendered html. how the html is rendered doesn't matter (static, asp.net, php, ruby). so you won't find explicit examples about how to get jquery working with webforms.

what you may find is how to work with jquery with html rendered by webforms. typically the only issue with this is how to handle the clientId generated by webforms.

with jquery int the client(browser) environment there is no concept of a database either. you will need to load the dates either as part of rendering the page, or making an ajax call to the server to retrieve the dates.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
UI Date picker works great with ASP.net.

The key is rememering that you can't refer to an ID attribute (because until 2010 asp loved to corrupt id's for its' own crazy purpose), you need to add a class (cssClass) to your asp:textbox and bind the class to the datapicker control.

At that point it is a simple matter to retrive the text property of the textbox.

The only thing i should add, is make sure you include the ui.css files and images, otherwise it won't look very good.

A few projects ago, i used datepickers to display 3 months at a time. It is MUCH easier to use than the ajax controls or even the datepicker for alot of customization.

 
Maybe i need to read more carefully.. I think what you want might not be possible (change dates based on an array of dates from a db.)..

I have done that with the classic calendar control,but i suspect that Jason is 100% correct. (I will dig a bit deeper to see if it might be doable, but...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top