tagged [model]

How to set a hidden value in Razor

How to set a hidden value in Razor I know that what I'm trying to do is bad idea, but I have specific constrains for now. I have multiple sites, using one and the same MVC3 code base. For one of them ...

At a high level, how does struts2 work? I'm coming from a mvc background

At a high level, how does struts2 work? I'm coming from a mvc background At a high level, how does struts2 work? I'm coming from a mvc background Looking at a sample project, I see allot of these ___a...

19 Jul at 14:13

How do the MVC html helpers use expressions to get an objects property

How do the MVC html helpers use expressions to get an objects property For example: If I were to get an expression like this as a method argument, how would I get the referenced property from the expr...

Avoid hard-coding controller and action names

Avoid hard-coding controller and action names ASP.NET MVC seems to be encouraging me to use hard-coded strings to refer to controllers and actions. For example, in a controller: or, in a view: I don't...

Which datatype of C# is equivalent to money in SQL Server?

Which datatype of C# is equivalent to money in SQL Server? I am working on a project in ASP.NET MVC. I started in the middle of the project and so I got stuck in this. The data type of a column in SQL...

21 Jul at 07:8

Import Ms Access Data by programmming

Import Ms Access Data by programmming I am in search of an good approach to import data from ms access and bind it to any Model of an MVC pattern --- Here is the approach which we are thinking to foll...

using mvc route constraints so a url can only be mapped to one of three possible params

using mvc route constraints so a url can only be mapped to one of three possible params Here is my route: I would like to add a constraint so the category can only match a null or one of three params ...

Accessing MVC's model property from Javascript

Accessing MVC's model property from Javascript I have the following model which is wrapped in my view model How do I access

Strip off specific parameter from URL's querystring

Strip off specific parameter from URL's querystring I have some links in a Powerpoint presentation, and for some reason, when those links get clicked, it adds a return parameter to the URL. Well, that...

Entity framework: StoreGeneratedPattern="Computed" property

Entity framework: StoreGeneratedPattern="Computed" property I have a `DateTime` property. I need this property's default value to be `DateTime.Now`. And then I found out that you can specify an attrib...

Email model validation with DataAnnotations and DataType

Email model validation with DataAnnotations and DataType I have following model: Required validation works fine. But when i try with DataType it doesn't r

7 Feb at 18:21

MVC Validation Lower/Higher than other value

MVC Validation Lower/Higher than other value How is the best way to validate a model in MVC.Net where I want to accept a minimum/maximum. Not individual min/max values for a field. But separate fields...

Controller folders and the new Autoloader in Zend Framework

Controller folders and the new Autoloader in Zend Framework After introduction of Autoloader, I started to port existing ZF app. The immediate error was that IndexController was extended by BaseContro...

How to suppress "An application is requesting access to a protected item" popup

How to suppress "An application is requesting access to a protected item" popup I'm getting a pop-up when trying to use a certificate to decrypt data. I'm creating a self-signed certificate, and I'm u...

ios networking code in the model?

ios networking code in the model? I recently watched the 'Network Apps for the iPhone OS' videos for WWDC 2010 in iTunes U and the speaker said that the best place to write your networking code is in ...

How to update() a single model instance retrieved by get() on Django ORM?

How to update() a single model instance retrieved by get() on Django ORM? I have a function which currently calls `Models.object.get()`, which returns either 0 or 1 model objects: - `except DoesNotExi...

14 Oct at 00:54

Session data not persisting

Session data not persisting Session data is not persisting between requests. This only seems to happen when using session data from a 'non-default' area from within an MVC application. The application...

Regex for check the input string is just in persian language

Regex for check the input string is just in persian language I work with MVC and I am new on it. I want to check input values is only in Persian language (Characters) by `[RegularExpression]` Validati...

RequiredIf Conditional Validation for two variables in MVC4

RequiredIf Conditional Validation for two variables in MVC4 I have a model class that is following In which I want to use the RequiredIf condition for the Holiday field using the both Saturday and Sun...

How to pass parameters to a partial view in ASP.NET MVC?

How to pass parameters to a partial view in ASP.NET MVC? Suppose that I have this partial view: which is accessible through a child only action like: And I want to use this partial view inside another...

What is the meaning of the "Pluralize or singularize generated object names" setting?

What is the meaning of the "Pluralize or singularize generated object names" setting? When setting up a new Entity data Model, there is an option to > [x] Pluralize or singularize generated object nam...

Looking for clean WinForms MVC tutorial for C#

Looking for clean WinForms MVC tutorial for C# How to create a rich user interface Windows application, example Photo Shop. I am looking for clean MVC tutorial for WinForms with C# somewhere. ( ASP.NE...

Does model binding work via query string in asp.net mvc

Does model binding work via query string in asp.net mvc Does model binding work via query string as well ? If I have a get request like : Would the following method in CountryController have its oCoun...

Some files in "wwwroot" folder are not published in ASP.NET Core web deploy

Some files in "wwwroot" folder are not published in ASP.NET Core web deploy I am using ASP.NET Core 2.0 in Visual Studio 2017. My site works fine when I hit debug in [IIS Express](https://en.wikipedia...

Should I use an int or a long for the primary key in an entity framework model

Should I use an int or a long for the primary key in an entity framework model I am writing an MVC5 Internet application and I have a question about the id field for a model. Should I use an int or a ...