There are extra inputs in after razor view is rendered - c#

There is an input type="checkbox" in my razor, in my controller I saw that I'm getting multiple values for it. when I open the source code, there is an extra checkbox with that name that does not exist in my cshtml page:
this is the view:
<h1>Edit</h1>
<h4>Main Menu</h4>
<hr />
#if (domainId == 0)
{
<p>Please select a domain to manage its Main Menu.</p>
}
else
{
<div class="row">
<div class="col-md-4">
<form asp-action="Edit">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="Name" class="control-label"></label>
<input asp-for="Name" class="form-control" />
</div>
<div class="form-group">
<label asp-for="Enabled" class="control-label"></label>
<input asp-for="Enabled" style="vertical-align:middle;" />
</div>
<input type="hidden" name="domainid" value="#domainId" />
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" /> <a asp-action="Index" class="btn btn-dark">Back to List</a>
</div>
</form>
</div>
</div>
}
and this is the page source code:
<h1>Edit</h1>
<h4>Main Menu</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form action="/Navigations/Edit/2" method="post">
<input type="hidden" data-val="true" data-val-required="The Id field is required." id="Id" name="Id" value="2" />
<div class="form-group">
<label class="control-label" for="Name">Name</label>
<input class="form-control" type="text" id="Name" name="Name" value="Colors2" />
</div>
<div class="form-group">
<label class="control-label" for="Enabled">Enabled</label>
<input style="vertical-align:middle;" type="checkbox" data-val="true" data-val-required="The Enabled field is required." id="Enabled" name="Enabled" value="true" />
</div>
<input type="hidden" name="domainid" value="2" />
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" /> <a class="btn btn-dark" href="/Navigations">Back to List</a>
</div>
<input name="__RequestVerificationToken" type="hidden" value="CfDJ8BstbX-4WaJCtXJ2dnnNizPHecbQCN_dSuVU4omAVZmEOIjVXgNxzg0hlL5YKvgOUrSFYDvBHeKaws842QwGbAxfavMVf94GMN5nOJj9ZQ2qWcvyKNvEJj1qyr1_JIR1CyxeSjYe0UEcqBUpvkiVtpUdA-Yh_WXzxZbGvsCk4McM7o5HPYGLFX3bD15L58FtUg" /><input name="Enabled" type="hidden" value="false" /></form>
</div>
</div>
</main>
</div>
</div>
There is a hidden input named "Enabled" right before form closes, but where it comes from?

Related

Passing model from get method to a post nulls the model

When I pass model to the view on the post method the ProductId and UserId get nulled.
[HttpGet]
public async Task<IActionResult> AddReview(int id)
{
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
var model = new AddReviewViewModel()
{
ProductId = id,
UserId = userId
};
return View(model);
}
[HttpPost]
public async Task<IActionResult> AddReview(AddReviewViewModel addReviewViewModel)
{
if (!ModelState.IsValid)
{
return View(addReviewViewModel);
}
//...
}
Here is how I call the post method.
<div class="row">
<div class="col-sm-12 offset-lg-2 col-lg-8 offset-xl-3 col-xl-6">
<form asp-action="AddReview" method="post">
<div class="mb-3">
<label asp-for="#Model.Comment" class="form-label">Comment</label>
<input asp-for="#Model.Comment" class="form-control" aria-required="true" />
<span asp-validation-for="Comment" class="text-danger"></span>
</div>
<div class="mb-3">
<label asp-for="#Model.Rating" class="form-label">Rating</label>
<input asp-for="#Model.Rating" class="form-control" aria-required="true" />
<span asp-validation-for="Rating" class="text-danger"></span>
</div>
<div class="mb-3">
<input class="btn btn-primary" type="submit" value="Submit Review" />
</div>
</form>
</div>
</div>
I have done something like this while adding a new product but I haven't had any problem.
You have to return the data. It needs to make a round-trip. This is typically done with hidden input fields.
<input type="hidden" id="ProductId" name="ProductId" value="#Model.ProductId">
<input type="hidden" id="UserId" name="UserId" value="#Model.UserId">
Full example
<form asp-action="AddReview" method="post">
<input type="hidden" id="ProductId" name="ProductId" value="#Model.ProductId">
<input type="hidden" id="UserId" name="UserId" value="#Model.UserId">
<div class="mb-3">
<label asp-for="#Model.Comment" class="form-label">Comment</label>
<input asp-for="#Model.Comment" class="form-control" aria-required="true" />
<span asp-validation-for="Comment" class="text-danger"></span>
</div>
<div class="mb-3">
<label asp-for="#Model.Rating" class="form-label">Comment</label>
<input asp-for="#Model.Rating" class="form-control" aria-required="true" />
<span asp-validation-for="Rating" class="text-danger"></span>
</div>
<div class="mb-3">
<input class="btn btn-primary" type="submit" value="Submit Review" />
</div>
</form>
If your version supports taghelpers you can also write:
<input type="hidden" asp-for="ProductId">
<input type="hidden" asp-for="UserId">
Or using the HtmlHelper:
#Html.HiddenFor(m => m.ProductId)
#Html.HiddenFor(m => m.UserId)
In all cases, make sure you add this inside the form.

