jQuery public string Post()
{
if (!Request.Content.IsMimeMultipartContent())
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
HttpRequest request = HttpContext.Current.Request;
string root = HttpContext.Current.Server.MapPath("~/App_Data");
var provider = new MultipartFormDataStreamProvider(root);
MultipartFormDataContent mpfdc = new MultipartFormDataContent();
try
{
Request.Content.ReadAsMultipartAsync(provider);
string formXML = provider.FormData["FormXML"];
string content = provider.FormData["content"];
var response = Request.CreateResponse();
response.Content = mpfdc;
response.StatusCode = HttpStatusCode.OK;
return "1";
}
catch (System.Exception e)
{
return "2";
}
}
有一个名为datepicker
的函数,它允许您向用户显示日期格式,同时使用另一个作为值。
如果以1970-01-01为值,如何向用户显示01/01/1970?
示例
altFormat
答案 0 :(得分:0)
好吧,所以我让自己这样跑:
CSS:
.pickadate {
color: #FFF;
}
.show_date_to_user {
display:none;
position: relative;
top: -25px; /* You might have to adjust this */
left: 10px;
height:0;
float:left;
}
jQuery的:
$(document).ready(function(){
$('.pickadate').datepicker({
format: "yyyy-mm-dd",
})
$('.pickadate').after('<div class="show_date_to_user"></div>');
$('.pickadate').on('changeDate', function() {
var data = $(this).val();
var data = data.split('-').reverse().join('-');
var data = data.replace(/-/g,"/");
$(this).nextAll('.show_date_to_user').css("display","inline-block").html(data);
});
});
这是做什么的:
答案 1 :(得分:0)
jQuery ui datepicker支持这种行为: 您需要两个输入: