In Asp.Net with Ajax I can include my Javascript files as embedded resources in my assembly and create references to the embedded scripts using the ScriptManager.
Is there a way to do the same with Asp.Net MVC?
...
Years ago I wrote an extensive windows MFC application using Stingray's Model-View-Controller classes. Short learning curve, awesome results -- undo/redo stack, nested scrolling user drawn controls and so on. I would like to reuse or port a lot of the application to .net winforms or WPF. Does anyone have any experience reconciling these ...
I have an interface that contains a single method called ListAll()
using System.Collections.Generic;
namespace MvcApplication1.Models
{
public interface IMovieRepository
{
IList<Movie> ListAll();
}
}
I have a class that implements that interface:
namespace MvcApplication1.Models
{
public class MovieRepository : IMovieRepository
{
pri...
Anyone know how to set the default sort order for the mvccontrib grid?
...
For a uni assignment, I'm doing a JSF webapp to play poker. Cards in a player's hand are displayed by images. What's would be the "cleanest" way of mapping the card suit/rank to the URL of the associated image?
I'm currently leaning towards either using whatever Card#toString returns, or handling this in the backing bean, it's just that...
Sorry for what is a generic title. I'm not the best at titles.
Anyway the way Cake passes around data (as a hash) is pretty much the reason why I even need to ask this question. If when I passed a variable/obj from the controller to the view, it was an object that I can ask questions to (i.e. $duck->quack() ) rather than having it be an...
This applies to Kohana 2.3.2
I've recently started making my Views more dynamic. Using the default template view as a base, now I am doing in the controller
$this->template->innerView = new View('article');
Then, in the middle of my template.php, I have
<?php echo $innerView; ?>
To echo the 'guts' of the article view between my he...
Is there a way to pass a object, specifically a form_builder object used in a view, to an action in the controller? I am using a link_to_remote and want to update a variable in the controller and then add a new nested form element to my form via a render :update block.
If I pass it as a param, it gets converted string and I can't seem ...
This one has me stumped, and I think it might be a bug in Microsoft's MVC implementation. I am building a MVC website using VS2008 SP1. In an attempt to lockdown my website I edited my controller to look like this:
1 public class IdeaController : Controller
2 {
3 [Authorize(Users = "whozmom")]
4 public ActionResult Index(...
Hi,
i have a MVC project which runs perfectly local. When I deploy to the production server I receive a compilation error:
BC30456: 'Title' is not a member of 'ASP.views_home_index_aspx'.
It makes me think that the inheritance of System.Web.ViewPage(of T) fails somehow... The project is deployed under http://server/ProjectName. The ...
How do you teach junior programmers to use MVC? This is assuming they never had any experience.
...
Just wondering if anyone has used an actionfilter to make it possible to share the view for a specific type between archived info and current info?
Example:
public class Order
{
protected IList<int> _products;
public Order(IList<int> products)
{
_products = products ?? new List<int>();
}
public virtual void...
In this code from Microsoft's MVC Tutorial NerdDinners:
public class DinnerRepository {
private NerdDinnerDataContext db = new NerdDinnerDataContext();
//
// Query Methods
public IQueryable<Dinner> FindAllDinners() {
return db.Dinners;
}
public IQueryable<Dinner> FindUpcomingDinners() {
return from dinner in db.Dinners
...
Would NSSortDescriptor subclasses be placed in the Model or the Controller layer?
Since they are primarily for display and business logic, it seems to make sense to put them in the Controller layer. But it also makes sense that models should know how to sort themselves.
...
I was recently brought on to help with a project that was made up of individual HTML files with the exception of a PHP contact form. So there's not even a hint of object oriented programming, MVC, or layouts (or even PHP for that matter).
The project is quite large, but I wanted to slowly integrate the Zend Framework into this project, ...
So I am in a situation where I have to decide whether or not to have a separate controller for a particular piece of code. We have a home page that acts like a hub for the rest of the site. The page is accessible to all users (logged in as well as non-logged-in). I was thinking about having home as a separate controller and an action cal...
I have a colleague who thinks this
alert('<asp:Localize ID="ErrorAddingComponent" runat="server" Text="There was an error adding component: " meta:resourcekey="ErrorAddingComponent"/>' + errortext);
is a good idea if we get an error from an AJAX call, the errortext is the parameter of the function called on error from a jquery ajax,
...
I want to know where is the best place to put the model classes inside a Zend Framework project. I heard that inside the library is the better place with versions < 1.8. And with version 1.8 we have the ResourceLoader so we can put inside the modules dir.
What's your method? What's the best practice?
...
I've been unleashed on version 2 of an application my company has been working on. It was our first foray into WPF and needless to say, a lot of lessons were learned. The product took a year to develop, so it's not a small application by any means. Everyone recently came on board with MVVM.
Now that we have a large code base with ple...
I have an ASP.NET MVC app that opens a "Request" view in a new browser window. When the user submits the form, I'd like the window to close. What should my RequestController code look like to close the window after saving the request information? I'm not sure what the controller action should be returning.
...