validationRules = [{rule : "length > 20", error: "Error"}]
textField.on("change", (element) => {
foreach(var rule in validationRules){
if (!element.Valid(rule.rule)){
element.Errors.Push(rule.Error);
}
}
})
class Calc{
public float Result;
public Calc Add(float a){
Result += a;
return this;
}
public float GetResult() {
return Result;
}
}
var a = new Calc().Add(2).Add(5).Minus(4).GetResult();
@{
ViewBag.Title = "Upload";
}
<h3>Выберите файл для загрузки</h3>
@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new {enctype="multipart/form-data"}))
{
<input type="file" name="upload" /><br>
<input type="submit" value="Загрузить" />
}