mvc

asp.net MVC ModelState.IsValid returning false

Hi, I am working in an ASP.NET MVC Application. I have a view model as follows: public class SampleInterestViewModel { //Properties defined //One such property that shows an error in ModelState is as follows public DateTime? SampleDate {get;set;} } From UI Perspective user can enter date as mmddyyyy. And when user enters in su...

Can I use TempData with Response.Redirect?

I am working with ASP.net MVC 2 framework, for multiple sites. We have a base site and then sub sites that inherit from a "Core" site that contains 90% of the functionality that the sub sites will use. In one of the controllers, I am saving some data, adding a UI message to the tempData and then using Response.Redirect. The redirect w...

Retrieve Domain Name instead of IP

All, I am using the following command to retrieve the domain name of my server. $_SERVER['HTTP_HOST'] This seems to return the IP address instead of domain name like www.example.com. I looked at PHPInfo and it also lists an IP address for HTTP_HOST instead of Domain name. What do I need to change to make the domain name appear instea...

Spark view engine and ASP.NET MVC 2 strongly Typed Html Helpers

Hi. I try to use HtmlHelper.TextBoxFor with spark view engine but view crashed with exception "Dynamic view compilation failed. 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'TextBoxFor' and no extension method 'TextBoxFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a u...

asp.net mvc Upload File ajax

Hi ive got an mvc form with a fileupload functionality. Ive got an action that accepts an file and extracts thumbnails from it, after which the user can select the images and then proceed to submit the form. How can post the initial file via ajax, bearing in mind, this is not the final submission on the form and I want to retain user inp...

Masking/Hiding URL for ASP.net web application

Hi, I am working in an ASP.NET mvc application. With regards to URL's I could see the Controller and action names in the address bar when user navigates between pages. Is there a way to hide them, such that the address bar always displays http://mywebsite.com without any action names or controller names suffixing them, or is there any ot...

Zend Framework-Do images, mp3s, scripts, etc, just go in public folder?

I guess these are all questions that everyone must just know, because I'm not seeing this in the documentation :-D I understand that the public folder is the folder that the world has access to. I know it is the case with the css folder, but in migrating a traditional php website over, will my /images folder, /js folder /mp3s, etc W...

How can I use MVC ideas without using classes?

As of right now, I am still shaky on classes, so I don't want to use any classes for my site. I'm still practicing with classes. But how can I implement the MVC idea without classes? Would this work for a MVC? index.php (the view) index_controller.php index_model.php Is this right for what a MVC should be? Vie...

Quick question regarding MVC framework for a java game

I have a question regarding the use of the MVC framework for a blackjack game im writing in java. As I understand, my model would be a class that stores the state of the game, and more specifically, each players hand. Within the model class, I would have an array of listeners, which would be notified each time the game state changes (ie ...

PHP: tips/resources/patterns for learning to implement a basic ORM

I've seen various MVC frameworks as well as standalone ORM frameworks for PHP, as well as other ORM questions here; however, most of the questions ask for existing frameworks to get started with, which is not what I'm looking for. (I have also read this SO question but I'm not sure what to make of it, and the answers are vague.) Instead...

textbox which accepts only alphabets using jquery mask

Hi All, i am having the textbox which needs to accepts only alphabets i tried with jquery mask but its only for numeric i can able to do , but needs to enter only alphabets in a textbox can anyone help me in this regard. ...

How to send dropdown selected value to asp.net mvc controller

How can i use dropdown selected value to asp.net mvc controller for filling another dropdown ...

how to encrypt password in asp.net mvc

how can i encrypt password field in asp.net mvc to be store in encrypted form ...

how to create treeview having checkboxes in asp.net mvc

how to create treeview having checkboxes in asp.net mvc ...

In MVC framworks (such as Ruby on Rails), does usually Model spell as singular and controller and view spell as plural?

I usually see Ruby on Rails books using script/generate model Story name:string link:string which is a singular Story, while when it is controller script/generate controller Stories index then the Story now is Stories, which is plural. Is this a standard on Ruby on Rails? Is it true in other MVC frameworks too, like CakePHP, Symf...

Nowadays, which MVC frameworks (such as Ruby on Rails) are widely in use and also very cool?

Seems like more companies are using Ruby on Rails nowadays. What are some other frameworks that are commonly in use nowadays and some that make you go "wow, this is cool"? ...

Rails- Using a set of functions across the view , controller and model

Hi folks, i have a function that converts an array to a hash which i would like to use across all the model, controller and view files in the rails app. Does this violate some core design principle, or am i missing something really obvious? UPDATE: This is actually a software engineering question. I want to understand why some "conveni...

asp.net mvc Jquery client side validation

Hello, I have a strange problem. while MicrosoftMvcValidation works in my mvc project, MicrosoftMvcJQueryValidation doesn't. this is my code: <script src="../../Scripts/MicrosoftMvcJQueryValidation.js" type="text/javascript"></script> <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script> <% Html.En...

MVC Html Layout C# code formatting

I insert into asp.net mvc views C# logic that manages layout like the following: <% if (Model.People.Count > 0 ) { %> <% foreach (var person in Model.People) { %> ... <% }} else { %> <span class="error">Sorry, no people</span> <%} %> I try to minimize <% %> code placing "{" symbol on the same line as it's condition (...

Reasons not to use MVC architecture for web application

In the past I have primarily built all my web applications using an N-tier architecture, implementing the BLL and DAL layers. Recently, I have started doing some RoR development as well as looking into ASP.NET MVC. I understand the differences between the different architectures(as referenced by some other SO posts), but I can't really ...