asp.net-mvc

Cookie problem when deploying mvc app.

Hi, I have an ASP.NET MVC 1.0 app and am setting a cookie to hold data. It works fine when test in IE with VS2008. When I deploy to IIS6 site no cookie is created. Site uses HTTPS. I am checking Temporary Internet Files folder for the cookie. Any ideas of things to check? Malcolm ...

LINQ to SQL Basic question - table relationships

I'm playing with an image gallery in ASP.NET MVC, and trying to get my head around LINQ to SQL at the same time. I have 3 tables to hold image gallery data, with a many-many relationship through a link table. These are : Gallery (Id, Name, Description) Image (Id, Title, Description, FileName) GalleryImage (Galle...

Request.Params Request.Form not working in Internet explorer

hello i am facing this stupid issue with no help any where. i am facing it in every form in my mvc2 project. This is a input <input type="image" src="<%=Url.Content("~/images/shopping-cart.jpg")%>" alt="shopping cart" id="btnshoppingCart" name="btnshoppingCart" value="shoppingCart" /> when i browse the page with firefox and click on ...

ASP.NET MVC Ajax Actions results enveloping

Hello, I would like to have every result of any AJAX call on ASP.NET MVC to be enveloped to a JSON object which should be like: AjaxResult { status, data } where status will contain a enumeration value describing if the call was successful, erroneous, authentication expired etc. This will enable client side code to be able to redir...

post data with jQuery and redirect to another action

View: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Index</h2> <script type="text/javascript"> $(document).ready(function() { $(document).ready(function() { $("#example").submit(function() { var id = $("#id").val(); var prezime = $("#prezime").val(); $.post("/j...

AJAX with Jquery in ASP.MVC2

I'd like to get something via Ajax and put it into What i have to return from Controler Action to put this into that DIV? Right now i had standard ASP.MVC view as result... public ActrionResult MyAction() { return View(); } and in javascript i have: $.get(<url to controler action>, null, function(data) { $(#result).html(data); }...

Passing messages to the user in MVC2

I am using ASP.NET MVC2 for my project. I want to send the user confirmation messages after actions. Ideally: User clicks on a link with a query string (i.e. a link to delete an entry) The controller does what the link says, creates the success message, and uses RedirectToAction to get rid of the query string from the URL. The new actio...

MVC 2 ModelState - Show all Errors

My asp.net form is throwing errors relating to an incorrect model, but on the page it's not showing me what model field threw the error. I'd like to Debug.WriteLine all errors in the ModelState but am unsure how to go about it. Any ideas? ...

How do I make only one property of a model to be updated

My viewmodel has a property called Recipient. That has a Property called MobileNumber I'm trying this in MVC 2: UpdateModel(viewmodel, new[] { "Recipient_MobileNumber" }); // I expected this to work I also tried "Recipient.MobileNumber" ...

Error with View outside Views folder

I'm trying to add a View to an arbitrary folder in my MVC project (~/SomeOtherViewDirectory). This works fine until I modify the View to use be strongly typed. Ie, if the page inherits from System.Web.Mvc.ViewPage, it compiles and runs fine, but if it inherits from System.Web.Mvc.ViewPage it does not. When I turn page compilation on...

Commenting a ASP.NET MVC Controller

I am a big fan of Stylecop and I always follow it guidelines. I also follow the guideline that state that a comment should bring added value to the code and not repeat what the code is doing. I'm having a bit of trouble following the commenting guidelines concerning an ASP.NET MVC Controller and its related actions: I can't think about ...

JQuery $.getJSON runs the first time, then never again

I have a button click function that is to run a $.getJSON when the button is clicked. It gets some values from a controller posts those to some form fields and opens a modal that contains the form. The first time I click the button it runs the $.getJSON posts the values and opens the modal just fine. when i close the modal and click th...

Why wont my custom role provider update the roles when I change the database?

I am building a small CMS system with ASP.NET MVC and I have a custom role provider using a userRepository instantiated by a factory implemented using Castle Windsor. Someone with admin privileges can change the roles of a user, saved in a database, using the back-end administration. But whenever I log onto the user for whom I just c...

MVC 2.0 Routing Issue - Url parameter not recognized

In my AccountController class I have the following: public ActionResult Verification(string userGuid) { Debug.WriteLine(userGuid); ... In my global.asax I have: routes.MapRoute( "AccountVerification", "{controller}/{action}/{userGuid}", new { controller = "Account", action = "Verification", userGuid = UrlParameter....

Ninject and repository pattern with interfaces

This is the interfaces/class structure I have now: BaseContentObject abstract class public abstract class BaseContentObject : IEquatable<BaseContentObject> { ... } Page concrete class public class Page : BaseContentObject { ... } Repository interface public interface IContentRepository<T> { // common methods for all c...

ASP.NET MVC 2 website doesn't seem to be picking up code changes

I've just deployed my first ASP.NET MVC 2 site, and all appears to be well except I've run into an issue with IIS banning double-escaped characters, which I was relying on for a few routes. As I don't have control over IIS (it's on a shared host) I've decided to go around the issue and replace the spaces with underscores in my URLs. Hav...

Showing both MVC Ajax calls and jQuery Ajax calls with one indicator

Hi All, I have a web application that utilises both the MVC Ajax calls: Html.ActionLink() rendering as Sys.Mvc.AsyncForm.handleClick( in the page source and: jQuery Ajax calls, eg: $.post() Now I can easily set a generic Ajax indicator to show and hide when the jQuery is making an Async call using: $('#indicatorId').ajaxStart(fu...

How to pass ObjectId from MongoDB in MVC.net

I'm starting a new project with Mongo, NoRM and MVC .Net. Before I was using FluentNHibernate so my IDs were integer, now my IDs are ObjectId. So when I have an Edit link my URL looks like this : WebSite/Admin/Edit/23,111,160,3,240,200,191,56,25,0,0,0 And it does not bind automaticly to my controller as an ObjectId Do you have any ...

How to re-input an AJAX request on press back button in the browser?

I have a search that returns an AJAX(MVC AJAX Form) grid, and, in the grid there is a "details" button. When I press "back" I want to return the page with the returned results(that are loaded via AJAX after the page has open). How can I do that? Using ASP.NET MVC AJAX or Jquery? ...

ASP.NET MVC and ASP.NET Membership: implementing email address validation after user registration

I'm building an ASP.NET MVC 2 site, where I want to have users verify their email address after they register. I want to send an email to the address with a link that the user can click to verify their email, and then handle the clicking of that link (the link will contain a specific id, of course). Of course, this is easy to manually ...