I am using a custom authorization filter on my ASP.NET MVC controllers that redirects the user to a url other than the login screen if they fail authorisation on a particular action.
This is ok for actions that return views, but many of my actions return other result types such as PartialResult or JsonResult.
My current filter looks li...
Hi There,
I am in the process is designing a website in ASP.NET MVC and am perhaps a little confused as to the exact nature of a repository.
Following the NerdDinner example, my site should have one repository which serves up the entities as I need them. However, I have also heard that you should have different repositorys that deal wit...
Environment: ASP.net MVC:
Given anonymous structure as such:
var test = new
{
name = "me",
age = "100"
};
that then gets parsed as
result = Json(test)
data = result.Data // Comes back with { name = "me", age = "100" }
Which then gets successfully passed into a JS function, how do I go about using that as a JSON object, s...
I am trying to incorporate a silverlight object in one of my controller's views and for some reason the silverlight doesn't display at all... everything works fine in the aspx and html test page.
my code in the view looks like this:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height=...
Hey all,
how do you pass data to the jqModal? For example, when Button2 is clicked can i pass the button's id or a hidden field and have the controller pick it up?
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function() {
$('#title').css('b...
Now I've seen some questions like this, but it's not exactly what I want to ask, so for all those screaming duplicate, I apologize :).
I've barely touched ASP.NET MVC but from what I understand there is no ViewState/ControlState... fine. So my question is what is the alternative to retaining a control's state? Do we go back to old schoo...
I have a "white labelled" application that is installed onto multiple customers' servers. On any given installation the differences will include content, style sheets and graphics but also some actual code / business logic. I want my TFS Server to build all flavours of my application automatically. What are my options for doing this? e.g...
I'm not sure if this is a bug, or a feature. I have an action param that takes a ListRequest object with a few string properties. .NET MVC dutifully maps the query string params of the same name to the ListRequest objects' properties.
I add a ListRequest.Filters property, which is to be a list of strings taken from the querystring: ?fi...
Consider an ASP.NET MVC controller method that builds an ASP.NET Chart image.
public FileStreamResult MakeImg(IEnumerable<MyObj> stats)
{
Chart barchart = BarChart(400, 300);
Series series1 = new Series("Series1");
series1.ChartArea = "ca1";
series1.ChartType = SeriesChartType.Column;
...
In traditional ASP.NET Web Form applications, UserControls are a great way to encapsulate functionality so that it can be reused. However, UserControls don't fit well into the MVC model. They often make heavy use of ViewState and they blur the seperation of concerns that MVC promotes.
My question is, how do you best bundle a piece of fu...
I have a collection of posts created by separate users in my database.
Each user can create posts and edit only their posts.
To edit their post, users navigate to a page "Posts/EditPost?PostID=x" where x is the post ID.
The "Posts" controller has an '[Authorize]' attribute and the GET part of the action checks to see if the post was ...
Hi,
I'm trying to retreive data from a massive form using Asp.net MVC. Its top object L1 contains properties which are Collections of other types L2. However the Type L2 contains some properties which collections of type L3, and so on. There are probably 5 levels of nested collections.
I've seen the approach of binding to Lists in Asp....
Are there any issues with using anonymous types with the Json() method in asp.net mvc?
I recently had an issue where returning an anonymous type from a Linq .First() would not work when returned to the jQuery caller. I created a simply subclass inside my controller and simple assigned values from the query object and that seemed to seri...
Are ASCXs still used in ASP.NET MVC or should we be using something else?
...
I am working on a website that will post a JSON object (using jQuery Post method) to the server side.
{
"ID" : 1,
"FullName" : {
"FirstName" : "John",
"LastName" : "Smith"
}
}
At the same time, I wrote classes on the server side for this data structure.
public class User
{
public int ID { get; set; }
...
What does the regular expression "\d{1,6}" (used in an ASP.NET MVC route as parameter constraint) check for/allow?
...
i want to resize an image before it is saved on my mysql database..
how will i process it?
i have here the code for view, controller, and model.
View:
<form method="post" enctype="multipart/form-data" action="<%=url.action("PhotoInsert") %>">
<%Using Html.BeginForm()%>
<p>
<label for="despcription">Caption :</label>
<%=...
I have a solution with two relevant (to this question) projects, and a few others;
Class library with functionality used by several other projects.
ASP.NET MVC application.
My question is basically where I should do IoC with Ninject 2, considering...
The class library needs some DI love, among other things in the repository classes...
How do i simulate and handle the server not responding error? And which case do u think it might occur, as when u request a page from the server and if its not responding wouldnt it throw page cant be displayed error?
...
When inside a View, within MVC, and you have your JavaScript, I tried to move it to a JavaScript file in the same directory, and it reports it can not file the javascript file
As an example I user NerdDinner and the DinnerForm.aspx, created a JavaScript file in the same directory as the DinnerForm.aspx called DinnerForm.js and reference...