asp.net-mvc

unit-tests and captain obvious (ASP.NET MVC)

Hello Recently I've started to write on asp.net mvc framework. I have a problem. I can't understand meaning of the unit tests. Let's see on example public class HomeController : Controller { public ActionResult Index() { ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View(); } public Act...

Pagination In MVC

Possible Duplicate: How do I do pagination in ASP.NET MVC? Hii, I want to add pagination to my view . i am getting data from model as a list of users in the controller . and in view i am displaying that from Model by inheriting IEnumarable..now How can i inherit IPagelist overhere? can anyone help me?? ...

value of input not posted

<script type="text/javascript" language="javascript"> $(function() { $("#distributor").autocomplete({ source: function(request, response) { $.ajax({ url: "/Devices/autoDistributor", type: "POST", dataType: "json", data: { name: request.term, maxResults: 10 }, ...

Resizing images on the fly, or storing different sizes on disk?

I'm building a Web application that will eventually contain a lot of images. These images will need to be displayed in different formats across the site. What would be the pros/cons of the two solutions: Storing various versions of the picture when they are uploaded (e.g. thumb, small, medium, large, verylarge) Resizing the image throu...

How to enable/disable Html helper on MVC view

I'm starting to play around with MVC. I did the NerdDinner walkthrough and now I'm creating a simple project that displays the products in the Northwinds database. I have a details view, a create view, and an edit view. I figured out how to display a checkbox for the boolean property, "Discontinued", but I want the control to be disabled...

Can I add a unique id attribute to a td from jquery?

I have a table being populated and I would like the td id to be the id number for the data that was returned. How do I assign an id to a td from jquery? var $tr = $('<tr><td class="name"></td></tr>').insertAfter('#newTable tr:last'); $tr.find('.name').html(data.Name); //How do I assign data.id to <td class="name"> ? ...

Ninject Asp.net mvc 2 404 errors?

When I debug my asp.net mvc 2 application and I put a break point on my action that is called when a 404 error occurs every time I invoke any action my error action gets called but the view does not get displayed. This is in my web.config (copied from nerddinner): <customErrors mode="RemoteOnly" defaultRedirect="/Home/Trouble"> <err...

asp.net-mvc advice on when to break up one view into multiple views

Hi, I am designing the "Create" functionality for a pretty complex order object. In the process of creating an order, the user will have to select a receiver (via a person search), select items for the order (again, via an item lookup), and enter other details about the order. The original idea for designing this is to have several '...

jQuery + Ajax + Loading Spinner Image = Too Fast!

I'm using jQuery in my ASP.NET MVC 2 page. It's a super simple post that gets a date in return. The process itself runs very quickly. I want to use a spinner image to show the user something is going on. All works fine in Firefox, testing locally. However, in IE 8, the spinner image doesn't display long enough; it just flickers. Th...

Any more ASP.NET MVC Frameworks like SharpArchitecture around?

Are there more ready-to-use MVC frameworks like SharpArchitecture? For the small to medium projects I will be working on, SharpArch looks like an overkill to me. Plus I'm not yet very familiar with Domain Drive Development (but that is one thing I want to read about as soon as my time permits, it definitively sounds interesting) Please ...

How to use Html.CheckBox (list) with IEnumerable<T> with validation

Im working on a page where the user needs to fill in some information and finally make a selection of 1 or more customers with checkboxes. The list of customers is an IEnumerable<Customer> which i pass into my Model. Im a bit puzzled how i would go about creating the list of checkboxes using .CheckBoxFor(). And finally i would like to...

How to deploy SQL CE 4 CTP to shared hosting?

How do I deploy SQL CE 4.0 with EF4 to a shared hosting provider for ASP.NET MVC 2.0? I've included System.Data.SqlServerCe.dll, and the amd64 + x86 directories in my bin folder, but keep getting a ".net provider not found". I realize it's currently in CTP, but this is just for testing purposes. My project + host is configured for .net ...

asp.net mvc migration , forms authentication issue

Hi I migrated my asp.net web form application to asp.net mvc. ie contains both .aspx page and mvc views. I'm using Forms authentication and not getting the Forms authentication staus in asp.net mvc view. ie. In Login status, getting Request.IsAuthenticated true in asp.net form page and getting false in mvc view. ...

Custom validation that checks if email already exists in DB. HELP!

Hi, I'm new to .net MVC but am making heads way. I'm trying to make a custom DataAnnotation validator that checks to see if an email address is already registered. I am using LINQ to SQL. My Model is below: // Model public class UsersRepository { private DigitalentDataContext db = new DigitalentDataContext(); BaseController base...

How can I do "causesvalidation=false" in ASP.NET MVC 2?

I have two buttons on a single form. One is used to submit the form while the other is used to search. I do not want the search button to trigger any server side or client side validation. How can I do this? Thanks. Edit I'm using Data Annotations on the server to validate, example: [Required(ErrorMessage = "Institution is req...

How to get "return url" in Janrain RPX

How to get the previous url using the Janrain RPX login? I´m using Asp.Net MVC to request. ...

ASP.NET MVC One Form, Two Buttons

I have a simple form based off a model called Visitor. I'd like to have a search button by one of the id text fields so the user can click the button and have the page populate with visitor information: first name, last name, etc. In Web Forms I would do something like this: page_load(){ person = businessManager.FindPersonById(Con...

When combining asp.net Dynamic Data and MVC MetaModel.Visible contains tables with Scaffold==false

I combined MVC and DD by creating a new DD project and adding the MVC stuff (references, routing, usings, etc). The list of tables on default.aspx (from DD) will show all tables, including the ones with [ScaffoldTable(false)]. The URL's of the tables with Scaffold==true have the expected form (DD/TableName/List.aspx). However, the URL's...

Detect Session Timeouts / Distinguish Between First Visit & Session Timeout

When a user goes to the sign in page, I want to detect if their session timed out and was redirected to this page, so a friendly message could be displayed. I set isTimeout = true when the session is a new session and when the cookie["ASP.NET_SessionId"] is not null. But isTimeout was set to true when if it was a first visit too. How do...

Silverlight Host App only showing loading image

Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application I attempted to view it using the MVC host application (using the provided aspx and html pages). The issue is that when I view the page all I see is the Loading image (with a 100% value) and that is all. It never displays my app! Here is...