To enable 64Bit Web projects in Visual Studio 2012 via IIS Express, run the following command.
reg add HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\WebProjects /v Use64BitIISExpress /t REG_DWORD /d 1
And restart Visual studio.
To enable 64Bit Web projects in Visual Studio 2012 via IIS Express, run the following command.
reg add HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\WebProjects /v Use64BitIISExpress /t REG_DWORD /d 1
And restart Visual studio.
It is possible to get an iframe to react and auto adjust simply like it is not there in CrossDomains situations.
This solution is tested on IE8,9,10 and Chrome and Firefox.
Only requirement – you have to have know which server that implements the iframe.
To achieve this – we needed a communication channel between the two pages. To do this we used the javascript messaging system.
IFrame content script:
$(window).load(function () { UpdateDimensions(); }); function UpdateDimensions() { try { var height = $("#form1").height() + 30; var width = $(".SiteIntegrationSizePanel").outerWidth() + 100; if (window.postMessage && ReferalUrl != undefined) parent.postMessage(height + "," + width, ReferalUrl); } catch (c) { alert(c.message); } }
The SiteIntegrationSizePanel class is a fixed width container. That can vary from page to page.
Rerferal url is the domain that hosts the IFrame.
Described here https://developer.mozilla.org/en-US/docs/DOM/window.postMessage
Host site:
if (window.addEventListener) { window.addEventListener('message', OnLoadPage, false); } else if (window.attachEvent) { window.attachEvent('message', OnLoadPage); } function OnLoadPage(event) { var iframe = document.getElementById(‘SiteIntegrationIFrame'); if (event.data.indexOf(",") > 0) { var height = event.data.split(",")[0]; var width = event.data.split(",")[1]; iframe.height = parseInt(height); iframe.width = parseInt(width); } window.scrollTo(0, 0); }
The SiteIntegrationIFrame id is the IFrame
Add the following CSS to remove the dotted selection border in IE.
textarea,
input,
a,
a:hover,
a:active,
a:focus
{
outline: 0px!important;
}
In a MVC WebApi application, all enums are default serialized to their integer representation.
Want to serialize all enums to name instead?
Put in Global.asax:
JsonSerializerSettings jSettings = new JsonSerializerSettings(); jSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings = jSettings;
If Cisco AnyConnect VPN software fails to connect on Windows 8 it may be because the name is incorrect in registry.
Use that name as “DisplayName” in registry:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vpnva]
“DisplayName”=”Cisco AnyConnect VPN Virtual Miniport Adapter for Windows x64”
html:
<asp:CheckBox CssClass="ChooseAll" Text="Choose all" runat="server" /><br /> <asp:CheckBox CssClass="CheckBoxItem" Text="Checkbox 1" runat="server" /><br /> <asp:CheckBox CssClass="CheckBoxItem" Text="Checkbox 2" runat="server" /><br /> <asp:CheckBox CssClass="CheckBoxItem" Text="Checkbox 3" runat="server" /><br />
jquery:
$(document).ready(function () { $(".ChooseAll input:checkbox").change(function () { var checked = $(this).attr('checked') || false; $(".CheckBoxItem input:checkbox").attr('checked', checked); }); $(".CheckBoxItem input:checkbox").change(function () { var checked = ($(".CheckBoxItem input:checked").length == $(".CheckBoxItem input:checkbox").length); $(".ChooseAll input:checkbox").attr('checked', checked); }); });
If you have problems compiling or publishing from Visual Studio 2012 on Windows 8 it may be because UAC is not fully disabled. It is not enough to set UAC to “Never notify”.
Edit in regedit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Key: EnableLUA
Value: 0
(Note that you are not able to run metro apps when this hack is done)
If your ASA box suddenly blocks all personal VPN calls from your clients, and you are getting a VPN 619 Error. And firewall logs in the line of “Teardown dynamic TCP translation…”
Try to fire this command: “fixup protocol pptp 1723”
This will fix the error instantly !
We have all been there. After a Hard Days Night, with a cup of Joe and a long day ahead of you.
The last thing you need is to wait for the IIS to wake up.
This can be avoided in a couple of ways. Either by buying expensive crappy software, or by running custom scripts.
That’s all fine and good, but why not implement the functionality right into the ASP.NET app itself. That’s exactly what we will do
In the Application_Start() function ( inside the Global.asax ) put the following code:
protected void Application_Start(object sender, EventArgs e) { KeepAlive.KeepISSAlive(); } public static class KeepAlive { public static void KeepISSAlive() { // Remove any existing job Action existingAction = HttpContext.Current.Cache["KeepIISAlive"] as Action; if (existingAction is Action) { HttpContext.Current.Cache.Remove("KeepIISAlive"); existingAction.EndInvoke(null); } Action work = () => { while (true) { Thread.Sleep(60000); WebClient keepIISAlive = new WebClient(); try { keepIISAlive.UploadString("YourUrl.com", string.Empty); } catch (Exception exception) { } finally { keepIISAlive.Dispose(); } } }; work.BeginInvoke(null, null); // Add the action to the cache instance HttpContext.Current.Cache.Add( "KeepIISAlive", work, null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, CacheItemPriority.Normal, (key, value, reason) => { KeepISSAlive(); } ); } }
Hope it helps !
Thanks to webdev_hb for this great hint !