MVC :: 350ms Per "EditorFor" With Debugger Attached?

Jun 2, 2010

Have you experienced this?

[code]....

Symptoms

- For each identical text box I add in this way, I add about 350ms to the page load time while in debug mode. My page takes about 5-7 seconds to load or refresh in its current design, but times are somewhat variable.

- If I disable debugging, with or without controls on the page, response is fast, about 50ms.

- If I remove the controls from the page, the time drops to a fixed 200ms duration.

- CPU is 51% (dual-core) throughout the delay, and my laptop processor scales to 97% maximum frequency.

Contraindications:

- All of this is the initial GET, no posts or other activity involved.

- I've run SQL Profiler and found response times to be acceptable, the query is not repeated, and no unusual data activity is present.

- I've installed wireshark and do not see unusual network resolution or other activity.

My environment

- I've recently upgraded from VS2010 RC2 to RTM.

- I'm running Windows 7, and my computer is fairly new with minimal applications.

- My model is a persistence-aware EF repository, referenced in another project, using Windows Integrated

Security to connect to a SQL 2008 R2 database.

Here is an example:

[Code]....

Generates:[Code]....

Note that neither repeated access to the same expression or access to related entity properties caused degradation in my test.

View 9 Replies


Similar Messages:

Visual Studio :: Cannot Get Attached Debugger To Page In Website Folder

Feb 8, 2011

I'm using Vs2010 professional. I was working with a large WebSite (folder) project at work using IIS7 and tried to attach the debugger to the w3wp.exe for debugging an aspx page in IE8 after setting breakpoints in the javascript for the page and in the Page_Load in the code behind. I got a "first chance exception of type 'System.InvalidOperationException' occurred in System.dll" in my debug output, so I gave up for the moment. I created a default website project in the root of IIs7, and set it up as an application in IIs7 with the default app pool.

I tried entering a little javascript in the head, and set a breakpoint, and set a breakpoint again in the Page_Load. I attached the debugger again to w3wp.exe. I see the assemblies load in the debug output and nothing happens:

Ignoring attach security warning for process C:WindowsSystem32inetsrvw3wp.exe, owned by IIS APPPOOLDefaultAppPool [administrator]
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_64mscorlibv4.0_4.0.0.0__b77a5c561934e089mscorlib.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_64System.Webv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystemv4.0_4.0.0.0__b77a5c561934e089System.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Corev4.0_4.0.0.0__b77a5c561934e089System.Core.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Configurationv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xmlv4.0_4.0.0.0__b77a5c561934e089System.Xml.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.Build.Utilities.v4.0v4.0_4.0.0.0__b03f5f7f11d50a3aMicrosoft.Build.Utilities.v4.0.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Runtime.Cachingv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Runtime.Caching.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.RegularExpressionsv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.RegularExpressions.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_64System.Datav4.0_4.0.0.0__b77a5c561934e089System.Data.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Drawingv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.JScriptv4.0_10.0.0.0__b03f5f7f11d50a3aMicrosoft.JScript.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILCppCodeProviderv4.0_10.0.0.0__b03f5f7f11d50a3aCppCodeProvider.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Fileswebsite297987469de3b823App_global.asax.g3ldh1jy.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Activationv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Activation.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Extensionsv4.0_4.0.0.0__31bf3856ad364e35System.Web.Extensions.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Runtime.DurableInstancingv4.0_4.0.0.0__31bf3856ad364e35System.Runtime.DurableInstancing.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Mobilev4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.Mobile.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModelv4.0_4.0.0.0__b77a5c561934e089System.ServiceModel.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSMDiagnosticsv4.0_4.0.0.0__b77a5c561934e089SMDiagnostics.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xaml.Hostingv4.0_4.0.0.0__31bf3856ad364e35System.Xaml.Hosting.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Fileswebsite297987469de3b823App_Web_t1ltfooj.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Fileswebsite297987469de3b823App_Web_myfv4sgi.dll'
The thread '<No Name>' (0x22cc) has exited with code 0 (0x0).

I am using 64 bit Windows 7 Professional.

View 1 Replies

Visual Studio :: Visual Web Developer 2005 Express Edition Is Not Getting Attached To The Debugger?

Feb 24, 2010

Im having a strange problem which i never experienced before, the problem is my visual web developer 2005 express edition is not getting attached to the debugger, i mean when im running my web application it is not debugging the program if im putting any breakpoint, more over i uninstall and again installed visual web developer it worked fine for first time but again it is not working. i only difference is i have Internet explorer 8.I dont exactly know the problem. does any one faced similar problem

