protected internal RedirectToRouteResult RedirectToAction(
string actionName,
string controllerName);
means I cannot do
public static ActionResult RedirectToErrorAction(this Controller controller)
{
// redirect to custom error page
return controller.RedirectToAction("error", "support");
}
Any ideas?
...
Basically I am looking to insert an item at the beginning of a SelectList with the default value of 0 and the Text Value of " -- Select One --"
Something like
SelectList list = new SelectList(repository.func.ToList());
ListItem li = new ListItem(value, value);
list.items.add(li);
Can this be done?
Cheers
...
I have just installed the RTW 1.0 of the MVC framework. I was using RC2 in the past to go through the tutorials. I now have a problem where basic routing doesn't work which i didn't have in RC2.
If i create a new MVC application in VS 2008 the routings for the home page don't work out of the box.
The following URL's work for some reaso...
I have a lot of problems with url rewrite and ajax extensions 1.0 on a asp.net 2.0 web application.
I am considering using asp.net mvc.
Does it work for me since i am using asp.net 2.0, ajax extensions 1.0 + ajax control toolkit, iis 6 on a win2k3 server?
My development machine is windows vista with iis 7
Please advise.
Thank you.
...
Hi folks,
yeah :( simple question * blush *
Lets imagine i have the following enumeration:-
string[] languages = new string[]
{
"en (uk)", // English (colour)
"en (us)", // English (color)
"fr", // French
"es" // Sp...
Hi all,
i have a asp.net 2.0 web app that runs with ajax 1.0 extensions and isapi rewrite.
I have some bugs and i am considering whether to upgrade to 3.5 and use asp.net mvc instead.
Please advise.
...
Hi,
I'm just starting to play with asp.net mvc and I've got a very basic question:
If I have a view that shows information about System.Web.Mvc.ViewPage<Foo>, how can I get the actual object when passing the form values to my Edit Action on my FooController?
By default I got this implementation of the Edit action:
public ActionResult ...
I am trying to create a .Net Library with few Controllers, and i want to reuse them in Multiple web projects.
I'm half way through, But problem i'm getting is , Whenever i add the library to the new web project , i need to copy all corresponding view files separately to the new project. Whenever i update the library, i need to repeat th...
This is probably going to turn out to be a case of just needing another pair of eyes. I must be missing something, but I cannot figure out why this kind of thing cannot be tested for. I'm basically trying to ensure that unauthenticated users cannot access the view by marking the controller with the [Authorize] attribute and I'm trying to...
I've got a field which its type is byte[]. This field will hold my entity's RecordVersion property (timestamp in the database). How do I keep this field so that when I save my entity it is available?
I've tried two different things and haven't succeeded so far:
This renders "System.Byte[]":
<%= Html.Hidden("RecordVersion", Model.Record...
I have some jQuery code in an external Javascript file that is making an ajax call to an action method I have in my controller. The code in the external Javascript file is below. The action method is being called eventually, however it is not being called in time. When I set a break point in the action method, it is not being called u...
i have a problem with asp.net mvc on windows 7... asp.net mvc RC was previously installed and i installed MVC rtm... it says “the project type is not supported by this installation”... is there anyway to register this project type in to visual studio or unregister the rc version?
...
Hi everyone!
I have the following situation... In a certain View, the user must select the initial hour, the final hour and the weekday. But, I can't save this informations to DB 'cause I need to save my whole page and I need the primary key of the primary table, but that's not the point.
So, while I don't save these data to DB, I'm sa...
I have some navigation things that need to hit the database every time a page has been requested. In Rails I would just set an instance variable in the ApplicationController.rb and that would be available to every controller/view.
Now I see that all my controllers inherent from : Controller in .NET MVC. Can I open a partial class for Co...
Hi, I'm using the Repository Pattern (like the examples in the http://www.asp.net/mvc site) in a ASP.NET MVC application. I have two repositories, one called CategoryRepository an other called ProductRepository. I also use two services, the CategoryService and ProductService to validate and call the repositories methods. I need a list of...
I'm starting a new project soon and investigating whether or not to use MVC, Silverlight or both. This question Silverlight vs. ASP.NET MVC was a good starting point. But looking over the SL3 beta, it looks like there are two things that change the landscape just a bit. First, the navigation feature which is a direct feature of Silver...
Hi folks,
i wish to create a reusable ASP.NET MVC ViewUserControl which is strongly typed to an enumeration.
Can this be done? When i try it, it says that the strong type the ViewUserControl can accept, can only be of a reference type :(
This also means i can't pass an int as TModel.
Why do i want to do this? I'n various places of my...
Is the "asp.net membership provider" portable? Do I have to run the aspnet_regsql.exe to set it up for every new machine?
I imported the membership provider database to Visual Studio Database Edition and checked into my source control, and redeployed it to a different dev machine. From the new machine, I got the following error. How d...
I would like to reuse *.aspx files in multiple ASP.Net MVC projects. Is this possible?
EDIT: Anthony's suggestion of using version control system to share common files across multiple projects solves my question in a practical way. Luckily, since I'm using Subversion, the solution fits me. However, if I wasn't using one, how can this pr...
I've got some experience with ASP.NET MVC, but only with a web application where the content of the master page doesn't change. I've been wondering how you would handle a site where for example the menu (which is on the master page) is loaded from a database. Where would you load this data?
In WebForms, you would load the menu in the c...