can i have a date in the url of a route in asp.net ?

Posted by oo on Stack Overflow See other posts from Stack Overflow or by oo
Published on 2010-03-21T13:29:27Z Indexed on 2010/03/21 13:31 UTC
Read the original article Hit count: 149

Filed under:
|
|
|

This code below doesn't seem to work but i can't figure out why. If i have a user entered textbox that is a datepicker and the results are displayed as:

21-May-2010

, can i take this value and stick it into a URL to send over to a controller action so instead of an id (which is an int), i want a id which is a date value

View / Javascript Code:


 $.get('/Tracker/DailyBlog/' + this.val(), function(data) {
      $('#dailyblog').html(data);
 });

ControllAction Code:


public ActionResult DailyBlog(DateTime blogDate)
{
     //go do something
}

any idea why this is not working ?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about jQuery