I don't have a problem with building the category structure. I have a problem trying to figure out how they included similar or other categories similar to a given one. For example, if you choose the "computers / software" category you will see a category for consumer information, games, sports, home etc. These categories don't belong di...
my url is working correctly as i can step into the controls correct method but..how am I to read the state name from the url into the view?
My url: http://localhost:10860/Listings/Arizona/page1
My view:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/NestedSiteMaster.master"
Inherits="System.Web.Mvc.ViewPage>" %>
<h2...
I have a BaseController that all Controllers inherit from. The CaseController has the [Authorize] annotation, so that all controllers require authorization.
But I've just realized that one single controller action must not require authorization. How can I turn off [Authorize] for just that one controller action?
using System.Web.Mvc;...
I realize that I can simply add the [Required] attribute to a class property and MVC will automatically do validation in a very nice way.
What I would like to do however, is assign the attribute at run time, is this possible?
For example, say I have
public class Cert {
public string MedicalNum { get; set; }
public int Cer...
Hi,
I am using the nice s#arp repositories and the paging extension method plus sorting like this:
public ViewResult Index(int? page, GridSortOptions sort)
{
ViewData["sort"] = sort;
if (!string.IsNullOrEmpty(sort.Column))
{
return View(this.LabService.GetAllLabs().OrderBy(s...
So, i have my database sorted like:
Products_001
Products_002
Products_003
Let's say, if a customer logs in and his id is 001, he is only entitled to use the database-table products_001.
Can i dynamically create his model - entity using Asp.Net MVC, and how would i do this?
...
We are using the latest stable release of SparkViewEngine for www.stribe.nl.
There is a problem that occurs -sometimes- while rendering the homepage.
When you look at the homepage it will usually render perfectly fine, but i noticed some exceptions in the EventLog from people visiting the homepage.
The exception message is "Error execut...
I have two text boxes A, B using (Html.textboxfor).
TextBox 'A' is enabled and TextBox 'B' is disabled.
When I type values in Textbox 'A' and click outside( moving out the cursor from the textbox), TextBox 'B' should be populated with somevalue.
For example : iam entering value of TextBox A = "King", if the focus is lost from the box,...
Currently I have a table on my page which I need to refresh using Ajax. I was intending to render the table in a partial view and then just call an MVC render-partial update, which would have been nice and simple.
However, I've since added a bunch of sorting/filtering controls in the header of the table. I would now like to refresh the ...
I am getting an incosistant error in IE8, it happens about half the time. I have cascading drop downs using ajax to fetch the next select box options.
$(function () {
$("#stock_item_id").change(function () {
var stock_item = $("#stock_item_id > option:selected").attr("value");
$.ajax({
type: "POST",
...
Hello,
lets say I have a controller named Store. There is an index method:
public ActionResult Index(string val, long? id, int? id2)
{
return View();
}
I want to fetch things like:
/my-store/some-text
/my-store/some-text/
/my-store/some-text/123456789012335
/my-store/some-other-text/4562343462345
/my-store/some-other-bla-text/456...
I'm trying to get my head around using Nunit, Ninject, MVC2 and the ADO.Net Entity Data Model.
Let's say I have have a ProductsController instantiating a SqlProductsRepository class.
public class ProductsRepository : IProductsRepository
{
public MyDbEntities _context;
public ProductsRepository()
{
_context = new My...
I am Trying to incorporate 'EF Tracing Data Provider' into an existing MVC2 app using VS2010, .NET 4.0 in order to log all SQL commands. I have no interest at this time in the Caching provider. I beleive I have followed all the steps listed in the blog posting. BLOG POST My project does compile without error, however when I attempt to r...
I have forms posting data from instances of a particular abstract class:
public abstract class IRestriction
{
public string Name {get; set;}
public abstract IModelBinder GetBinder();
}
The concrete type and PartialView are determined at runtime:
IRestriction restriction = (IRestriction)Activator.CreateInstance(Type.GetType(re...
Hello,
I am attempting to Get the current controller and action being called in the route. In my Global.asax.cs I have the following using and the following line:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using IProwlAdminUI.Models;
*** LINE WIT...
I am getting started on the Moq framework and absolutely love it. I am writing some controller tests that have several services and interfaces to Arrange my controller for the test. I'd love to modularize it a bit more, and thought this would be a trivial task, but it turns out to be a bit trickier than I thought.
Here is one simple un...
I've configured a new MVC2 site to use JanRain Engage (formerly RPXNow) for authentication.
I would like to be able to associate multiple OpenID's to a single user account, but still use the built in providers.
Is there a good solution for handling this without creating new tables or heavy modification to the built-in stored procs?
Po...
If I create an ASP.NET Web Application project and then add an ASP.NET MVC 2 to it using the default routes defined like so
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { action = "Index", id = UrlParameter.Optional }
);
The Sessi...
Hello,
I am wondering how I can pass a model back to an action so that I can continue to work on the data but in a different action based on the button's pressed
To send it back, I specify the Control, Action and use the new { dom = Model } to specify the parameter.
dom is a List (so a list of domain objects. My model passed in is an ...
Hi,
I've ran into some trouble trying to get partial updates to work in ASP.NET MVC2. (I think) I followed the tutorials I found online pretty closely, but the Ajax part isn't working. The controller does what it's supposed to do without errors, but the page doesn't update itself. When I refresh the page I can see the result of my actio...