View 1 Replies

MVC :: Bug In EditorForModel W/ EditorFor Rendering?

Jan 18, 2010

I am learning MVC using the v2 release with Entity Framework v4. Let's say I have 3 objects Game, Points and Players. They are related in the following manner:Game has points and the Points can have a player associated with them ( 1 Game to many Points and a Point object can have one Player).

I am attempting to use the EditTemplates feature in MVC2 to render my views. In my Game Edit view I want to have the basic Game object information editable, and also the related Points objects. Currently I am utilizing "`<%= Html.EditorForModel() %>`"(Which seems pretty slow) to render the Edit View and then I have a specific Game and Point EditTemplates.

The data renders correctly and is editable for both the Game and Point information. When I go to perform the update and submit the form I receive the "Game" object in my Update ActionResult. The basic properties are populated for the Game object but any deep properties such as Points are not; they appear as null. If I look at the Request.Form variables in debug I can see the Points fields are being passed to the server but do not place themselves back into the Game object.

In my Game EditTemplate I am using the following to render the Points objects:

<%= Html.EditorFor(c => c.Points) %>

My Points EditTemplate looks like: [code]...

why this is rendering as "Points.Points[index] instead of Points[index]? I tried messing with the parameters in the EditFor:

<%= Html.EditorFor(c => c.Points,null,"Points") %>

but then the inputs render as Points.Points[index]

View 1 Replies

How To Get ID Of EditorFor With Nested Viewmodels In Mvc 2

Mar 30, 2010

So I have two nested view models, CreditCard -> BillAddress. I have a view, "EditBilling", that has EditorFor(CreditCard). The CreditCard EditorTemplate has EditorFor(BillAddress), and the BillAddress EditorTemplate has EditorFor(BillState).

The end result is a select list with id "CreditCard_BillAddress_BillState".

I need to reference this in javascript, thus need to know the ID. In other situations, with non-nested ViewModels, I have used the following code:

$('#<%= ViewData.ModelMetadata.PropertyName %>_BillState')

The problem here is that the ModelMetadata.PropertyName property is only aware of the current property, not the parent(s). So I end up with the following:

$('#BillAddress_BillState')

How does one go about getting the client ID of nested strongly typed helpers?

View 1 Replies

MVC :: 3 - EditorFor - Not Rendering Additional ViewData

Sep 18, 2010

Have seen in the MusicStore PDF witch can be sownloaded from [URL], That is it possible to render additional vew data. so: I have my ViewDataModel

[Code]....

I have the Model:

[Code]....

In my controller, I add the data into the model:

[Code]....

And I try to render it with Html.EditorFor.

[Code]....

My problem is here, that it only render Keyword

View 2 Replies

Create And EditorFor FileUpload In Asp Mvc 3 Razor?

Mar 18, 2011

The lack of an EditorFor file in asp.net mvc 3 seems like such a glaring omission I wonder: Is there some way that mvc handles file uploads that is just not publicized that well? As near as I can tell there is no built in way to handle file uploads.I'm just curious if the file upload capability is in fact there and I'm just missing it, or if it does not exist at all.

View 1 Replies

MVC :: MVC2 Templates - Nested EditorFor

Aug 15, 2010

I've been trying to something with the templating system in MVC2, but what I thought should be simple has not been successful. So now I question if it's possible or if I'm missing anything obvious. The scenario:

I have a base template as a strongly typed view that is set up in the ViewsSharedEditorTemplates folder...call it CommonItem.ascx. It wants a model item of type MyItemType.

I have a template that is a wrapper around the previous template, is also strongly typed of type MyItemType, residing in the same folder. Call this one CommonItemWrapper.ascx.The contents of CommonItemWrapper.ascx includes divs before/after a declaration Html.EditorForModel("CommonItem").

My expectation would be that the inner template (CommonItem) would be displayed within the outer template. Unfortunately the inner template never gets evaluated.

Am I missing something? Am I mistaken in thinking that templates can be nested in this manner? If so, is there another means to accomplish this?

View 1 Replies

MVC :: Definition Of EditorFor And ValidationMessageFor Helpers?

Feb 17, 2011

I am looking on Music store example:

In Model we have:

[Required(ErrorMessage = "An Album Title is required")]
public string Title { get; set; }

In a View we have a Razor code:

<div class="editor-field">
@Html.EditorFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title)
</div>

My questions: Where I can find definition of EditorFor and ValidationMessageFor helpers?
What is the meaning of "=>" in the above command?

View 1 Replies

MVC :: Add CSS And Style Properties To Html.editorfor ()?

