I have an asp:calendar on my view page and as I hover over it..it shows a javascript postback status bar. but I have an asp:button also on the same page and when I hover over it. The action from the controller is in the status bar..because I have an onClick attribute for the button that triggers an action on the server side. and in the ...
I've been going through the various tutorials regarding the right way to unit test controller logic. Take the following action:
public ActionResult Login()
{
//Return the index view if we're still here
return View();
}
Word on the street is to wire up a test method similar to this:
[TestMethod]
pub...
Whats the best practice to test an Asp.net MVC application?
...
How can I mock the database calls to make my application logic been tested without database?
...
Hi,
I'm currently in the process of updating a site from preview 2 of ASP.NET MVC to the Beta release. I'm down to my last compile error with no solution in site after an exhaustive search. I have some code in Global.asax.cs which sets up IOC using the Windsor container:
ControllerBuilder.Current.SetControllerFactory(typeof(WindsorContr...
I'd like to build a CMS site based on Asp.Net Mvc and I want to choose my starting point.
I have seen that there is a lot of interest in the new Microsoft Oxite project also if it seems to be pretty early to adopt it in a production project.
I've also looked at S#arp Architecture but it does not properly compare to Oxite as is just a st...
I am trying to set up my tab order on the html side of my project. How do I set the tab order. Usually in visual basic, the option is in the menu bar under view/tab Order. How do I do this in asp?
...
Hello,
I seem to be unable to find the "link" between a controller's ViewData collection and a ViewPage's ViewData collection. Can anyone point me to where in the MVC framework a controlle's ViewData collection is transferred to a ViewPage's ViewData collection?
I have spent quite a lot of time using Reflector to try and work this one ...
I have the following code in an Autofac Module that is used in my Application_Start method:
builder.Register(c => new Configuration().Configure().BuildSessionFactory())
.SingletonScoped();
builder.Register(c => c.Resolve<ISessionFactory>().OpenSession())
.HttpRequestScoped();
builder.Register<NHibernateSomethingRepository>().As...
Here is the idea:
When the user wants to see /controller/action, then I want the page to have a "robots" meta tag with its value set to "all".
When the user wants to see /controller/action?sort=hot&page=2 (i.e. it has a query string), then I want the page to have a "robots" meta tag with its value set to "noindex".
Of course this is jus...
Is there any way I can vary caching by a controller action parameter using the outputcache attribute? We have varybyparam which will not work if my parameters are embedded within the url in a REST manner.
Thanks
...
We have a pretty big ASP.NET WebForm (web application) project with a lot of references to other libraries, other projects etc and most of the time after a compilation, the first time we load a page it takes a LONG time before rendering anything... Disk IO is the main problem. For small projects it's nearly instantaneous, but once your...
problem description: This model works fine with one user at a time. As soon as I get multiple users at once, I get a serious of errors relating to not closing my SqlDataReader. When i turn off lazy loading like this:
persistenceModel.Conventions.OneToManyConvention = (prop => prop.SetAttribute("lazy", "false"));
It's fine, yet perfo...
I wanted to set a css class in my master page depending on the current controller and action. I can get to the current controller via ViewContext.Controller.GetType().Name, but how do I get the current action? (ie Index, Show etc)
...
ASP.NET MVC routes have names when mapped:
routes.MapRoute(
"Debug", // Route name -- how can I use this later????
"debug/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = string.Empty } );
Is there a way to get the route name, e.g. "Debug" in the above example? I'd like to access it in the controller's...
Is it possible to get a URL from an action without knowing ViewContext (e.g., in a controller)? Something like this:
LinkBuilder.BuildUrlFromExpression(ViewContext context, Expression<Action<T>> action)
...but using Controller.RouteData instead of ViewContext. I seem to have metal block on this.
...
So I totally buy into the basic tenents of ASP.NET, testability, SoC, HTML control...it's awesome. However being new to it I have a huge hang up with the markup. I know it comes from my hatred of classic ASP, and I can't help but feel like I've entered the twilight zone when I see this.
I don't know what the alternative is (can I use ...
I'm writing a asp.net MVC site and I have written some extensions to the Html class to generate some html for me.
From within the extension method is it better to write directly to the Response.Output stream or have the extension method return a string?
What are the advantages / disadvantages of using the Reponse.Output stream directl...
I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog post:
http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/
Using this class, my repository looks like this:
public class UserRepository : IUserRepository
{
private readonly ISessionBuilder...
I am trying to get ASP.NET MVC working on GoDaddy and I'm not having much luck. I have read the post on SO that covers the subject, but I must have a slightly different configuration or must be missing somehting along the way because the main MVC page comes up, but all links seem to fail and no amount of tweaking the URLs seems to get i...