Posting varying amount of images from a form

I'm attempting to build a form with a few textbox inputs and a file input for someone to upload images.
When a file is picked, I have some JS go get a partial view and render it in the form. After the new partial is rendered, I clone and copy the file input element and place it as a hidden input in the new partial to be used later in the form. There's some other fields in the partial that relate to the image that was selected.
Once that's all done, the file input element is reset, and the user can select another image, generating a new partial view, etc.
The form looks like it's being rendered correctly, but when I try to submit, VS memory/cpu usage spikes, and the request never makes it to the controller. Any advice or help here is appreciated!
Screenshot of the form
ViewModel:
public class ProjectCreate
{
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public DateTime ProjectDate { get; set; }
public List<Image> GalleryImages { get; set; }
}
Image ViewModel:
public class Image
{
public int Id { get; set; }
public int GalleryIndex { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public IFormFile ImageFile { get; set; }
}
Form:
<form asp-action="Create" enctype="multipart/form-data">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group col-sm-4">
<label asp-for="Title" class="control-label"></label>
<input asp-for="Title" class="form-control" />
<span asp-validation-for="Title" class="text-danger"></span>
</div>
<div class="form-group col-sm-4">
<label asp-for="Description" class="control-label"></label>
<input asp-for="Description" class="form-control" />
<span asp-validation-for="Description" class="text-danger"></span>
</div>
<div class="form-group col-sm-4">
<label asp-for="ProjectDate" class="control-label"></label>
<input asp-for="ProjectDate" class="form-control" />
<span asp-validation-for="ProjectDate" class="text-danger"></span>
</div>
<div class="form-group col-sm-4">
<label class="control-label">Project Images</label>
<input id="ImageUpload" type="file" class="form-control" accept="image/jpeg, image/png, image/gif" />
</div>
#* Display images here *#
<div id="pending-images" class="row"></div>
<div class="form-group">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</form>
The 'pending-images' div is where the partialview is rendered to.
PartialView:
<div class="card mb-3" style="width: 18rem">
<img class="card-img-top" id="pending-image-#Model.Id" src="" style="max-height: 18rem; max-width: 18rem;" />
<div class="card-body">
<div class="form-group">
<label class="control-label">Index</label>
<input id="GalleryImages[#Model.Id].GalleryIndex" name="GalleryImages[#Model.Id].GalleryIndex" class="form-control" value="#Model.Id" />
</div>
<div class="form-group">
<label class="control-label">Name/Title</label>
<input id="GalleryImages[#Model.Id].Name" name="GalleryImages[#Model.Id].Name" class="form-control" />
</div>
<div class="form-group">
<label class="control-label">Description</label>
<input id="GalleryImages[#Model.Id].Description" name="GalleryImages[#Model.Id].Description" class="form-control" />
</div>
<input type="file" id="GalleryImages[#Model.Id].ImageFile" name="GalleryImages[#Model.Id].ImageFile" style="display: none;" />
</div>
</div>
Rendered HTML:
<form enctype="multipart/form-data" action="/Projects/Create" method="post" novalidate="novalidate">
<div class="form-group col-sm-4">
<label class="control-label" for="Title">Title</label>
<input class="form-control valid" type="text" id="Title" name="Title" value="" aria-invalid="false">
<span class="text-danger field-validation-valid" data-valmsg-for="Title" data-valmsg-replace="true"></span>
</div>
<div class="form-group col-sm-4">
<label class="control-label" for="Description">Description</label>
<input class="form-control valid" type="text" id="Description" name="Description" value="" aria-invalid="false">
<span class="text-danger field-validation-valid" data-valmsg-for="Description"
data-valmsg-replace="true"></span>
</div>
<div class="form-group col-sm-4">
<label class="control-label" for="ProjectDate">Project Date</label>
<input class="form-control valid" type="date" data-val="true"
data-val-required="The Project Date field is required." id="ProjectDate" name="ProjectDate" value=""
aria-describedby="ProjectDate-error" aria-invalid="false">
<span class="text-danger field-validation-valid" data-valmsg-for="ProjectDate"
data-valmsg-replace="true"></span>
</div>
<div class="form-group col-sm-4">
<label class="control-label">Project Images</label>
<input id="ImageUpload" type="file" class="form-control" accept="image/jpeg, image/png, image/gif">
</div>
<div id="pending-images" class="row">
<div class="col-sm-4">
<div class="card mb-3" style="width: 18rem">
<img class="card-img-top" id="pending-image-0" src="data:image/jpeg;base64,xxx"
style="max-height: 18rem; max-width: 18rem;">
<div class="card-body">
<div class="form-group">
<label class="control-label">Index</label>
<input id="GalleryImages[0].GalleryIndex" name="GalleryImages[0].GalleryIndex"
class="form-control" value="0">
</div>
<div class="form-group">
<label class="control-label">Name/Title</label>
<input id="GalleryImages[0].Name" name="GalleryImages[0].Name" class="form-control">
</div>
<div class="form-group">
<label class="control-label">Description</label>
<input id="GalleryImages[0].Description" name="GalleryImages[0].Description"
class="form-control">
</div>
<input id="GalleryImages[0].ImageFile" type="file" class="form-control"
accept="image/jpeg, image/png, image/gif" name="GalleryImages[0].ImageFile"
style="display:none;">
</div>
</div>
</div>
</div>
<div class="form-group">
<input type="submit" value="Create" class="btn btn-primary">
</div>
<input name="__RequestVerificationToken" type="hidden" value="xxx">
</form>
When there's more than one image trying to be uploaded, only the first image shows up the in the Fiddler info. I can also upload that or anything else if it would be helpful. I tried to include everything though. Is there a better way to accomplish this? I'm thinking about trying to hook into imgur or something similar if I can't work this out.
You should use your input like this :
<input type="file" multiple="multiple" name="files" id="files" />
I don't know if you can use the type="image" here, but you can certainly use your controler to check if the user only uploaded images.
Or you may be able to add this parameter to the input.
accept="image/png, image/jpeg"

align dropdown and input with submit button in line

From bootstrap, it only have the combination of button with dropdown, if i want to have like this
how should i write in my view?
from my view
<div class="container">
<div class="row form-group">
<div class="input-group">
#Html.DropDownList("dateList", ViewData["dateList"] as IEnumerable<SelectListItem>, new { #id = "dateList", #class = "form-control" })
<input type="text" class="form-control" readonly="readonly" id="DCRDate" name="DCRDate" value="" />
<button id="submitBtn" type="submit" class="btn btn-default">Change</button>
</div>
</div>
</div>
i had this
with André Franciscato Paggi codes
with span the dropdownlist it become like
<div class="container">
<div class="row form-group">
<div class="input-group">
<span class="input-group-btn">
#Html.DropDownList("dateList", ViewData["dateList"] as IEnumerable<SelectListItem>, new { #id = "dateList", #class = "form-control" })
</span>
<input type="text" class="form-control" readonly="readonly" id="date" name="date" value="" />
<button id="submitBtn" type="submit" class="btn btn-default">Change</button>
</div>
</div>
</div>
You can surround the button and the select with a span tag each, using the class "input-group-btn".
Here is a snippet:
#myselect{
width: 80px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<span class="input-group-btn">
<select name="myselect" id="myselect" class="form-control">
<option selected>Foo</option>
<option>Bar</option>
</select>
</span>
<input type="text" class="form-control" readonly="readonly" id="DCRDate" name="DCRDate" value="Input here" />
<span class="input-group-btn">
<button id="submitBtn" type="submit" class="btn btn-default">Change</button>
</span>
</div>

Pass information of html/php form using c# webservice

My HTML/Bootstrap form is this one:
<form role="form" action="" method="post" class="login-form">
<div class="form-group">
<label class="sr-only" for="form-username">Email</label>
<input type="text" name="form-username" placeholder="Email....."
class="form-username form-control" id="form-email">
</div>
<div class="form-group">
<label class="sr-only" for="form-text">Type Order</label>
<input type="text" name="form-text" placeholder="Tipo Encomenda"
class="form-text form-control" id="form-text">
</div>
<div class="form-group">
<label class="sr-only" for="form-number">Number</label>
<input type="number" min="0" max="150" name="form-number"
placeholder="Numero Peças" class="form-number form-control"
id="form-number">
</div>
<div class="form-group">
<label class="sr-only" for="form-radio">Urgen</label>
<label class="radio-inline"><input type="radio" name="optradio">Urgente</label>
<label class="radio-inline"><input type="radio" name="optradio">Não
Urgente</label>
</div>
<button type="submit" class="btn btn-primary">Enviar</button>
</form>
And I want to send the results by c# webservice to a program that uses this method. I don't know if is possible directly or using a txt and after get the info.
This way
<form role="form" action="demo_form.asp" method="post" class="login-form">
<div class="form-group">
<label class="sr-only" for="form-username">Email</label>
<input type="text" name="form-username" placeholder="Email....."
class="form-username form-control" id="form-email">
</div>
.........
or
<form role="form" action="mytest.php " method="post" class="login-form">
or any web target youwant send the data by http post method
for a web service GetDetailsService.asmx/GetCustdet
<form role="form" action="mGetDetailsService.asmx/GetCustdet" method="post" class="login-form">
and you can see a sample here (is for ajax but the concept is similar) http://www.c-sharpcorner.com/UploadFile/0c1bb2/calling-web-service-in-html-page2/

Why I can't use JQuery input tag with double number that use . instead ,?

I am working on a C#/.NET web app that use JQuery to implement its view and I am finding some problems using double value into input tag.
For example I have the following code snippet into my view:
<div class="ui-field-contain">
<label for="Test">Test:</label>
<input type="number" runat="server" id="Test" name="Test" min="0" max="10" step=".1" value="#Model.test" />
</div>
The value containet into the #Model.test model object field is 2.3 (I see it using the debugger) but into my input tag appear nothing.
I think that the problem could be related to the fact that JQuery use the comma to separate integer and decimal and instead it I have the . symbol.
Can you help me to resolve this issue?
EDIT 1: This is my entire view
#model DataModel.Vulnerability.Vuln
#{
ViewBag.Title = "Edit";
Layout = "~/Views/Shared/MasterPageMobile.cshtml";
}
<h2 style="float: right;">Published: #(Model.Published.Value.ToShortDateString())</h2>
<h2>Vulnerabilità: #Model.CVE</h2>
<style>
.mytabVuln {
width: 20% !important; /* 14.2% for 5 tabs wide */
clear: none !important; /* Prevent line break caused by ui-block-a */
}
</style>
<div id="MyTabs" data-role="tabs">
<div data-role="navbar">
<ul>
<li class="mytabVuln">General</li>
<li class="mytabVuln">Systems</li>
<li class="mytabVuln">Fixes/Solutions/Mitigating</li>
<li class="mytabVuln">Change Logs/References</li>
<li class="mytabVuln">OVALs</li>
</ul>
</div>
<!-- TAB-0: INFORMAZIONI GENERALI: -->
<div id="tab-0" class="ui-body ui-body-a">
#using (Html.BeginForm("Edit", "Vulnerability", FormMethod.Post))
{
#Html.AntiForgeryToken()
#Html.ValidationSummary(false)
<input type="hidden" name="Id" value="#Model.Id" />
<div class="ui-field-contain">
<label for="Title">Title:</label>
<input type="text" id="Title" name="Title" value="#Model.Title" data-clear-btn="true" />
</div>
<div class="ui-field-contain">
<label for="Test">Severity:</label>
<input type="number" id="Test" name="Test" min="0" max="10" step=".1" value="#Model.test" />
</div>
<div class="ui-field-contain">
<label for="BugTraqID">BugTraqID:</label>
<input type="number" id="BugTraqID" name="Title" min="0" step="1" value="#Model.BugTraqID" />
</div>
<div class="ui-field-contain">
<label for="StatusID">StatusID:</label>
<input type="number" id="StatusID" name="Title" min="0" max="10" step="0.1" value="#Model.StatusID" />
</div>
<div class="ui-field-contain">
<label for="Remote">Remote:</label>
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<legend></legend>
<input name="Remote" id="radio-Remote-Yes" value="Yes" #(Model.Local == "Yes" ? "checked" : "") type="radio">
<label for="radio-Remote-Yes">Yes</label>
<input name="Remote" id="radio-Remote-No" value="No" #(Model.Local == "No" ? "checked" : "") type="radio">
<label for="radio-Remote-No">No</label>
<input name="Remote" id="radio-Remote-Null" value="NULL" #(Model.Local == "" ? "checked" : "") type="radio">
<label for="radio-Remote-Null">Null</label>
</fieldset>
</div>
<div class="ui-field-contain">
<label for="Local">Local:</label>
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<legend></legend>
<input name="Local" id="radio-Local-Yes" value="Yes" #(Model.Local == "Yes" ? "checked" : "") type="radio">
<label for="radio-Local-Yes">Yes</label>
<input name="Local" id="radio-Local-No" value="No" #(Model.Local == "No" ? "checked" : "") type="radio">
<label for="radio-Local-No">No</label>
<input name="Local" id="radio-Local-Null" value="NULL" #(Model.Local == "" ? "checked" : "") type="radio">
<label for="radio-Local-Null">Null</label>
</fieldset>
</div>
<div class="ui-field-contain">
<label for="Credibility">Credibility:</label>
<input type="text" id="Credibility" name="Credibility" value="#Model.Credibility" />
</div>
<div class="ui-field-contain">
<label for="Classification">Classification:</label>
<input type="text" id="Classification" name="Classification" value="#Model.Classification" />
</div>
<div class="ui-field-contain">
<label for="Availability">Availability:</label>
<input type="text" id="Availability" name="Availability" value="#Model.Availability" />
</div>
<div class="ui-field-contain">
<label for="Ease">Ease:</label>
<input type="text" id="Ease" name="Ease" value="#Model.Ease" />
</div>
<div class="ui-field-contain">
<label for="Authentication">Authentication:</label>
<input type="text" id="Authentication" name="Authentication" value="#Model.Authentication" />
</div>
<h3 class="ui-bar ui-bar-a ui-corner-all">CVSS2</h3>
<div class="ui-body ui-body-a ui-corner-all">
<div data-role="fieldcontain">
<label for="slider">CVSS2_BaseScore:</label>
<input type="range" name="slider" id="slider" min="0" max="10" step=".1" value="#String.Format(new System.Globalization.CultureInfo("en-GB"), "{0:N1}", Model.CVSS2_BaseScore)" />
</div>
<div class="ui-field-contain">
<label for="CVSS2_TemporalScore">CVSS2_TemporalScore:</label>
<input type="text" id="CVSS2_TemporalScore" name="CVSS2_TemporalScore" value="#Model.CVSS2_TemporalScore" />
</div>
<div class="ui-field-contain">
<label for="CVSS2_BaseVector">CVSS2_BaseVector:</label>
<input type="text" id="CVSS2_BaseVector" name="CVSS2_BaseVector" value="#Model.CVSS2_BaseVector" />
</div>
<div class="ui-field-contain">
<label for="CVSS2_TemporalVector">CVSS2_TemporalVector:</label>
<input type="text" id="CVSS2_TemporalVector" name="CVSS2_TemporalVector" value="#Model.CVSS2_TemporalVector" />
</div>
<div class="ui-field-contain">
<label for="CVSS1_BaseScore">CVSS1_BaseScore:</label>
<input type="text" id="CVSS1_BaseScore" name="CVSS1_BaseScore" value="#Model.CVSS1_BaseScore" />
</div>
<div class="ui-field-contain">
<label for="CVSS1_TemporalScore">CVSS1_TemporalScore:</label>
<input type="text" id="CVSS1_TemporalScore" name="CVSS1_TemporalScore" value="#Model.CVSS1_TemporalScore" />
</div>
</div>
<h3 class="ui-bar ui-bar-a ui-corner-all">NVD CVSS2</h3>
<div class="ui-field-contain">
<label for="NVD_CVSS2_BaseScore">NVD_CVSS2_BaseScore:</label>
<input type="text" id="NVD_CVSS2_BaseScore" name="NVD_CVSS2_BaseScore" value="#Model.NVD_CVSS2_BaseScore" />
</div>
<div class="ui-field-contain">
<label for="NVD_CVSS2_ComponentString">NVD_CVSS2_ComponentString:</label>
<input type="text" id="NVD_CVSS2_ComponentString" name="NVD_CVSS2_ComponentString" value="#Model.NVD_CVSS2_ComponentString" />
</div>
<div class="ui-field-contain">
<label for="ImpactRating">ImpactRating:</label>
<input type="number" id="ImpactRating" name="ImpactRating" min="0" max="10" step="0.1" value="#Model.ImpactRating" />
</div>
<div class="ui-field-contain">
<label for="EaseofExploit">EaseofExploit:</label>
<input type="number" id="EaseofExploit" name="EaseofExploit" min="0" max="10" step="1" value="#Model.EaseofExploit" />
</div>
<div class="ui-field-contain">
<label for="UrgencyRating">UrgencyRating:</label>
<input type="number" id="UrgencyRating" name="UrgencyRating" min="0" max="10" step="0.1" value="#Model.UrgencyRating" />
</div>
<div class="ui-field-contain">
<label for="LastChange">LastChange:</label>
<textarea data-clear-btn="true" name="LastChange" id="LastChange" data-mini="true" data-inline="true" required="required" data-value="#Model.LastChange" placeholder = "Inserire qui il LastChange" rows="5" cols="40">#Model.LastChange</textarea>
</div>
<div class="ui-field-contain">
<label for="ShortSummary">ShortSummary:</label>
<textarea data-clear-btn="true" name="ShortSummary" id="ShortSummary" data-mini="true" data-inline="true" data-role="true" required="required" data-value="#Model.ShortSummary" placeholder = "Inserire qui lo ShortSummary" rows="5" cols="40">#Model.ShortSummary</textarea>
</div>
<div class="ui-field-contain">
<label for="Impact">Impact:</label>
<textarea data-clear-btn="true" name="Impact" id="Impact" data-mini="true" data-inline="true" required="required" data-value="#Model.Impact" placeholder = "Inserire qui l'Impact" rows="5" cols="40">#Model.Impact</textarea>
</div>
<div class="ui-field-contain">
<label for="TechnicalDescription">TechnicalDescription:</label>
<textarea data-clear-btn="true" name="TechnicalDescription" id="TechnicalDescription" data-mini="true" data-inline="true" required="required" data-value="#Model.TechnicalDescription" placeholder = "Inserire qui la TechnicalDescription" rows="5" cols="40">#Model.TechnicalDescription</textarea>
</div>
<div class="ui-field-contain">
<label for="AttackScenario">AttackScenario:</label>
<textarea data-clear-btn="true" name="AttackScenario" id="AttackScenario" data-mini="true" data-inline="true" required="required" data-value="#Model.AttackScenario" placeholder = "Inserire qui l'AttackScenario" rows="5" cols="40">#Model.AttackScenario</textarea>
</div>
<div class="ui-field-contain">
<label for="Exploit">Exploit:</label>
<textarea data-clear-btn="true" name="Exploit" id="Exploit" data-mini="true" data-inline="true" required="required" data-value="#Model.Exploit" placeholder = "Inserire qui l'Exploit" rows="5" cols="40">#Model.Exploit</textarea>
</div>
<div class="ui-field-contain">
<label for="Credit">Credit:</label>
<textarea data-clear-btn="true" name="Credit" id="Credit" data-mini="true" data-inline="true" required="required" data-value="#Model.Credit" placeholder = "Inserire qui i Credit" rows="5" cols="40">#Model.Credit</textarea>
</div>
<div class="ui-field-contain">
<label for="URL">URL:</label>
<input type="url" id="URL" name="URL" value="#Model.URL" />
</div>
<div class="ui-field-contain">
<label for="AlertStatusId">AlertStatusId:</label>
<input type="number" id="AlertStatusId" name="AlertStatusId" min="0" max="10" step="1" value="#Model.AlertStatusId" />
</div>
<div class="ui-field-contain">
<label for="Type">Type:</label>
<input type="number" id="Type" name="AlertStatusId" min="0" step="1" value="#Model.Type" />
</div>
<div class="ui-field-contain">
<label for="DetailLevel">DetailLevel:</label>
<input type="number" id="DetailLevel" name="DetailLevel" min="-1" step="1" value="#Model.DetailLevel" />
</div>
<div class="ui-field-contain">
<label for="Language">Language:</label>
<input type="number" id="Language" name="Language" min="-1" step="1" value="#Model.Language" />
</div>
<div data-role="controlgrup" data-type="horizontal">
Annulla
<input type="submit" value="Salva" data-inline="true" data-mini="true" />
</div>
}
</div>
<!-- /tab-0 -->
Given the test that we did in the comments, the following should solve the problem:
#Html.TextBoxFor(mdl => mdl.test, new { #id="Test", #min="0", #max="10", #step="0.1" })

Categories

Resources