Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have date picker & text box. Text box is populated with current date n further date selection is disabled in date picker. When web app is deployed in server, text box shows server date, but date picker picks client machine date as max date.

How to set date picker max date to server date.Please help me.
Posted
Comments
darsh_84 6-Jan-15 11:53am    
Sorry, forgot to mention that this app is in mvc4.

1 solution

That's the correct behavior. Instead, before you go further I would suggest you to understand the difference between Client and Server programming. Here a good thread about it:

http://programmers.stackexchange.com/questions/171203/what-are-the-difference-between-server-side-and-client-side-programming[^]

Coming back to your question about rendering the max date on client as server date. You can actually use the RegisterClientScriptBlock [^]method to set a JavaScript variable as the server date. Later use this variable value in your client side code/calendar etc.

Look at this article on how to use Server Side code in your Client Side.

http://manasbhardwaj.net/accessing-c-variables-in-javascript/[^]

Disclaimer: Link points to my own post.
 
Share this answer
 

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