lundi 18 janvier 2016

How to bind Data to the Template/View in Umbraco MVC

I am using Umbraco 6.2.1 with MVC3 and I Created one Document Type as Index and also template by the same name and My Umbraco Structure is as follows: Here I am trying to Render the View(CNOReplacement)and binding the Model data to the View on the submission on Index View. My Code is as follows:

@using Umbraco_POCTest.Controllers;
@using Umbraco_POCTest.Models;
@using Umbraco.Web;
@inherits Umbraco.Web.Mvc.UmbracoViewPage<MasterViewModel>
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using (Html.BeginUmbracoForm<CNOPOCController>("CNOReplacementSubmit"))
    {
<div class="form-group col-md-6">
     <label class="control-label"> Phone</label>
     <input type="text" name="Phone"  id="Phone" class = "form-control" placeholder = "Phone" style="width:100px;" />
</div>
<div class="form-group  col-md-6">
     <label class="control-label">Email</label>
     <input type="text" name="Email" id="Email" class = "form-control" placeholder = "Email" style="width:100px;" />
 </div>
}

and My CNOReplacement View is as follows:

@using Umbraco_POCTest.Controllers;
@using Umbraco_POCTest.Models;
@using Umbraco.Web;
@inherits Umbraco.Web.Mvc.UmbracoViewPage<MasterViewModel>
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
    Layout = "Master.cshtml";
}
 @using (Html.BeginUmbracoForm<CNOPOCController>("CNOBeneficiary"))
 {
<div class="form-group col-md-6">
         <label class="control-label"> Phone</label>
         <input type="text" name="Phone"  id="Phone" class = "form-control" placeholder = "Phone" style="width:100px;" />
    </div>
    <div class="form-group  col-md-6">
         <label class="control-label">Email</label>
         <input type="text" name="Email" id="Email" class = "form-control" placeholder = "Email" style="width:100px;" />
     </div>
    }

enter image description here

Aucun commentaire:

Enregistrer un commentaire