asp.net-mvc

ASP.NET MVC 2: Linq to SQL entity w/ ForeignKey relationship and Default ModelBinder strangeness

Once again I'm having trouble with Linq to Sql and the MVC Model Binder. I have Linq to Sql generated classes, to illustrate them they look similar to this: public class Client { public int ClientID { get; set; } public string Name { get; set; } } public class Site { public int SiteID { get; set; } public string Name {...

Can I do a AcceptVerbs(HttpVerbs.Get/Post) and hijaxing on the same page MVC?

I am working with Hijaxing and I will have three buttons, Prev, Add, and Next. The hijaxing works with both the Add, and the Next button. Prev button is set to 'onclick="history.back(-1)" '. Add button is triggered by a '(Html.BeginForm("Add","Home"))' form with hijacking Jquery, which works fine. Next button does does the same as th...

Change image of a button whithout going into the server with Jquery

Hello, I have a button that has a image and uses a MVC Ajax Form(Not Jquery) but I want change the button image to a loading element via Jquery, how can I do this using a element img that is already loaded in the page (if load from server it lost the purpose of immediatly show a loading element). ...

App with MVC Virtual application shared AuthCookie.

I have a 3.5 ASP.Net WebForm parent application. The parent uses forms authentication. I have a MVC child virtual application, I would like to make it so the user logs in to the parent application, user then navigates to the virtual application by pressing a link on the parent. However every time I do this it goes to the login screen ...

Multi-tenant Access Control: Repository or Service layer?

In a multi-tenant ASP.NET MVC application based on Rob Conery's MVC Storefront, should I be filtering the tenant's data in the repository or the service layer? 1. Filter tenant's data in the repository: public interface IJobRepository { IQueryable<Job> GetJobs(short tenantId); } 2. Let the service filter the repository data by te...

IIS 7.0 - Every site suddenly redirecting root request to forms authentication

Suddenly, IIS 7.0 is redirecting every request for the root of any domain hosted on the box to ~/Account/Logon, which is our Forms Authentication redirect. Additionally, some JavaScript and image requests are being similarly redirected, but not other aspx pages. This is not desirable. Nobody will admit to changing anything. Any ideas?...

Simple getJSON does not work...

JSON function(Index) does not fire. Any Ideas? <script type="text/javascript"> $(document).ready(function() { alert("This alert is displayed :("); $("form[action$='GetQuote']").submit(function() { $.getJSON($(this).attr("action"), $(this).serialize(), function(Result) { a...

Problem with strongly typed partial view

Hi guys, I've a problem with Partial View. I am developing a blog in asp.net mvc and I would make in my masterpage a list of categories, last post, last comments. I think that the best solution is to use strongly typed partial view, and in each partial view pass the necessary model. MY problem is that the model in View.. in any view (co...

ASP.Net MVC - post from one controller to another (action to action)

Hi! Is is possible to do a post from an Action "Save" in a controller "Product" to an Action "SaveAll" in a controller "Category"?? And also passing a FormCollection as parameter Thanks!! ...

ASP.Net MVC, JS injection and System.ArgumentException - Illegal Characters in path

Hi, In my ASP.Net MVC application, I use custom error handling. I want to perform custom actions for each error case I meet in my application. So I override Application_Error, get the Server.GetLastError(); and do my business depending on the exception, the current user, the current URL (the application runs on many domains), the user...

Attach jQuery dialog to Submit button in ASP.NET-MVC

I have a submit button which has been working to submit my form in ASP.NET-MVC. I would like to attach a jQuery dialog to the button click. If the user exits out of the dialog, then I would like to exit from the submit as well. I have dialogs hooked to other buttons, but not submits. How can I do this? *EDITED* This is an example o...

asp.net-mvc feature - one css file per (view / master-page / user-control)

I'm trying to implement the following feature: I want just one css file to be attached for any page that I rendered. For example take StackOverflow site. For the questions page, we will have questions.css file. so.com/questions ---> questions.css so.com/question/1234/title ---> question.css so.com/about ...

ASP.NET MVC is not displaying the image

public static string PDFUrl(int id, int page) { } ...

ASP.Net MVC per area membership

I am building an ASP.Net MVC app that will run on a shared hosting account to host multiple domains. I started with the default template that includes membership and created an mvc area for each domain. Routing is set up to point to the correct area depending on the domain the request is for. Now I would like to set up membership speci...

JQuery idleTimeout plugin: How to display the dialog after the session is timedout on ASP.NET MVC Page

Hi I am working on migrating the ASP.NET apllication to MVC Framework. I have implemented session timeout for InActiveUser using JQuery idleTimeout plugin. I have set idletime for 30 min as below in my Master Page. So that After the user session is timedout of 30 Min, an Auto Logout dialog shows for couple of seconds and says that "You...

GLOBAL loading inside each single button with Jquery in ajax calls of asp.net mvc

I have the following scenario: I have a button\link with a image inside like this: <button type="submit" id="myButton" class="button"><img src="../../Content/images/check.png" id="defaultImage" /> SaveData!!!</button> We are OK here! Now what I need to do is: I want on the click that the image change for a loading element that is pr...

Passing Values from a View to itself with parameters getting null values ?

Hi all, I am trying to get values from a view which i have the code below and I am taking the start date value from the view input text box and posting it back but I am still getting null except for the apikey and userkey.Here are the two views.. public ActionResult View1(string apiKey, string userId) { StartGoalView...

How to add a skin engine to asp.net MVC system

I'm implementing a solution in ASP.NET MVC that later can be applied to couple of other fields. To do so it will require to re-brand the UI even though the underlying business logic wont need to change. I'd like to write the code in such a way that will allow other developers to only develop code that will only changes the UI. This is si...

What does this error states in asp.net-mvc?

I have repository class in asp.net mvc which has this, public Material GetMaterial(int id) { return db.Materials.SingleOrDefault(m => m.Mat_id == id); } And my controller has this for details action result, ConstructionRepository consRepository = new ConstructionRepository(); public ActionResult Details(int id) {...

Is this Where condition in Linq-to-sql join correct?

I have the following Iqueryable method to show details of a singl material, public IQueryable<Materials> GetMaterial(int id) { return from m in db.Materials join Mt in db.MeasurementTypes on m.MeasurementTypeId equals Mt.Id where m.Mat_id equals id select new Materials() { ...