Given this POCO class that was automatically generated by an EntityFramework T4 template (has not and can not be manually edited in any way):
public partial class Customer
{
[Required]
[StringLength(20, ErrorMessage = "Customer Number - Please enter no more than 20 characters.")]
[DisplayName("Customer Number")]
public v...
I am looking for a posterous like custom domain management for the users. The user can register a domain and should be able to point their new domain to their sub domain in the web application. Any ideas?.
NOTE: I am not looking for a serverfault.com like answer but a programatic one as it is done in posterous.com.
...
I just wrote perhaps the ugliest bit of MVC code in existence. It is:
<table>
<tr>
<%
int i = 0;
foreach(Thyla.Models.Tag tag in this.Model)
{
i += 1;
%>
<td>
<span>
<input type="checkbox" name="TagSelector" id='<%= tag.TagName%>' value='<%= tag.TagName%>' />
<label for="<%= tag.TagName%>" title="<%= ta...
Hi, I'd like to implement a base controller on one of my controllers. Within that base controller, I'd like to be able to get the current executing ActionResult name.
How would I go about doing this?
public class HomeController : ControllerBase
{
public ActionResult Index()
{
And;
public class ControllerBase : Controller
{
...
Is it possible, from within ASP.NET MVC, to route to different controllers or actions based on the accessing device/browser?
I'm thinking of setting up alternative actions and views for some parts of my website in case it is accessed from the iPhone, to optimize display and functionality of it. I don't want to create a completely separ...
how to dynamically add and remove textbox in asp.net mvc
...
Hi,
Any ideas why I am getting the below error in my MVC2 project, even through in the project itself I definitely have a reference to "system.Web.Entity"?
Compiler Error Message: CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
Source Error:
Line 1: ...
Hi,
I understand that IIS logs parts of http request which I can access. I would like to log the whole http request for a short period of time. This means I would like to store the data being posted in its raw form. Is this possible using ISS’s logging facility or do I have to install another tool?
I have the following problem. I expos...
hi,
I have an ASP.NET MVC application. In this after user get Sign in .We set the a cookie for the user who logged in using FormsAuthentication.SetAuthCookie(userName, false).
In other page we get the Cookies using the FormsAuthentication.GetAuthCookie(userName]) .
This cookie values as string is then set in the
Response.Cookies["use...
Subj. I've got an ASP.NET 2 MVC Worker Role Application, that does not differ much from the default template.
When attempting redirect from HTTP to HTTPS (this happens when we access constroller secured by the usual RequireSSL attribute implementation) we get blank page with "Bad Request" message.
IntelliTrace shows this:
Thrown: ...
Part of my application maps resources stored in a number of locations onto web URLs like this:
http://servername/Issue.aspx/Details?issueID=1504/productId=2345
Is it possible to construct an MVC route that matches this so that I get the path in its entirety passed into my controller? Either as a single string or possibly as an params s...
In an ASP.NET MVC app I have a page with a dynamically generated list of links to different pages in the app. What is the best way for the controller to pass the link information to the view?
I want to keep the view as simple as possible and I'm assuming it's wrong to generate URLs in the controller (too UI specific, makes unit testing ...
My website uses categories and sub-categories.
I'd like the follow mapping:
/Category/Fruit
/Category/Fruit/Apples
But if I use the below:
routes.MapRoute(
"Category", // Route name
"Category/{category}/{subcategory}", // URL with parameters
new { controller = "Entity", action = "Category" } /...
I'm trying to set up a page where I display a list of items and the details of the selected item. I have it working but wonder whether I have followed the correct approach. I'll use customers as an example
I have set the aspx page to inherit from an IEnumerable of Customers. This seems to be the standard approach to display the list ...
How to check what controller and method are called?
In html in body tag there is: <body id="somethingThatDependsOnControllerAndMethod">. id value will be assigned based on controller and it's method.
...
Is there a way to create a strongly typed T4MVC ActionLink with a hash in it?
For example, here is the link I'd like to create:
<a href="/Home/Index#food">Feed me</a>
But there's no extension to the T4MVC object that can do this.
<%= Html.ActionLink("Feed me", T4MVC.Home.Index()) %>
So, what I end up having to do is create an acti...
So far I've migrated two ASP.NET MVC 1 solutions to MVC 2 and therefore kept my web.config almost the same, just changed the necessary stuff in it as documented in Release notes.
Although I created a few new test MVC 2 webapss from scratch, until now I haven't really checked out the default new web.config. As I created a new empty MVC 2...
Hi, I'm working in an ASP.NET MVC project where I have created a two LinqToSQL classes. I have also created a repository class for the models and I've implemented some methods like LIST, ADD, SAVE in that class which serves the controller with data. Now in one of the repository classes I have pulled some data with LINQ joins like this.
...
Here is my problem. I have a list of models that are displayed to the user. On the left is a checkbox for each model to indicate that the user wants to choose this model (in this case, we're building products a user can add to their shopping cart). The model has no concept of being chosen...it strictly has information about the produc...
My ASP.NET MVC app needs to run a set of tasks at startup and in the background at a regular interval. I have implemented each task as a controller action and listed the app-relative path to the action in the database. I implemented a TaskRunner process that gets the urls from the database and requests each one at a regular interval usin...