I want to use the the AuthorizeAttribute to control which users are allowed access to my actions. I just want to clarify that my logic is in order.
I create my own implementation of IPrincipal
I post a user's credentials to a login action of a security controller.
I validate the credentials with a UserService class and assign the IPri...
I was wondering if there was a way to bind the value of an input field straight to the property in the Model through a strongly typed model. For example, let's say my Model is an Address object. I want to be able to say Html.Textbox(Model.Address1.State, "state", Model.Address1.State). So the first parameter would be the explicit prop...
I have [requireSsl] on my accounts controller.
It appears to work for all actions except the login action. I believe this is because the login action is called as follws:
new { controller = "Account", returnUrl = HttpContext.Current.Request.RawUrl }
Account/Login?returnUrl...
Account/Login%3freturnUrl...
when changing to http...
I have a check for registration in my RegistrationController:
public class RegistrationController : Controller
{
private readonly IAmARegistrationRepository _RegistrationRepository;
public RegistrationController(IAmARegistrationRepository registrationRepository)
{
_RegistrationRepository = registrationRepository;
}
public bool I...
I have been doing some work on a ASP.NET MVC project today i tried to publish the website but i ve got an error. my hosting service provider told me is due to the fact that i have version 1 while they support version 2.
how can i upgrade to version 2?
are the differences between the two version so extreme that a previous version is not s...
I'm using ASP.NET MVC, and am trying to render a select list with the HtmlHelper.DropDownListFor method, like so:
<%= Html.DropDownListFor(x => x.AllTopics, SelectListHelper.GetSelectListItems(Model.AllTopics), "Select a Topic", new { id = "allTopics", @class = "topic-dropdown" })%>
where SelectListHelper just returns an IList<SelectL...
I've got a question about ModelBinding in ASP.NET MVC (I'm using MVC 2 preview 2) related to inheritance.
Say I have the following interfaces/classes:
interface IBase
class Base : IBase
interface IChild
class Child: Base, IChild
And I have a custom model binder BaseModelBinder.
The following work fine:
ModelBinders.Binders[typeof(C...
The link for logging in looks like this:
<%= Html.ActionLink("Log On", "LogOn", "Account") %>
which yields the following link in the browser:
http://localhost:2300/Account/LogOn
However, if I switch to an Area, such as Content, the Login link now looks like this:
http://localhost:2300/Content/Account/LogOn
...which fails of cour...
I am working with MVC 1, and the CKEditor. I am integrating ajax forms which work great, but the editor window disappears after the ajax post. In webforms, I would have to not use ajax, or use a postback trigger. Is there a way to reload the editor on the ajax submission?
Any help is appreciated.
...
I know that the first route will catch most of the paths. However, this will catch also /Product/Edit/blablabla (i'm using ASP.NET Routing Debugger):
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
...
I have an application with the FrontEnd separated into one Project file and the Codebehind/classes separated into a completely different class library. What I need is a way to, from the UserControl Type, obtain it's VirtualPath.
Typically, we would have this in code
Board uc = (Board)Page.LoadControl(@"~\Board.ascx");
But I want is s...
I've been googling but haven't found any good info on building a good search function in a ASP.NET MVC project.
Off the top of my head, a search feature for searching authors and books would look like this:
char[] delimiterChars = { ' ', ','};
string[] searchterms = SearchBox.Split(delimiterChars);
IQueryable<SearchResult> SR = _db.Boo...
In my mvc application i need to check a condition in action and throw it to the log.
How can i add a info to log info.
...
I think I am very close to assembling an MVC repository correctly but just falling apart at the fringe. I created an MVC project with a repository and am returning data successfully, but not accurately as it pertains to DDD. Please tell me where I am incorrect in terms of strict DDD assembly. I guess if the topics are too wide, a book...
I want to use Windows authentication within an MVC app, but only for certain areas of the site (i.e. admin area).
Currently I've set in the web.config; but unlike the Forms one this seems to force authentication on the whole application even though the controlers don't contain the [Authorize] filter.
Is this feature built in or will I...
When I look at an MVC view which I wrote, it all looks like tag spaghetti to me especially with default color scheme of VS 2008. It's all <% yellow tags %> everywhere. It's really hard to distinguish server and client side code.
In classic ASP it wasn't that bad because usually server-side code blocks weren't as interleaved as lightwei...
I need to grab the physical path to the app root in an MVC project; I use this to serve from a repository that places its items on the file system.
Alternative, I could use Dependency Injection, but I'd have the same problem; I don't have a Request until someone calls an action, so I can't use Request.PhysicalApplicationPath.
...
I am creating an application that will display a list of objects in a datagrid (list of any type of object), and allow the user to update any item. The code will know nothing about the object being displayed until runtime. Can you improve my code for the update? I am using Formcollection to get items from the form and creating an instanc...
I have an application, that shows list of items bound to a typed model.
In the list every item has an ID from a lookup table.
How to show the value of the lookup data for each item instead of IDs?
The best way has to link a html dropdownlist to each ID, from where I would be able to choose the appropriate value.
Thanks in advance
G...
Is there any tutorial of how to use DataTables plugin with asp.net mvc(especially server side code)? Thanks
...