Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

I am using ASP.Net 8.0 MVC... ScenarioName property has a Required attribute in the Model.. When I use the following, clicking submit button with all of these elements wrapped inside the form tag ...
RyanO's user avatar
  • 51
0 votes
1 answer
45 views

I have a model for creating/editing items and the items can belong to a category. The category renders as a drop down so the user can choose a category, or fill in a new category via a textbox. The ...
andrewb's user avatar
  • 3,105
0 votes
1 answer
140 views

I have an MVC 5 web app, and an MVC Core web app, and I am using unobtrusive validation in both. When you use TextBoxFor and ValidationMessageFor for a required property, the 2 apps behave ...
J. Lee's user avatar
  • 183
0 votes
1 answer
85 views

Here I have three properties Like Public Class Addition{ public Int Val1{get;se;} public Int Val2{get;se;} public Int Val3{get;se;} } In .cshtml Val1=10;Val2=20; If User Entre Val3=30 Then How can i ...
user avatar
0 votes
2 answers
625 views

I'm using this code in mvc for email validation but after we typed @ of any text in textbox for example : abc@ after @ validation is not wokring and form is submit without validation error. if (!...
Zaheen's user avatar
  • 11
0 votes
1 answer
671 views

I'm pretty new in ASP.NET MVC. And I'm very sorry for this question. What my goal is: To add a validation using Html Helper of ASP.NET MVC on an enum ddl. Model public enum SampleEnum { Active ...
Josh's user avatar
  • 223
0 votes
1 answer
103 views

I have a class : public class Cust { [Required(ErrorMessage ="NameField Req")] public string Name { get; set; } } I use this class : public class CustModel { public IEnumerable<Cust&...
user avatar
0 votes
0 answers
503 views

I'm writing an ASP.NET Core web app. I'm using MVC's model validation framework, and I have a "form" model that contains a Product object and a IsCreationMode boolean. I want to validate the Product,...
Simone's user avatar
  • 1,376
2 votes
0 answers
77 views

I have looked at my code and endless examples and looked at other questions as well, but nothing I try works for me. I am trying to validate my view. The field border is red on submit but the error ...
user avatar
0 votes
1 answer
2k views

I'm generating some controls with the help of a for-each loop. I would like to validate the textbox depend on the answer of the dropdown. For some questions, validator should be enabled if the ...
kas_miyulu's user avatar
5 votes
0 answers
185 views

Cross-site scripting (XSS) patterns can be submitted. [HttpPost] [AllowAnonymous] [ValidateInput(false)] public async Task<string> Index(string Xml) => await Process(Xml); If i remove ...
Rahul's user avatar
  • 423
-1 votes
1 answer
128 views

I want to ensure that a user picks an answer to the question being asked. I have tried JQuery, Custom Validation class, setting model attributes to required. To summarise, if no radio button is ...
The OrangeGoblin's user avatar
1 vote
1 answer
651 views

I have a ASP.NET MVC5 project where I do some input validation over more then 1 field. When an error is found I add an error to the model via : ModelState.AddModelError("field", Resource.ErrorMessage)...
kahoona's user avatar
  • 185
0 votes
0 answers
239 views

I cannot find the right answer for my case, so I posted my question here. I'm validating the form in ASP.NET MVC and looking for the way to validate a text field to allow only numeric and decimal ...
gene's user avatar
  • 2,098
1 vote
1 answer
3k views

I'm using jquery (unobtrusive) validation for MVC, and I have a field that is not a part of my model, so I'd rather not add it JUST to give it some data annotations. And, all I need is to ensure that ...
Nathan Childers's user avatar
1 vote
0 answers
73 views

I want validate that a username doesn't contain spaces. I want use AZ-az-09 and _ character in my string and ingore another. I have a regex but it is no validating spaces. [RegularExpression("^([a-...
Muhammet Bozdağ's user avatar
3 votes
3 answers
5k views

I'm using the MVC Validation nuget package called MVC Foolproof Validation. I'm using it on my model to set a required to true if another model property was empty. The validation part works, as the ...
user48408's user avatar
  • 3,392
0 votes
1 answer
1k views

I want to add globalization because the site asks the user for a date. And my german user want to type "31.12.1966" and not "1966-12-31". So I add the nuget-Packages "jQuery.Validation.Globalize" and ...
PBum's user avatar
  • 133
3 votes
0 answers
336 views

I'm having to do some custom validation on a child viewmodel, adding any issues to the ModelState using ModelState.AddModelError(). However I'm presented with an issue trying to get the correct ...
Chris Pickford's user avatar
0 votes
0 answers
329 views

I have a partial view containing a user creation form. When I call that form within a main view using @Html.Partial("_CreateUser")and attempt to submit it empty, none of the Data annotation ...
LifeOf0sAnd1s's user avatar
-1 votes
1 answer
319 views

I've created a sample ASP.NET MVC Core 1.1 web app created using VS2015-Update3. It generates input tags with data -* attributes only on a model property that is a Primary Key, and on a property that ...
nam's user avatar
  • 24.3k
0 votes
0 answers
1k views

The input values can be any two digit numbers of the form 00, 01,...09,10,11,....19,20,...,99 etc. But following is not working. User can still enter abc and no client side validation occurs. Of ...
nam's user avatar
  • 24.3k
3 votes
2 answers
2k views

On one of the view model fields, I have set the min length in ASP.NET MVC Data Annotation attribute. [MinLength(5, ErrorMessage = "A minimum of 5 digits is required")] Based on a dropdown selection(...
Sumesh Kuttan's user avatar
0 votes
1 answer
107 views

I build form to create custom WebForms master pages. I need to validate with regular expression if custom text, that will be placed inside master page, does not contain <% and %> tags and any ...
Mikołaj Trawiński's user avatar
1 vote
1 answer
4k views

So I have checked out this answer ASP:NET MVC 4 dynamic validation of a property depending of the current value of another property and it does not cover the issue I am having. I am using server side ...
Michael Coxon's user avatar
0 votes
0 answers
59 views

I have the following view models public class Step4ViewModel { [Required(ErrorMessage="Yes/No Required")] public bool? HaveVehicles { get; set; } public List<Vehicle> Vehicles { get; set; ...
CodeMonkey's user avatar
0 votes
1 answer
119 views

I built a custom validation rule for one particular field on my MVC 5 app. It works great on the edit form, but when validating that same field on the "create' form, the client side validation does ...
BattlFrog's user avatar
  • 3,427
0 votes
1 answer
263 views

I am using MVC ViewModel. There are two radio buttons with yes or no in a form. If the user selects 'Yes' TextField1 will be displayed and if select 'No' TextField2 will be displayed. Both are ...
VVR147493's user avatar
  • 251
1 vote
1 answer
1k views

I'm working on a large form that I'm looking to improve the usability of by sectioning it into a jQuery form wizard (jQuery tabbed panels). I have already implemented both client-side validation and ...
user2488275's user avatar
0 votes
0 answers
120 views

I have: public class Test { [Required] public string Name { get; set; } [Required] public bool Is1 { get; set; } [RequiredIfTrue("Is1")] public string Name2 { get; set; } ...
Dmitry's user avatar
  • 477
0 votes
0 answers
107 views

basically i am showing checkboxes in page and checkboxes generated in loop. i have create a custom validation using this ValidationAttribute, IClientValidatable my server side validation working fine ...
Mou's user avatar
  • 16.5k
0 votes
0 answers
327 views

i am showing many check boxes in loop and i want when user submit form then user has to select at least one checkbox. if no check box is selected then validation message will show at client side and ...
Mou's user avatar
  • 16.5k
0 votes
0 answers
810 views

I'm trying to get the example shown here to work within my project. My code currently looks like: <!-- jQuery.validate --> @Scripts.Render("~/Bundles/jQueryVal") <script type="text/...
KingKerosin's user avatar
  • 3,881
1 vote
1 answer
671 views

My model does not really represent what my form is posting. Example my Orgs Model which holds orgs helps me generate a treeview the users selects several nodes of the orgs tree and submits a form. The ...
BilalHamdan's user avatar
0 votes
0 answers
77 views

Model: public class Employee { public string Id { get; set; } [StringLength(10, MinimumLength = 5)] [Required] public string Name { get; set; } public ...
Khaja Moinuddin's user avatar
1 vote
1 answer
2k views

In an asp.net MVC application, I have the following property: ... public System.DateTime StartTime { get; set; } ... And, in a view (in a form): <div class="form-group"> @Html.LabelFor(...
Tom's user avatar
  • 4,107
2 votes
1 answer
3k views

I have created a custom group validator that ensure that the user has filled in at least one field from a given group. This works when I load the page and submit the form without entering anything. ...
CodeMonkey's user avatar
0 votes
1 answer
62 views

I am creating a selection screen, let say there are two fields "Start Date" and "End Date" and a "Search" button. I created custom attribute for validating the date fields such that it must fall ...
Steven Yeung's user avatar
1 vote
0 answers
530 views

I'm trying to build a demo application for gain Asp.Net Mvc 5 development experience. In these days i'm trying to build a site settings. I've a model named Settings. And there are properties like ...
Taşyürek Gökşah's user avatar
0 votes
1 answer
980 views

I am working on a multi lingual website using Umbraco 7.2.4 (.NET MVC 4.5). I have pages for each language nested under home nodes with their own culture: Home (language selection) nl-BE some page ...
drn's user avatar
  • 1
0 votes
2 answers
103 views

I'm trying to create different redirection in my Login Action Result in the sense that if a user logs in and is in a Role redirect to a specific view E.g. If a receptionist logs in redirect to `...
Ife Ologbese's user avatar
0 votes
0 answers
1k views

I have a asp.net MVC/Razor project. One of the views has a series of dropdowns. When you select an option from the dropdown, javascript code checks to see if the option has already been selected by ...
boilers222's user avatar
  • 2,019
5 votes
1 answer
1k views

I'm trying to put login and register form into same view. I did everything suggested in other questions but my problem still not fixed. Here is my parent view authentication.cshtml: @model Eriene....
Burak Dobur's user avatar
0 votes
1 answer
566 views

I'm having a terrible time adding a date to a view. I want the user to be able to type in a date like 6/30/15 or 6/30/2015, but the validation keeps failing if I use the 2 digit date. I've tried to "...
boilers222's user avatar
  • 2,019
0 votes
1 answer
1k views

I have a mobile version of a website that has multiple "pages". These five pages are all in one view made up of divs that are hidden/shown as they progress from one to another. So when you first ...
boilers222's user avatar
  • 2,019
0 votes
4 answers
800 views

I have three textboxes and i need to check if one of field is not enter and display error(just one error). Is this possible with MVC validation or i need javascript validation? @Html.TextBoxFor(m =&...
None's user avatar
  • 9,329
1 vote
2 answers
65 views

I have the following two properties in my model: [Display(ResourceType = typeof(WideFormatStrings), Name = "labelDynamicWidth")] public int? SelectedDynamicWidth { get; set; } ...
Mortalus's user avatar
  • 10.7k
0 votes
1 answer
810 views

I am coding a MVC 5 internet application, and have a question in regards to validating a integer value in a view. I have a model with the following variable: public int integerValue { get; set; } If ...
Simon's user avatar
  • 8,401
2 votes
2 answers
810 views

I have the following ViewModel: public class InvitationViewModel { public int id { get; set; } public string InvitationName { get; set; } public string Type { get; set; } public ...
Chris's user avatar
  • 295
0 votes
1 answer
2k views

I am coding an MVC 5 internet application and I have a question in regards to validation on a field in a view model. Here is my view model field: [Display(Name = "Latitude")] [Required(ErrorMessage =...
Simon's user avatar
  • 8,401