if we are using same as with html helpers how can we do and i would like to know one more thing when we are using html helpers how can we write javascript using model binders.
please see below view in this i used model binders with html helpers here how can i use same model property for multiple values
ex: i would like to store one value like current year value in model.DescriptionOfCircumstancesInWhichRevenueRecognitionHasBeenPostponedPendingResolutionOfSignificantUncertainties and previous year value in model.DescriptionOfCircumstancesInWhichRevenueRecognitionHasBeenPostponedPendingResolutionOfSignificantUncertainties how can i write and how can i use it
thanks in Advance
@model Taxonomy_MVC.Models.RevenueModel
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>RevenueModel</legend>
<div class="editor-label">
@Html.LabelFor(model => model.DescriptionOfCircumstancesInWhichRevenueRecognitionHasBeenPostponedPendingResolutionOfSignificantUncertainties)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.DescriptionOfCircumstancesInWhichRevenueRecognitionHasBeenPostponedPendingResolutionOfSignificantUncertainties)
@Html.ValidationMessageFor(model => model.DescriptionOfCircumstancesInWhichRevenueRecognitionHasBeenPostponedPendingResolutionOfSignificantUncertainties)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.DisclosureOfRevenueExplanatoryTextBlock)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.DisclosureOfRevenueExplanatoryTextBlock)
@Html.ValidationMessageFor(model => model.DisclosureOfRevenueExplanatoryTextBlock)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.DescriptionOfAccountingPolicyForRecognitionOfRevenue)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.DescriptionOfAccountingPolicyForRecognitionOfRevenue)
@Html.ValidationMessageFor(model => model.DescriptionOfAccountingPolicyForRecognitionOfRevenue)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ShareRevenueFromOperationsJointVentures)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ShareRevenueFromOperationsJointVentures)
@Html.ValidationMessageFor(model => model.ShareRevenueFromOperationsJointVentures)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
Model:
public class RevenueModel
{
[Display(Name = "Description of circumstances in which revenue recognition has been postponed pending resolution of significant uncertainties")]
public string DescriptionOfCircumstancesInWhichRevenueRecognitionHasBeenPostponedPendingResolutionOfSignificantUncertainties { get; set; }
[Display(Name = "Disclosure of revenue explanatory [Text Block]")]
public string DisclosureOfRevenueExplanatoryTextBlock { get; set; }
[Display(Name = "Description of accounting policy for recognition of revenue")]
public string DescriptionOfAccountingPolicyForRecognitionOfRevenue { get; set; }
[Display(Name = "Share revenue from operations joint ventures")]
public string ShareRevenueFromOperationsJointVentures { get; set; }
}
Chakravarthi, if this helps please login to Mark As Answer. | Alert Moderator