ejaz mirza

ejaz mirza

  • NA
  • 471
  • 47.2k

i want send the loosely typed data to controller

Jan 18 2019 4:00 AM
i have a page in that i have strongly typed controls of the model and loosely typed controls not related to this model i want to send the data to controller at a time how should i 
below is my code 
 
 
 
<div class="container-fluid">
<div class="row">
<div class="col-sm-9">
<h5><b>Appoitment Details :</b></h5>
<div style="border-color:cadetblue;border-style:solid;padding:10px 15px 0px 15px;">
<div class="row text-left">
<div class="col-sm">
@Html.LabelFor(model => model.PatRegId)
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.EditorFor(model => model.PatRegId, new { htmlAttributes = new { @class = "form-control", @list = "PatRegId", @id = "patregid", @autocomplete = "false" } })
@*<input list="PatRegId" name="PatRegId" id="patregid" class="form-control">*@
<datalist id="PatRegId">
@foreach (var v in ViewBag.patientreglist)
{
<option value="@v.Value"></option>
}
</datalist>
</div>
<span id="validateName" class="validator"></span>
</div>
<div class="col-sm">
@Html.Label("AppointmentTypeId")
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.DropDownList("AppointmentTypeId", @ViewBag.appoitmenttype as SelectList, "SELECT", new { @Class = "form-control" })
</div>
@Html.ValidationMessage("AppointmentTypeId", "", new { @class = "text-danger" })
</div>
<div class="col-sm">
@Html.Label("AppointmentDate")
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.Editor("AppointmentDate", new { htmlAttributes = new { @class = "form-control" } })
</div>
@Html.ValidationMessage("AppointmentDate", "", new { @class = "text-danger" })
</div>
<div class="row">
<div class="col-sm">
@Html.LabelFor(model => model.PaymentModeId)
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.TextBoxFor(model => model.PaymentModeId, new { Class = "form-control" })
</div>
<span id="validateName" class="validator"></span>
</div>
</div>
<div class="row">
<div class="col-sm">
@Html.LabelFor(model => model.PaidAmount)
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.TextBoxFor(model => model.PaidAmount, new { Class = "form-control" })
</div>
<span id="validateName" class="validator"></span>
</div>
</div>
<div class="row">
<div class="col-sm">
@Html.LabelFor(model => model.DueAmount)
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.TextBoxFor(model => model.DueAmount, new { Class = "form-control" })
</div>
<span id="validateName" class="validator"></span>
</div>
</div>
<div class="row">
<div class="col-sm">
@Html.LabelFor(model => model.PaidDate)
<div class="input-group ">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.TextBoxFor(model => model.PaidDate, new { Class = "form-control date" })
@*@Html.EditorFor(model => model.TestId, new { htmlAttributes = new { @class = "form-control", @Type = "text", @list = "TestId" } })*@
</div>
<span id="validateName" class="validator"></span>
</div>
</div>
<div class="row">
<div class="col-sm discountdiv">
@Html.LabelFor(model => model.Discount, "Discount(%)")
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><img src="~/images/res/user_img.png" height="15px" width="15px"></span>
</div>
@Html.TextBoxFor(model => model.Discount, new { Class = "form-control", id = "txtdiscount" })
</div>
<span id="validateName" class="validator"></span>
</div>
</div>
<div class="row">
<div class="col-sm discountdiv">
@Html.LabelFor(model => model.Discount, "(In Rupees)")
<div class="input-group ">
@Html.CheckBoxFor(model => model.DiscountIn, new { id = "discountrupees" })
<br>
</div>
<span id="validateName" class="validator"></span>
</div>
</div>
<div class="row">
<div class="col-sm">
@Html.LabelFor(model => model.Discount, "Test wise Discount")
<div class="input-group ">
<input type="checkbox" name="discount" id="discount"> <br>
</div>
</div>
</div>
<div class="row">
<div class="col-sm">
<input id="btnSave" type="submit" value="Create" class="btn btn-primary" style="margin-top:20px;" />
</div>
</div><br />
</div>
</div>
 

Answers (2)