May 1, 2010

I am generating the controls for an MVC Create Form using html.editorfor().How can i add style properties to whatever is created? For instance i have a control which is generated by html.editorfor() as a single line textbox but i want it to be a multiline textbox.

View 2 Replies

MVC :: How To Exclude One Of Model's Property From The Html.EditorFor

Sep 10, 2010

I would like to exclude one of model's property from the Html.EditorFor. I tried [HiddenInput(DisplayValue=false)] but it renders the property as an hidden input. This could potentially be a security problem. How can we completely exclude a field from Html.EditorFor?

View 5 Replies

Dynamically Add Items To A Collection In MVC2 Using EditorFor()?

Jul 12, 2010

I'm trying to do this: Editing a variable length list, ASP.NET MVC 2-style

In the post he mentions that it could be done with less code using Html.EditorFor(), but that it would be more difficult because of the indexes. Well, that's exactly what I want to do, and I don't know where to begin.

Update 1: Instead of generating a GUID for each item in the collection, I'd like to generate incremental indexes starting with 0. Right now the field names look like "gifts[GUID].value"; I would like them to be "gifts[0].value","gifts1.value" etc. but I don't understand how the collection keeps track and generates these indices.

View 1 Replies

MVC :: How To Add A Class To EditorFor When Classes Already Exist Because Of Unobtrusive

Nov 25, 2010

I'm trying to add a `Class` to the `EditorFor` Helper inside an `EditorTemplate`.

The problem is that because I'm using Unobtrusive Validation, the input element already has classes assigned to it.

Here is my EditorTemplate

[Code]....

And here is the output <input class="text-box single-line" id="BirthDate" name="BirthDate" type="text" value="08/08/1980" />

You can see here that the `datepicker` class has not been added, yet the "value" has been properly formatted.

Basically I can see that the `EditorTemplate` is working, but the `Class` is not being appended to the rest of the classes on the `<input>` element. Do any of you know how to fix this?

View 11 Replies

How To Read Arrays Generated By EditorFor Using JQuery

Feb 16, 2011

I am using EditorFor to display values.

The code for the values to be generated are as follows:

<tr>
<td>@Html.HiddenFor(m => m.ID)@Html.CheckBoxFor(m => m.Authorized)</td>
<td>@Html.DisplayFor(m => m.ID)</td>
<td>@Html.DisplayFor(m=>m.UserName) </td>
</tr>

My aim here is upon the Checkbox is being checked, I need to post the ID value as follows:

[Code]....

However, var ID = $(this).parent().parent().find('#ID').val(); is undefined. How can I he read the ID value from the following generated HTML:

<td><input id="Employee_0__ID" name="Employee[0].ID" type="hidden" value="1100" /><input id="Employee_0__Authorized" name="Employee[0].Authorized" type="checkbox" value="true" /><input name="Employee[0].Authorized" type="hidden" value="false" /></td>
<td>user </td>

View 2 Replies

MVC :: Can't Use An EditorFor, And Just Pass In The Model, As It Would Not Render Out The Dropdownlists?

May 9, 2010

Generally speaking we create a custom view for each page. So for an edit view of a car the model might be:

Car CarToEdit{ get; set;}
List<SelectListItem> CarManufacturers{ get; set;}

This has the advantage of giving a strongly typed view. It doesn't decouple the data layer well, but that is a separate issue. I'd then need to do something like (very approx syntax) :

<%= Html.DropDownList("ManufacturerId", Model.CarManufacturers)%>

Because of this, I can't use an EditorFor, and just pass in the model, as it would not render out the dropdownlists. So I think why not annotate the manufacturer field with UIHInt... great that works. ... but how do I pass in the data (both the manufacturerId, and the List<SelectListItem> to the hinted field?One solution is to have the UIHint control do a RenderAction. So the main view would include a line like:

[Code]....

Which would in turn go and render a view :

[Code]....

