Calendar code in a View
i want a calender that has text box, created in mvc4 razor in a view
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sunny SharmaPosted Aug 14, 2013, 12:37 AM
Follow the code below if you want so:
----------------------------------------------------------------------
@{ Layout = null; }
Doctype html>
<html lang="en" >
<head> <title> Sample Date picker in MVC4 Razor view title>
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js">script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js">script>
<script >
$(document).ready(function () {
$("#txtDate").datepicker({dateFormat:"yy-mm-dd"}); });
script>
head>
<body>
@Html.Label("jQuery DatePicker")
@Html.TextBox("txtDate")
@Html.Label("HTML5 DatePicker");
<input type="date" id="txtDate2" />
body>
html>
-------------------------------------------------------------------------------------
Hope it helps :)
Sunny SharmaPosted Aug 14, 2013, 12:31 AM
Do you want a text box inside Calender or a Calender on TextBox Click or hover or etc...? please clarify.
Thanks.