Essentially I want to show a friendly message when someone is not part of a role listed in my attribute. Currently my application just spits the user back to the log in screen. I've read a few posts that talk about creating a custom attribute that just extends [AuthorizeAttribute], but I'm thinking there's got to be something out of th...
Question:
How to make code behave differently when running locally vs. in QA vs. in production?
Example:
In an ASP.NET MVC application I have a controller set up to deliver e-mail notifications. When running locally on a development machine I want the e-mails delivered to the developer, when in QA I don't want any e-mail notifications ...
I have created a web app in MVC following the NerdDinner tutorial. I have 2 fields that have many to many relationship with my "dinner". For each "dinner", I need to be able to select one or more Companies from a Company table and one or more Services from a Service table. I've been reading blogs and forums for 2 days, but can't seem ...
I am trying to implement Automapper to map a ViewModel to an Entity where one of the properties of the Entity is also an Entity.
I want my converter to use NHibernate's ISession.Load<> method to load this.
So the question is what is the best way of injecting ISession into my ITypeConverter implementation? Also one thing to keep in mind...
Hi,
I have a base class with an attribute and I want to hide it in a derived class. Is there any way to do this other than using reflection?
[Authorize(Roles = "User,Admin,Customs")]
public abstract class ApplicationController : Controller
{
}
// hide the Authorize attribute
public class ErrorController : ApplicationController
{
}
...
Hi
I am wondering how would I do this with like jquery ajax. Right now I have a jquery ui dialog box popup and it has an html input file on it.
Now when the user clicks import I want to do an ajax post to the server with jquery.
I am not sure how to pass the file in though to my action view.
Right now I have it doing a full post bac...
I am a Java Developer making the transition to the C# world. I've gotten a pretty good handle on ASP.NET MVC (and can compare/contrast it to the concepts I learned for Struts).
However, I'm looking for advice on how to structure my project. Currently, I have two solutions in the project: the MVC Web Application and a ClassLibrary sectio...
Hello. I'm trying out SharpArchitecture and want to have FluentNHibernate generate my database schema for my MVC WebSite.
I'm a bit lost on where to do this. I can do it by adding the SchemaUpdate thingy in the global.asax.cs-file right after NHibernateInitializer.Instance().InitializeNHibernateOnce(InitializeNHibernateSession); in "Ap...
This should be my last question on Jquery Sortable...for a while :)
I have a list that I'm able to remove elements from dynamically. when users click the X close box on the element, I get the parent (the element itself) and remove it:
function DeleteLink() {
var jItem = $(this).parent();
var LinkId = jItem[0].chil...
Hello, I'm running ASP.NET MVC and need a safe way to store credit-card data temporarily (I have a order confirmation page, which posts to an action that actually processes the order). I tried TempData, but it doesn't survive the post. Can I safely use session since it's stored on the server?
Thanks.
...
I have the following class declaration:
public class EntityTag : BaseEntity, ITaggable
I have an Html helper method:
public static string TagCloud(this HtmlHelper html, IQueryable<ITaggable> taggables,
int numberOfStyleVariations, string divId)
This is my ASP.NET MVC ascx:
<%@ Control Language="C#" Inherits="System.Web.Mvc.View...
Ok, so I have seen a ton of stuff on capturing an image from a web cam but I want to capture video. I want to be able to control quality, length and size of file that will be transferred.
It is part of an ASP.NET MVC C# web application and would appreciate any guidance in finding info on this topic, as well as any comments on efficiency...
I am trying to understand how best to organize some common Dropdown lists used in several views (some are cascading)
Is it best to create
a single \Models\CommonQueries
then create a webservice for each dropdown used in cascading situation
then have a single controller that contains actions for each dropdowns
This way I can follow DR...
Is there any sample code of how to read the id of the selected checkbox in a view from a controller.
<% foreach (var item in Model.projects) { %>
<tr><td><input type="checkbox" name="selectedObjects" value=" <%=item.ID %>">
<%=item.Name %>
<% } %>
What must be the code on the controller to get the ID of the selected che...
I have a class that contains a property-value (property bag) dictionary beside normal properties. I'd like to display a collection of this object in a table using the grid from MvcContrib.
The class:
public class ObjectWithPropertyBag
{
public string Property1 { get; set; }
public string Property2 { get; set; }
public Dic...
i want have mvc actions plus file extension like /Home/Index.aspx which route to Index action of Home Controller. can everybody help me. have everybody any opinion or guideline?
...
Hi, I'm writing an ASP.Net MVC application using Jquery to post some data to my users session.
A user 1st accesses my site's page and then I have a button which performs a post using JQuery to an MVC controller method to store some data into the users session.
When the initial page loads I create a session object for my user using a se...
Hi,
hope i can explain myself...
i have a login control in the masterpage. when you click the login button you go to the accountcontroller's logon method which checks your credentials. whether it is ok or not, you will be redirected to the homepage with a redirecttoaction("home","index").
but, in case login failed, i want to show a mess...
This question contains a lot of background information, to make sure you fully understand why we are looking at these technologies.
The question is basically this:
For a large, spreadsheet-type, module that we need to develop for our webmodule for our application, are there any pitfalls we should know about if we decide to use Silve...
I have added this question as to know the different views why people are using ASP.Net MVC, please don't down vote.
I know that it is RESTful, could you please put in more details to help me. I have checked few blogs but no good answers.
I mean which drive me to get my ASP.Net website to ASP.Net MVC.
...