Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,

<pre lang="c#"><td>
                      @Html.TextBoxFor(m => m.SepDate, new { id = "txtSeparationDate", style = "width:260px;" })
                    @* <img src="../../Images/imgdate.jpg" id="img_Date" />*@
                      <span id="SepDate_Error" class="colr"></span>
                </td>

i need datepicker in my application with image .user clicks image i need to populate calender then once he pick date textbox it should shows 5\31\2012 like this
can any one help with this how i can do this No idea in MVC3

Please help me

Thanks
Posted

1 solution

Use jquery Datepicker

http://jqueryui.com/demos/datepicker/[^]
 
Share this answer
 
Comments
kimberly wind 30-May-12 10:59am    
i want to do with calender image
Sandeep Mewara 30-May-12 11:19am    
What!!!

http://jqueryui.com/demos/datepicker/#icon-trigger

:doh:

kimberly wind 30-May-12 11:23am    
this is okie i have doubt like we need to write separate method in Controller.
Dylan Morley 30-May-12 12:06pm    
Not for this, no. Just initialise the jQuery Datepicker, point it at the element you want to populate (a textbox associated with your model property), when you post back to the controller your Model will include the value set by jquery.

You do need to create a controller method to accept the post data, e.g.

public ActionResult ShowData()
{
// however you are creating your model
var model = GetSomeModel();
return View(model);
}

[HttpPost]
public ActionResult ShowData(SomeModelType model)
{
// your form with jquery calendar should post to this controller method...
}
kimberly wind 31-May-12 2:01am    
from this link i did http://jqueryui.com/demos/datepicker/#icon-trigger
but still i image not loading properly and also calender style

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