Description:-
In this Example we
explain that how to add Calendar Control or Datepicker in a TextBox click in
mvc 4 with Asp.Net using Jquery or Implement Calendar control in Asp.Net mvc.
This is the basic thing that we use calendar in every Forms or Razor
View to Upload Date in Database. Here in this Example we Add the Calender in
TextBox click to upload the Date of the File Upload by using Jquery and also
implement the code in Controller class to save the data in database.
Here is a simple code to display Calender in MVC 4 Razor view
<script type="text/jscript">
$(function () {
$("#Upload_Date").datepicker(); // Here Upload_Date is
the Id of the TextBox.
});
</script>
Here we also Describe to upload the File in Database to do this first we
have to set this thing
@using (Html.BeginForm("Fileuploads", "FolderHierchy", FormMethod.Post, new { enctype = "multipart/form-data" }))
AND
<input type="file" name="files" id="file" multiple="multiple" />
Here "multipart/form-data" is used for when we upload the file in database and multiple="multiple" is used for to upload multiple file at a time.
To handle this File Upload in controller you have to implement this code
[HttpPost]
public ActionResult Fileuploads(Folder containers, IEnumerable<HttpPostedFileBase> files)
{
foreach (var file in files)
{
if (Convert.ToInt32(filesize) < 1073741824)//1GB Limit
{
//your code
}
}
}
Insert,Update,Delete in ModalPopup CRUD operation in ModalPopup
Read and Write in Text File in asp.Net Read and Write File in Asp.Net