Let say I am rendering list of products with Add To Cart link / button next to each.
I also have a CartController with AddToCart Action that accept a parameter of Product type.
After product is added to cart user should stay on the same page (Product list) - not to be redirected to Cart or something.
I am rendering Cart summary parti...
I am working on a asp.net mvc c# jquery application. For some reason when I drag a file from the solution explorer on to my code page I no longer get the path to the file. All I get is
<a href="../../">../../</a>
If I start with a new MVC project and drag a file say the jquery file Visual Studio gives me this,
<script src="../../Scr...
I am following the NerdDinner MVC application as a guide to do my paging. What if my results are more than 1000 pages, I want to show perhaps the numbers 1 2 3 4 5 .. 10 on the bottom of my page and perhaps something like >> to move to the next set of 10 or 100 pages.
How can I do this in MVC?
...
The above is concept of a search interface I want to build in ASP.net MVC. when user clicks on the '+' button, it should create a row text filters or date filters. Does jQuery offer me this flexibility or are there any such UI frameworks which would help me achieve this? There is a search button, not shown, which when clicked should po...
I have a Jquery modal dialog, My question is what is the best way to send this data to the controller, and to display a message back to the dialog. I can not seem to find and good examples of this.
...
I have a controller which peforms a linq to sql query against a model consiting of 4 tables.
var files = from f in filesContext.Files
join u in filesContext.aspnet_Users on f.Uploader equals u.UserId
join uir in filesContext.aspnet_UsersInRoles on u.UserId equals uir.UserId
jo...
I've been working with ASP.NET MVC and Javascript/jQuery a lot lately and I seem to be heading in a direction where I'm always needing to pass some dynamic value "to" my javascript. When the script is right in the page, I've done something like this:
var isEditable = <%=ViewData["editable"]%>
I like how this is quick & easy and just l...
Hello,
I'm designing a database application which stores simple contact information (First/Last Name etc.) and I also have to store phone numbers. Besides phone numbers I have to store what they are for (mobile, business etc.) and possibly an additional comment for each.
My first approach was to normalize and keep the phone numbers in ...
We are building a fairly large HR application in ASP.NET MVC, and so far our controllers are becoming quite large. For example, we have an Employee controller, and all employee views are included (Personal info, employee deductions, dependents, etc). Each of these views might have multiple actions or subviews (e.g. CRUD). Each action ...
I am not sure if I should do this any different with MVC, but I am curious what is the recommended approach for adding extra info to a ASP.NET User account when using the Membership provider? Also how to associate this use with other entities.
Normally I don't bother with the profiles, and prefer to add extra information to a table that...
I will designing a couple of web applications shortly. They will probably be done in asp.net mvc.
In my existing web apps, done in delphi, the data access layer is seperated out into a completely separate application, sometimes running on a different server. This is done more for code reuse than for architectuaral reasons. This won't...
UPDATE: looks like I've misunderstood what TempData is for and what it isn't. It definitively shouldn't be used to "keep certain session-wide data" as I asked initially (see ASP.NET MVC TempData Is Really RedirectData why). I've modified the question accordingly.
Has anyone used CookieTempDataProvider for TempData storage? Are there any...
Hi All,
**UPDATED**
I have a custom ContentActionInvoker that has some crazy logic in it.
I'd like in some case to invoke a different action in a diffrent controller and with some different parameters.
How can this be done?
class ContentActionInvoker : ControllerActionInvoker
{
protected override ActionResult InvokeActionMet...
I have 2 seperate systems - a document management system and a sharepoint search server.
Both systems have an api that I can use to search the data within them. Tthe same data may exist in both systems, so we much search both.
What is the most efficient way (speed is very important) to search both api's at the same time and merge the r...
In asp.net MVC dependancy injection with controllers is simple and straightforward. Now, I'd like to remove most of the logic from views by using helpers. The problem is that these helpers use some of the objects that are injected.
Let me write an example:
public interface ISessionData
{
List<string> IdList {get;}
}
public MyContro...
I know that this is probably something easy to implement, but I am having a bit of trouble finding an answer. Similar to how Stackoverflow allows you to continue to drill down into questions using tags, I am trying to implement the same. So, I have created a list of 'tags' on my MVC page that looks like this:
<%For Each item As myItem...
I am trying to set the Authorize for my controllers can do the following:
[Authorize(Roles = "Approver")]
How ever the names of the roles are held in the database, and therefore I would like to try and do the following:
[Authorize(Roles =Settings.Instance.RoleEmployee)]
but I get the following error:
An attribute argument must be a ...
Hi, can someone give me an example or link to one of using a session in asp.net mvc?
...
So I am trying to figure out a method that can render a error message if my model is null and after that error message the view should stop rendering, is this possible? My first thought was the response.end() method but then the master view won't finish rendering. Is this somthing thats part of the framework our do need to build it mysel...
Url.Action found in MVC is member of what classes? VS2008 cannot find it and keeps offering me just System.Security.Policy to import. Alternatively, can I make ActionLink helper NOT to encode it's content, so this code would work:
sb.Append(helper.ActionLink(linkText, actionName, controllerName, new{onclick=""}));
...