asp.net-mvc

Jquery ajax complete not getting custom reponse header?

Hi I am trying to pass a custom response header to notify my javascript the user has timed out. It works good expect when it comes to using it with jquery u.i dialogs. I have this $.ajaxSetup ({ complete: function (event, xhr, options) { if (event.getResponseHeader('X-LOGON') === 'LogOn') { window...

Manually Set ModelState.isValid from Controller

Is there a way for me to manually set the ModelState.isValid = False from the controller? I have some code like this Dim _region As Domain.Region = RegionService.GetRegionByNameAndParentID(user.UserRegion, user.ParentRegionID) If ModelState.IsValid AndAlso Not _region Is Nothing Then ''# ... Else Retur...

Masterpage with a dynamic template

In MVC.NET, how should I dynamically populate the HTML structure from a database into a Masterpage where the first the template needs to wrap the masterpage contents? AKA -- master page header stuff goes here -- ... -- Beginning of client template goes here -- ... -- masterpage contents goes here -- ... -- End of...

calling a jquery function from asp.net mvc action..

After posting a form to database is it possible to call a jquery from asp.net mvc..... [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection collection) { try { //Insert to db //Call a jquery function return RedirectToAction("Inde...

How to register javascript in ASP.NET MVC action?

For example, I want to show a jQuery dialog after insert or edit a record in Action, in webform I can use the follow way to register js script to the page: page.RegisterStartupScript(key, "<script language='javascript' defer>" + script + "</script>"); but this doesn't work in MVC, so how can I do this? thanks! ...

SportsStore: MVC programming

I've been following Steven Sanderson's book called Pro ASP.NET MVC Framework, and I'm running into an exception: Could not load type 'DomainModel.Abstract.IProductsRepository' from assembly 'DomainModel'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...

500 Internal Server Error w/ asp.net mvc and go daddy

I know I have seen a lot of posts on a Internal server error, but I couldn't find one the answered my question. I created an asp.net MVC application. It works fine when I run locally, but when I deploy it I keep getting an Internal Server error. I called go daddy and they said it must be something in my code. I know I changed the domain ...

Can I deny access to a Wordpress directory with MVC 2?

I have a directory in my website called /MyFiction. It is an installed version of Wordpress for a particular blog and I would like to keep it to where you can only get to it if you're authenticated. I'm an old hat to ASP.NET but with MVC I'm still a newbie.... ...

asp.net mvc view strongly typed with PagedList(of product) vb.net

i have this controller function Public Function Index(ByVal id As System.Nullable(Of Integer)) As ActionResult using db = New DbDataContext() Dim prod As PagedList(Of product) = db.products.ToPagedList(If(id, 1), 20) Return View(prod) End Using End Function i have to create a view strongly typed with Dim prod As PagedList(Of produ...

Why won't my MVC project work after publishing it?

I recently published my first MVC 2 project to a commercial web server, running Windows 2008, and which purportedly supports other MVC sites without issue, but have been experiencing some problems. Here is the high-level structure of the project. As you can see, it is very simple: But, after the site is published, and I navigate to th...

Can I achieve exactly the same user experience with ASP.NET MVC as with ASP.NET (Webforms)?

Possible Duplicate: Can I use ASP.NET MVC together with regular ASP.NET Web forms Let's say I need to build a shopping cart. Would I be able to get the same user experience with ASP.NET MVC or would I need to "pick the right tool for the job" - use Webforms and MVC where applicable instead of just focusing on either one. ...

What is the usual way to add an external assembly to ASP.NET MVC project?

I have an external compiled assembly with HtmlHelper extension methods. I need to use it in the project so that there wouldn't be any absolute references to this assembly because the project is shared with Team Foundation Server. What is the usual way to solve the problem? ...

Handling multiple updates to the same row at the same time in an asp.net mvc website using linq to sql

I am using linq to sql as ORM for my asp.net mvc website. I dont know how will linq to sql behave in the following situation. Suppose one of the action from a active session, modifies a row of a table and before saving the changes to the database, I mean before calling _db.SubmitChanges() another action from some other session tries to...

Specify/Disambiguate editor field form names with EditorFor<T>

Hello, I am having a slight problem correctly using the EditorFor of MVC 2, it us setting the name of the form field differently depending on context, which causes some headache when posting to a different URL. Here is what happens: I have a model for a login form: public class LoginForm { public string Email { get; set; } pub...

Reusable jquery ajax requests...

I am developing a web application using asp.net mvc... I am listing out the details of Clients,Staff,Reports via ajax requests using jquery... What i am doing is writing seperate functions(jquery ajax requests) for each actions (ie) view,add,edit,Delete ... //Clients function getClients(currentPage) { $.ajax({ url: "Clients/...

E-commerce site: ASP.NET or ASP.NET MVC?

Is there any particular reason to use one over the other or it's all just a personal preference in the end? ...

Why are there less Telerik ASP.NET MVC controls than ASP.NET AJAX?

ASP.NET MVC Controls - Around 9 controls. ASP.NET AJAX Controls - Around 70+ controls. I've read somewhere that you cannot use AJAX controls inside ASP.NET MVC web applications. Does that mean ASP.NET MVC is less productive? ...

Creating a DropDownList from database entries and then binding it in form submission

I have entries for an enumeration stored inside a database table with only the following fields: ID and Name. I want to show the values stored inside this table inside a DropDownList on a form. The user then chooses a value and submits the form. I found a way to easily create a DropDownList from an enumeration (although it would probabl...

Is this a valid jquery callback function call?

I executing a function like this, <script type="text/javascript"> $(document).ready(function() { getEntities("Clients/GetClients", 0, formatClientsResult); var maxvalues = $("#HfId").val(); $(".pager").pagination(maxvalues, { callback: getEntities("Clients/GetClients", formatClientsResult), ...

Making passing data to views (ASP.NET MVC) easier

Very often I need to pass "complicated" data to my views: different database objects, classes etc. And I'm tired of creating dozens of classes-helpers like. class StatsPageViewData { public User User { get; set; } public Something Something { get; set } // blah blah } Of course I can't just use ViewData["something"], it's ...