This works, but seems a little long winded. Can anyone suggest better ways of achieving this?Is anyone actually using UIHint?Also it would be good to be able to cache the output from the partial view (the dropdownlist) which is called from the RenderAction method... but output caches are is basically ignored on a render action (unless I've missed the point here).

View 2 Replies

C# - Set Order Of Appearance For Fields When Using Html.EditorFor In MVC 2?

Mar 9, 2010

I have the following classes in my Model:

public abstract class Entity : IEntity
{
[ScaffoldColumn(false)]

[code]...

View 1 Replies

MVC :: Validating Custom Types And Html.EditorFor() Templates?

Sep 2, 2010

I'm finding my self with the problem that if I do not show the Template for a "complex" object I have in the main view object I still get the errors in the summary. How do i get around this?

I've got a model with say:

->Persons (has its own editor template)
->Pets(has its own editor template)

In the create view I show each one depending if they are not null. But when I try to validate HouseType and say I have Persons not null and pets is null. I get errors of validation for pets.

How do I get around this?

View 4 Replies

Possible To Use Data Annotations For LabelFor,ValidationMessageFor, EditorFor With Strongly Typed Resources?

Feb 26, 2010

I would like to use DataAnnotations in my ASP.NET MVC application. I have strongly typed resources class and would like to define in my view models:

[DisplayName(CTRes.UserName)]
string Username;

CTRes is my resource, automatically generated class. Above definition is not allowed. Are there any other solutions?

View 3 Replies

Using IE 8 Javascript Debugger?

Mar 29, 2011

I'm trying to debug a VS 2010 Web app and I'm using the IE 8 debugger for Javascript. Does anyone know what causes this message? I don't have any other debuggers going. There are no other processes going on.

View 7 Replies

Can IE Debugger Be Disabled?

Mar 2, 2011

We have recently had some security issues with our web app where users have actually gone into the IE debugger tool and enabled a "Submit" button and saved data they shouldn't have. So...my question is....is their anyway to prevent this from happening?

View 4 Replies

Cannot Get Work VS 2010 And IE Debugger

Mar 29, 2011

using VS 2010 and the IE Debugger. I can't get it to work for nothing. The IE Debugger works fine with all other VS versions. I've done the necessary steps in the "Internet Options" "Advanced" tab.

View 16 Replies

VS2010 Debugger Not Responding

Jul 19, 2010

I am working on a large website that is comprised of multiple applications. We are still using web forms. All of the applications are in a common directory that serves as the root directory in my localhost. The site was originally built in 2005 on 3.5 but has been migrated to 2010 still running on 3.5 (2.0). My problem is that my debugger will run once. After I stop debugging I cannot run the debugger again - it just hangs. My locals and watch windows open but do not populate and the browser never opens. We are running Visual Studio 2010 Ultimate on Windows 7 32 bit.

View 1 Replies

Web.Config Transformations In The Debugger?

Jan 24, 2010

When you run an application in the debugger, it appears to not apply the transformations to the web.config based on your build selection. Is this the case or am I missing something? It appears to be working just fine if I publish to local IIS, just does not seem to work in the debugger.

View 1 Replies

Trying To Connect To A Remote Debugger For VS2008-SP1?

Jun 28, 2010

I'm having problems trying to connect to a remote debugger for VS2008-SP1.I'm trying to debug an ASP.NET application on a Win2k8 VM. The host PC (WinXPsp3) running Visual Studio is connected to an AD domain, and is logged in with a domain account. The VM is not connected to the domain and is logged in with the local Administrator account.The VisualStudio remote debugger requires authentication in both directions, so I would normally add my domain account as a local admin on the VM and allow debug permissions for that user.Since the VM is not on the domain, I can't add my domain account as a local admin. What can I do to get remote debugging going between my PC and the VM?

View 3 Replies

MVC :: Route Debugger By Stephen Walther?

Feb 14, 2010

I'm trying to follow Stephen Walther's MVC tip: Build a Controller to Debug Your Custom Routes (http://stephenwalther.com/blog/archive/2008/08/03/asp-net-mvc-tip-29-build-a-controller-to-debug-your-custom-routes.aspx) but I'm getting this error "Object reference not set to an instance of an object." when getting the values of the RouteTable.

Function Index() As ActionResult
Dim context As HttpContextBase = Me.ControllerContext.HttpContext
Dim sb As New StringBuilder
For Each namedRoute As Route In RouteTable.Routes
'Dim dataTokens = formatValues(namedRoute.Defaults) 'this looks good
Dim rd = namedRoute.GetRouteData(context)
'sb.Append(dataTokens & "<br>") 'this looks good
sb.Append(formatValues(rd.Values)) 'this one is not, error here [:(]
Next
End Function
Private Function formatValues(ByVal values As RouteValueDictionary) As String
If values Is Nothing Then
Return "N/A"
End If
Dim col = New List(Of [String])()
For Each key As String In values.Keys
Dim value As Object = If(values(key), Nothing)
col.Add((key & "=") + value.ToString())
Next
Return String.Join(", ", col.ToArray())
End Function

You have to reference the debugger file (RouteDebugger.dll) provided by Stephen.

I'm trying to get the Route Name's for each controller.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved