asp.net-mvc

Problem with Ajax update after Delete action on Index view in ASP.MVC

I'm trying to do an Ajax delete in a fairly standard Index few, i.e. I have a generated Index view with one added filter drop-down, of little relevance here. I have changed the free Delete Html.ActionLink on every row to an Ajax.ActionLink, and the delete and ajax update work, but whichever container div I try and update, I always someh...

Can i export a JSON object to Excel in ASP.NET MVC site

i am already creating a "table" by having a list of json objects. Is there any generic way i can export this to excel without a lot of custom coding for the details of the data itself? ...

Asp.Net Mvc Error Using RenderPartial

Hi all; http://a.imageshack.us/img709/5208/errorss.jpg pls help, how to make ? ...

SEO and migrating to ASP.Net MVC

It's well-past time for The Office's websites to be upgraded and for the main public one, I'm considering migrating the existing .Net 1.1 ugliness up to ASP.Net MVC. The only real doubt I have is over the fairly extensive work on SEO that has been carried out on the site. What considerations should I bear in mind regarding SEO when mov...

Declaring parameter that i don't want to pass

public Jquery Extra(this HtmlHelper htmlhelper, string message, IDictionary<string, object> htmlAttributes) if i declare the this Htmlhelper htmlhelper when i declare my method, but i don't want to pass that parameter in when i call the method?? am i making sense ...

mvc contrib grid

Hi, I am just wondering whether it is possible to sort by 'combined columns' now (mvc contrib grid)? I know it says here that it is not possible - at least at the time of posting at this site - but things might have changed in the meantime. This is an example of a combined column in the view: column.For(x => String.Format("{0} {1}", ...

ASP.NET MVC Master Detail

I'm curious as to how others are achieving master detail pages in ASP.NET MVC - without JavaScript. Imagine you have an order details page displaying details for a single order. In addition to details of the order, you also have a table of the lines on that order. You would like to be able to edit existing order lines and create new ...

ASP.NET MVC NHibernate Model Binding

With NHibernate I no longer expose foreign keys on my domain objects, so Product no longer has a property: public int CategoryId {get;set;} but instead has: public Category Category {get;set;} Unforunately this doesn't appear to work so well with the automatic model binding in ASP.NET MVC - if I want to simply bind a form collectio...

How to get T4 in VS2010 to iterate over class' properties

Hi, I'm using Visual Studio 2010, and have the tangibleT4EditorPlusModellingTools installed. I'm just playing around with T4, having never touched it previously. What I'd like to do is look at one of my classes in the project, and write out each of the properties. Could anyone give me absolute beginner tips to how the .tt file should...

ASP.NET MVC 404 Errors for IIS 7 Integrated mode

Hey everyone. I am getting 404 errors when I try to access my ASP.NET MVC 2 site. I'm hosting this site using II7, and I have my site set to use the DefaultAppPool Intergrated pipeline mode. Here's my routes, it's a pretty basic site: routes.MapRoute( "DefaultRoute", // Route name "{controller}/{action}/{...

Retrieving cookie from a Container in ASP.NET MVC and C#

//Controller code CookieContainer cookieContainer = new CookieContainer(); //makes new cookie here cookieContainer.Add(myCookie); //Service/Facade code //myCookie gets passed here How do I pull the cookie out of the container to make sure it's the right cookie? ...

Pass a jQuery NotifyBar requirement to the next view in a RedirectToAction.

I'm using the jQuery NotifyBar quite nicely in an Index view to display business rule errors when a user e.g. clicks a delete link for an item than cannot be deleted. However, if the user adds a new item, they are redirected to the Create view. If the new item is successfully created, the Create action redirects back to the Index view....

ASP.NET MVC - Cleaning Up URLS in Complex Model Binding Scenarios

In one of the applications I am building I have constructed a very flexible attribute-based system for describing products in my database wherein each product can have an indeterminate number of attributes assigned to it with each attribute having a single "type". So, for example, one attribute type might be "Category" and the value assi...

Validate DateTime with DataAnnotation

Hi, I'm developing and asp.net app and i'm using data annotations to validate my Input model. In this model, I have one field of type DateTime, and I'd like to know how could I customize the message when the user set an date value invalid. My property in my model: [Required(ErrorMessage = "Informe sua data de nascimento.")] [MinAge(Ida...

ASP .NET MVC ViewModel object is not preserved

I am sort of new to MVC so pardon my ignorance. I am using IoC ( StructureMap ) and I have a need to pass in an instance of what I consider to be a set of Controls to each view, so I have created ViewModels in order to accomodate this. The view model is populated with an instance of the Controls and the View is then rendered. When a u...

Deploy multiple configs or put everything in a single web config?

Our solution file contains many different projects including an ASP.NET MVC web app, a windows service, and several desktop applications. One project handles logging and has an app.config file containing a list of recipients to inform when something fatal has been logged. Concerning the deployment of our webapp, I was wondering if it...

Simple self-made jQuery gallery flickers sometimes

EDIT: I changed up the code a little bit. First I made a secondary MasterPage that holds the template for the view page. I then added a bit of ASP script to have the first image present: <img src="<%= string.Format("/Content/Images/Products/{0}1.jpg\"", ViewData["CurrentPage"]) %>" alt="" class="imgborder" /> I ...

How do I program against a local database while I develop in ASP.NET MVC?

At my work I found out that we belong to some program with Microsoft and get access to various products because of it. I've downloaded Microsoft Visual Studio 2010. I'm not a professional programmer but I've dabbled before and I wanted to check out ASP.NET MVC. I know that I want to use some flavor of SQL Server and that I want to c...

Change color based on value

I have a number of fields where I want to display the data in red if it is expired. <%= Html.Encode(String.Format("{0:d}", Model.Subcontract.insurance_GL))%> If the date is less than today's date, then I'd want it to display in red. What is the best way to do this? EDIT This is for my Detail View. It's not in a grid. It's just a li...

How do you handle a user notification popup "ribbon" - similar to SO's?

In my asp.net MVC app, I'm planning a user notification system similar to SO's. Here's the table structure I'm thinking of: Message table -------------------------------- PK MsgId BigInt FK UserId UniqueIdentifier Body nvarchar(200) IsRead TinyInt DateSent DateTime First, does this DB structure look ok? i...