I have a DropDownList populated with countries.
When the user picks US I need to show dropdown with US states. If user picks CA - show dropdown with CA provinces...else show a TextBox. Depending on the country picked I hide/show using jQuery. That works ok. The problem is in the ActionResult when user submits.
Html.DropDownList("S...
This is more of an opinion seeking question, so there may not be a "right" answer, but I would welcome arguments as to why your answer is the "right" one.
Given an MVC application that is using Entity Framework for the persistence engine, a repository layer, a service layer that basically defers to the repository, and a delete method on...
Here is my problem. I have a list of models that are displayed to the user. On the left is a checkbox for each model to indicate that the user wants to choose this model (in this case, we're building products a user can add to their shopping cart). The model has no concept of being chosen...it strictly has information about the product i...
Hi
I’m trying to do some validation in asp .net MVC 2.0 for my application. I want to have some nice client side validation. Validation should be done most time on model side with DataAnnotations with custom attributes( like CompareTo, StringLenght, MinPasswordLenght (from Membership.MinimumumpassworkdLenght value).
For that purpose I t...
Hi all,
I've been told that MVC 1.0 TempData does not work under a load balancer when using SQL Server and that it is because the Dictionary itself is not serializable.
We require this for a project and are looking to be able load balancer effectively.
So I would be very grateful if someone could answer the following questions:
Is the...
I'm working on a web application. One of my co-workers has written some asp.net forms pages. The page classes all inherit from BasePageClass, which of course inherits from the Page class. I wish to add some MVC controllers that I've been told need to use the same logic implemented in the BasePageClass. Ordinarily, I would want to inh...
I use jquery to post to an MVC controller action that returns a table of information. The user of the page triggers this by clicking on various links.
In the event the user decides to click a bunch of these links in quick succession I wanted to cancel any previous ajax request that may not have finished.
I've found that when I do this...
When I populate a DropDownList with data in the View .aspx my validation styles are applied when I submit without selecting from Country DropDownList.
In my web model I have this:
[DisplayName("Country")]
[Required(AllowEmptyStrings = false, ErrorMessageResourceName = "ListingPost_FK_Country_CodeRequired", ErrorMessageResourceType = t...
So I only want the count of the results not the results themselves therefore I am using count in hql. So, below is the query
(int) Session.CreateQuery("select count(*) from TableName where Lhs=Rhs").UniqueResult();
But it is giving me the error Specified cast is not valid..
So, can any body tell me how to cast the count to int.
An...
I have an ASP.Net-MVC application that is mostly complete. However, I have one page that contains radio buttons. When that page is displayed in Firefox or Chrome, the radio buttons are displayed in a horizontal row (which is what I want). But when the page loads in IE, the radio buttons show up in a column. I am using the Html.RadioButto...
I have a textbox in my View. I input a number into the textbox, and then i want the controller to multiply the number and put the result into the textbox.
How can I do that?
This is what i have done already.
Let's start with the View:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html PUBLIC ...
I am stuck with redirecting problem in ASP.NET MVC project. I have mapped tables via LINQtoSQL and each has unique ID as primary key.
I am implementing functionallity of 'CREATE'. Basically, after new value is added into SQL table (which means I pressed Save button), I want to be redirected to Details of this freshly added item.
Here's...
I am using Model binding with the Entity Framework and have an Html.TextBoxFor(model =>model.date) input. I know how to tell jQuery how to implement a datepicker but not in this context. What would I need to add here to have a calendar popup when the user enters this field?
...
This is a really strange behavior, and I've set up some demo code to try to figure out what's going on.
Basically have a a two actions and a single view. The first action sends an empty model to the view, the section action recieves the model, alters its contents and sends it back to the same view.
The wierdness is, in the view, the Mo...
How do you get client side validation on two properties such as the classic password confirm password scenario.
I'm using a metadata class based on EF mapping to my DB table, heres the code.
The commented out attributes on my class will get me server side validation but not client side.
[MetadataType(typeof(MemberMD))]
public partial ...
I'm using Crystal Reports in a Webform inside of an MVC application. Images in the reports are not being displayed, however, on both the ASP.NET Development Server and IIS 7 (on Win7x64).
I know from a number of other questions similar to this that the CrystalImageHandler HTTP Handler is responsible for rendering the image, but I've tr...
While I do not see any functionally or jquery UI elements affected by this, but when I access my asp.net mvc web page the chrome developer console is logged with a bunch of error messages like so:
Resource interpreted as image but transferred with MIME type application/octet-stream.
All of the warnings are for jquery UI images (tho...
I have a resource
/system/resource
And I wish to ask the system a boolean question about the resource that can't
be answered by processing on the client (i.e I can't just GET the resource
and look through the actual resource data - it requires some processing
on the backend using data not available to the client). eg
/system/reso...
Short verion: need ViewUserControl (i.e., Login Form) to post to self and be able to redirect (i.e., on successful login), or return original View (i.e., Home/Index) with validation summary and not interfere with other ViewUserControls on the page.
Also, HomeController/Index should have minimal knowledge of Login Form's inner workings. ...
Hi Experts,
I am working on a website in asp.net mvc. I have to show a view where user put some search values like tags and titles to search. I want to use the same Index method for that. I have
make my form to use formMethod.Get to send the parameters as querystring.
so here is the method
[HttpGet]
public ActionResult Index(...