During the performance testing of our ASP.NET MVC application I discovered interesting bottle neck. The application is using only 3 managed threads.
I checked maximum thread pool size. It's 200 and we are having 197 available threads.
I checked connection limit of web site and it's unlimited.
I tried to run stress test locally agains...
I'm looking to create a custom authentication model for my MVC app but I'm not sure where to implement my custom IPrincipal and IIdentity classes. I don't want to do this in the Global.asax on every request as not all the pages in the site will need authentication. So my question is where? Should I be doing this in my custom action filte...
This is my first MVC/Linq to SQL Application. I'm using the out of the box SQL Membership with ASP.NET to track users through my system.
As most of you know, the UserId is a guid, great. However, to link other user-created tables in the system, I decided to go with username instead of userid. The reason I did this was because:
Use...
I am POSTing data to an MVC controller and I'm attempting to maintain state as well for optimistic concurrency. I'm currently posting back a JSON request, but would be open to workable alternatives?
I am already posting a name/value collection with the following command:
$.ajax({
url: g_appPath + "/Rounding.aspx/Round/" + $("#Offe...
I want have two columns and based on a condition, include or remove a third. using all the if statements seems a bit redundant. Is there another way to do this?
<table style="width: 60%;">
<tr>
<th>Name</th>
<th>Age</th>
<th>Other</th>
</tr>
...
My ASP.NET MVC application fails with this error:
BC30456: 'Title' is not a member of 'ASP.views_controllername_viewname_aspx'.
But, Title doesn't appear anywhere except the first line of my View.
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of SomeThing)" %>
...
Hi There
I am building a very simple asp.net MVC file upload form.
Currently I have a problem creating the new database object that stores info on said file.
The code for the action method looks as follows:
[Authorize(Roles = "Admin")]
public ActionResult AddFile(Guid? id)
{
var org = organisationRepository.GetOrganisa...
Someone has asked me to look at their code to do a few little changes to the processing, but before I can get anywhere, I can't even run up the main page. It seems to be MVC, seems to have the right routes etc. It defaults to a ~/home from default.aspx and there seems to be a route in place, but I get a 404.
I've tried changing the rout...
I use a foreach in my View to loop over my strongly-typed Model and display a table. With only 25 rows and 7 columns, it takes about 280 msec. This seems slow. Is there some performance trick I should know for using loops in Views?
EDIT: My Controller takes data from an Azure Table and feeds it to a View using a ViewModel pattern. I...
I'm rendering a drop down where the text rendered in the drop down is too long for comfort. How can I go about limit the number of characters that display in the dropdown without having to go back to the controller?
<option value="<%=order.ID %>"><%=order.Item %></option>
thx
...
My problem is that I am trying to return a simple query that contains an object Story. The Story object has a UserId in the table which links to aspnet_users' UserId column. I have created a partial class for Story that adds the UserName property since it does not exist in the table itself.
The following query gets all stories; howeve...
As part of a unit test I am trying to mock the return value of FormsIdentity.Ticket.UserData
The following will NOT work but it should give an idea of what I am trying to do:
var principal = Mock<IPrincipal>();
var formsIdentity = Mock<FormsIdentity>();
formsIdentity.Setup(a => a.Ticket.UserData).Returns("aaa | bbb | ccc");
principal.S...
I am trying to use Telerik MVC extension with jQGrid in a ASP.NET MVC application. But I found they cannot nicely play each other, meaning I cannot have them working together in one View. No sure why? I guess it is because the place for js files. JqGrid needs to put the js library in Head, but Telerik requires before end of Body tag, bas...
I cannot use Google analytics because of their limitations on the API. They will not allow me to query more then 10,000 entries in one day. Since I have more then 10,000 pages Google Analytics will not work for me unless there is a way around that 10,000 limitation. I need to pull statistics on all my pages daily and it will be over 10,0...
I need the text of a link wrapped with <span> as in:
<a href="/foo.html"><span>Edit Group</span></a>
Can I do that with Html.ActionLink? This doesn't work:
<%=Html.ActionLink("<span>Edit Group</span>", "Edit", New With {.id = "bar"})%>
It just HTML encodes the < and > as < and >.
Is there a simple solution, or should I buil...
In ASP.NET WebForms you can reference appSettings directly in your markup with this syntax:
<%$ MySettingKey %>
Unfortunately this does not work in ASP.NET MVC because, as MSDN points out, this syntax only works in server controls.
I've run into a few situations where I would love to use this syntactic sugar in an ASP.NET MVC view (W...
I'm using NerdDinner as a guide for my first MVC/LINQ to SQL project. It discusses the use of the ViewModel pattern when a View needs data from multiple sources - in their example: Dinners and Countries (serves as the drop down list).
In my application, the problem is a bit different. It's not so much different data, rather data linke...
I have a jqGrid script like that:
jQuery(document).ready(function() {
var startDate = $("#startDate").Val();
jQuery("#sandgrid").jqGrid({
url: "/Deposit/Search?startDate='" + startDate + "'",
datatype: 'json',
mtype: 'GET',
height: 255,
width: 700,
colNames: ['Index', 'Name', 'Code'],
colModel: [
{...
I have an asp.net mvc application and I have a page for presenting meteo information. It looks like:
Temperature for today is 34-35 degrees
For this
34-35 degrees
, I have a method that assure that the text will be in format
[Number][Dot][Number]
called AssureCorrectDegressFormat().
Now I am asking where is it suited t...
I have a generic list List<T> and I want to create a view that iterates the list and spits out the output.
I'm coming up against a couple of issues:
I don't know how to get my view.aspx to understand T
I don't know how to get it to render the correct partial for T
For instance, if I pass in a list of CustomObject1 then I want to ren...