asp.net-mvc

Can Anyone Reccomend an ASP.NET MVC Group Chat Control?

I need to provide a window on an ASP.NET MVC web page where registered users of the site can group chat live. Can anyone recommend a component or control that can provide real-time group chat that I can embed on an ASP.NET MVC page? I am willing to use free or commercial components, as well as a web service. I looked into a few web 2....

How can i make a catch all route to handle '404 page not found' queries for ASP.NET MVC?

Hi folks, Is it possible to create a final route that catches all .. and bounces the user to a 404 view in ASP.NET MVC? NOTE: I don't want to set this up in my IIS settings. ...

ASP.NET MVC Beta Routes, Controller Actions, Parameters and ActionsLinks...putting it all together

I'm having some trouble with ASP.NET MVC Beta, and the idea of making routes, controller actions, parameters on those controller actions and Html.ActionLinks all work together. I have an application that I'm working on where I have a model object called a Plot, and a corresponding PlotController. When a user creates a new Plot object, a ...

What's the best way to develop local using PHP and Visual Studio?

I am taking my first foray into PHP programming and need to configure the environment for the first time. Can I use PHP with the built in VS web server or do I need to (and I hope not) use IIS locally? In addition, any pointers on pitfalls to be avoided would be great. Many thanks. Update: I should have made the question more explicit...

How to update created and modified fields using the repository design pattern?

I am currently working on my first asp.net mvc application. I am trying to drink the kool-aid of all the the sample projects I see and trying to use the repository design pattern. I have a interface called IUserRepository that looks like the following: public interface IUserRepository { IUser Add(IUser user); IQueryable<IUser>...

Ajax.ActionLink with AjaxOptions.OnSuccess uses GET even if POST is specified?

So I'm submitting an Ajax.ActionLink with HttpMethod = "POST" and it works great. However, as soon as I specify an AjaxOptions.OnSuccess callback it submits with "GET" and does a full post back because Request.IsMvcAjaxRequest() is no longer true. Is this a bug or am I doing something wrong here? I'm using the latest Beta version. Wo...

Where should a script block with jquery code be placed on an ASP.NET MVC Master Page?

Getting started with jquery and having trouble getting hello world type example going for asp.net mvc. I get a runtime error "object expected" when trying to load a page with this script. A. Where should script tags be placed in a master page? B. What might I be doing wrong? There are definitely "a" elements in my page? <script src="....

jQuery $(document).ready and ASP.NET MVC Partial

I have quite a few partials in my application, and some of them need to do some jQuery goodness at $(document).ready time. The problem is, if I put the $(document).ready directly into a script block for the partial, then this gets overridden if another partial does the same thing. It seems a solution where the various $(document).ready...

How do I shrink the size of a tag

Pretty new to css and trying to make the tags on my page smaller on all sides. What are the best settings to modify? Margin doesn't seem to do what I want. .story .content .tags .tag { margin: 10px 5px 10px 5px; background-color: #99FF33; font-weight: 500; color: #330099; font-style: inherit; font-family: 'Times ...

can I have a catch all route with the following route?

Hi, I have the default that vs.net creates in a MVC app: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ...

How can I get a JsonResult object as a string so I can modify it?

I am using the FlexiGrid jQuery plug in and I need to get a JSON object back form my MVC App, simple enough if the FlexiGrid took just the object but I need to add a few items to the response string for it to work properly with FlexiGrid. So here is a portion of my controller code: If Request.QueryString("json") IsNot Nothing Then ...

What is the route to catch the default page?

Hi, I don't want to use the default route that vs.net creates: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); I only want the ...

MVC contraint for anything that is only numeric

Hi, I need help with a constraint: Constraints = new RouteValueDictionary(new { filename = @"" }) It has to be only numeric (no letters, slashes etc). ...

Problem setting path to jquery in mvc app

I am having trouble setting the path to jquery in an mvc app. In my master page I have the script declared and jquery works at the root of my app. When I navigate to a content view page in my app jquery does not get loaded properly. Do I need to set the path in the content page as well or declare the path differently? <script src="Views...

Having trouble with rounded corners with jquery that do not round immediately in asp.net mvc app

I am using the rounded corners plugin for jquery and have it working rounding elements in my page. The only issue I have is that the elements appear on the page un-rounded and then round. What do I need to do so that the elements only appear rounded? I originally put my script tags in the head element but should they go somewhere else i...

What is TempData collection used for in asp.net MVC?

What is the actual use of TempData collection in asp.net MVC, I need pros and cons of that collection, and when do I need to use it, which views it is shared upon, or any useful information about it, finally if someone can tell me when to use it rather than ViewData? Thanks in advance CLOSED as exact duplicate of http://stackoverflow.c...

Json or Html? How to tell?

I have a controller that returns either JSON or partial html depending on if the user is logged in. Is there anyway to tell the difference once the result has been returned?? What is the best way. Obviously i have different actions to complete if the response is json or if it is the partial html. With the json one i do a redirect to t...

Redirect to action in other controller

I want to redirect from an action in one controller to an action in a second controller. Normally I would use RedirectToAction("actionName", "controllerName", objects); The method I want to redirect to has two overloads: One for HttpVerbs.Get that is used for direct linking One for HttpVerbs.Post accepting reference types that get fill...

Add select attribute to Html.DropDownList using JQuery

I have the the following html elements: <tr> <td> <label for="casenumber">Case:</label></td> <td> <%=Html.TextBox("casenumber", "", new Dictionary<string, object> { {"id", "casenumberID"} })%> </td> </tr> <tr> <td><label for="fogbugzUser">Users:</label></td> <td> <%=Html.DropDownList("UserList", (Select...

Can Asp.Net Mvc Route Constraints throw a 404 instead of InvalidOperationException?

I'm trying to use route constraints in an Asp.Net MVC Application. routes.MapRoute( "theRoute", "MyAction/{page}", new { controller = "TheController", action = "MyAction", page = 1 }, new { page = @"[0-9]" }); When I enter an url like ~/MyAction/aString, an YSOD is shown with an invalid operation exception. What can I...