Saturday, March 5, 2016

ASP.Net Update Panel GridView does not fire Child Trigger events due to Validator in Template Column

ASP.Net Update Panel GridView does not fire Child Trigger events due to Validator in Template Column

Found this issue while working on a GridView page, when we have a RequiredFieldValidator which should work in a FooterTemplate
for new records, this prevents Child control events to fire such as Button, the safe bet is to avoid Asp.Net Validators and use
JS client side to validate when dealing with Update Panels with GridViews.

This Doesnt Work:
  <asp:TemplateField HeaderText="Resource Last Name" ItemStyle-Width = "100px" SortExpression="Resource_Last_Name">
                                                       <ItemTemplate>
                                                           <asp:Label ID="lblResource_Last_Name" runat="server" Text='<%# Eval("Resource_Last_Name") %>'></asp:Label>
                                                           <asp:TextBox ID="txtResource_Last_Name" runat="server" Text='<%# Eval("Resource_Last_Name") %>' Visible="false"></asp:TextBox>
                                                       </ItemTemplate>
                                                       <FooterTemplate>
                                                           <asp:TextBox ID="txtResource_Last_Name" runat="server"></asp:TextBox>
                                                           <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtResource_Last_Name"
                                                               Display="Dynamic" ErrorMessage="You must enter a last name." ForeColor="">*</asp:RequiredFieldValidator>
                                                       </FooterTemplate>
                                                       <FooterStyle Wrap="False" />
                                                   </asp:TemplateField>




This is OK:
 <asp:TemplateField HeaderText="Resource Last Name" ItemStyle-Width = "100px" SortExpression="Resource_Last_Name">
                                                       <ItemTemplate>
                                                           <asp:Label ID="lblResource_Last_Name" runat="server" Text='<%# Eval("Resource_Last_Name") %>'></asp:Label>
                                                           <asp:TextBox ID="txtResource_Last_Name" runat="server" Text='<%# Eval("Resource_Last_Name") %>' Visible="false"></asp:TextBox>
                                                       </ItemTemplate>
                                                       <FooterTemplate>
                                                           <asp:TextBox ID="txtResource_Last_Name" runat="server"></asp:TextBox>
                                                       </FooterTemplate>
                                                       <FooterStyle Wrap="False" />
                                                   </asp:TemplateField>

Visual Studio Environment Tuning, Tweak Debug and Build Settings to speed up Dev

Found this very helpful, especially if ur stuck on some VS 2010 projects like I am:
Slash Compile Times!

Here are a few more notes:
Added some other tune items found on : geocortex here and a few other places

More refs for VS 2010 HELL:
Compilation:
http://stackoverflow.com/questions/280751/what-is-the-best-practice-for-copy-local-and-with-project-references

Add
  <compilation ... batch="false"  optimizeCompilations="true"  />

 modifying your symbol settings.
uncheck  "Only Build startup projects and dependencies on Run" checkbox in Tools\Options.

Overall Performance
Disable Track Changes. (Tools\Options\Text Editor\General\Track changes)

Disable Navigation Bar (Tools\Options\Text Editor\C#)

Disable "Track Active Item in Solution Explorer" (Tools\Options\Projects and Solutions)

Disable Detect when file is changed outside the environment

(Tools\Options\Environment \Documents)


DEBUGGING:
an disable it by setting the environment variable _NO_DEBUG_HEAP to 1. You can set it at the system level: Control Panel ? System ? Advanced system settings ? Environment Variables.

VIA:
http://preshing.com/20110717/the-windows-heap-is-slow-when-launched-from-the-debugger/


temp Files:
Delete: C:\Users\krintoul\AppData\Local\Microsoft\WebSiteCache

and

C:\Users\krintoul\AppData\Local\Temp\Temporary ASP.NET Files\siteName

disable Edit & Continue option.. Tools -> Options -> Debugging -> Edit & Continue

Go to OPTIONS>ENVIRONMENT..under Visual Experience, untick “Use Hardware Graphics Acceleration If Available” for some weird reason your dev environment should loosen / speed straight up. Works on all our boxes

Disable Addins:
Goto Tools>Options>Environment>Add In Security
You will see a checkbox with “allow add in components to load” .Just uncheck it. Restart the IDE and check the lightning speed of the IDE now…


Web Debug:
Switching from Source to Design in my VS 2012 went very slow.
The solution of this problem was as follow
- Click on the down arrow right at the menu option Start (in the standard bar)

Compat:
Windows Compatibility tab, Now select this option “Disable Desktop Composition”..
- Select Browse with…
- Select Internal Web Browser


Compatibility tab, Now select this option “Disable Desktop Composition”..

Auto Updates
Hey guys, if none of these work for you try “Tools”-”Options”-”Enviroments and Updates” and disable “Automatically Check for Updates.

Default Item
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0 –> DefaultOpenProjItemLocation. Check this registry key.


CPU Tuning:
most CPU time used by method:
Features.FindVsixVersion from System.Core.ni.dll
full chain: mscorlib.ni.dll -> IsEnabled -> ShouldEnable -> FindVsixVersion
tried remove old vs 2012 and 2013 same pure perfomance…
http://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/vs-2015-comunity-pure-startup-time/fd8b196d-1465-4339-9735-1c9604eacfe6



Logging:
Add the following values to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Add:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
DWORD EnableLog set value to 1
String LogPath set value to folder for logs (e.g. C:\FusionLog\)


OR:

'll find the "Fusion Log Viewer" under Microsoft SDK\Tools (just type "Fusion" in the start menu on Vista or Windows 7/8). Launch it, click the Settings button, and select "Log bind failure" or "Log all binds".