[{"data":1,"prerenderedAt":6325},["ShallowReactive",2],{"tag-aspnet":3},{"tag":4,"articles":24},{"id":5,"title":6,"body":7,"description":14,"extension":15,"img":16,"meta":17,"name":18,"navigation":19,"path":20,"seo":21,"stem":22,"__hash__":23},"tags\u002Ftags\u002Faspnet.md","Aspnet",{"type":8,"value":9,"toc":10},"minimark",[],{"title":11,"searchDepth":12,"depth":12,"links":13},"",2,[],"ASP.NET is an open source web framework, created by Microsoft, for building modern web apps and services with .NET.","md","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"aspnet",true,"\u002Ftags\u002Faspnet",{"description":14},"tags\u002Faspnet","SlUGLdZWQy8mYOWC6OetgJkwVulWNURoVHeuESIDleI",[25,308,446,489,586,623,757,892,975,1115,1236,1312,1380,1931,2028,3955,5154,5182,5239,5286,5359,5432,5536,5576,6099,6272],{"id":26,"title":27,"author":28,"body":29,"createdAt":297,"description":298,"extension":15,"img":299,"meta":300,"navigation":19,"path":301,"seo":302,"stem":303,"tags":304,"updatedAt":297,"__hash__":307},"articles\u002Farticles\u002Fstarting-jquery-and-get-the-downloads-and-patchesfor-visual-studio-net-2008.md","Starting jQuery and Get the downloads and patches(for Visual Studio.NET 2008)","[object Object]",{"type":8,"value":30,"toc":295},[31,46,54,291],[32,33,34,35,41,42,45],"p",{},"1.) Download install VS.NET 2008 SP1 patch   Visual Studio 2008 SP1 has the following patch to allow IntelliSense with jQuery found\n",[36,37,40],"a",{"href":38,"target":39},"http:\u002F\u002Fcode.msdn.microsoft.com\u002FKB958502\u002FRelease\u002FProjectReleases.aspx?ReleaseId=1736","_blank","here",".  Note: this is a patch that is applied\nafter .NET 3.5 SP1 and Visual Studio 2008 SP1.  Information about this patch can be found\n",[36,43,40],{"href":44,"target":39},"http:\u002F\u002Fblogs.msdn.com\u002Fwebdevtools\u002Farchive\u002F2008\u002F11\u002F07\u002Fhotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx",".\nI did find that the vsdoc.js version must match the version of jquery in order for the intellisense to function correctly.  If the versions mismatch intellisense\nwill not work.",[32,47,48,49,53],{},"2.) ",[36,50,52],{"href":51,"target":39},"http:\u002F\u002Fdocs.jquery.com\u002FDownloading_jQuery","Download"," jQuery documentation library  ",[55,56,57,67,73,76,214,220,285,288],"blockquote",{},[32,58,59,60,62,63],{},"3.) ",[36,61,52],{"href":51,"target":39}," jQuery \n",[64,65],"img",{"alt":11,"src":66},"\u002Farticles\u002Fimages\u002FAsp.netCompilationModels_86E6\u002Fimage_4a.png",[32,68,69,70],{},"4.) Copy both 2 and 3 to your solution Scripts folder\n",[64,71],{"alt":11,"src":72},"\u002Farticles\u002Fimages\u002FAsp.netCompilationModels_86E6\u002Fimage_8.png",[32,74,75],{},"5.) In your aspx reference the jquery file",[77,78,82],"pre",{"className":79,"code":80,"language":81,"meta":11,"style":11},"language-js shiki shiki-themes github-light github-dark","\u003Cscript src=\"Scripts\u002Fjquery-1.2.6.min.js\" type=\"text\u002Fjavascript\">\u003C\u002Fscript>    or    \u003Casp:ScriptManager runat=\"server\" ID=\"scriptmanager1\">     \n    \u003CScripts>      \n        \u003Casp:ScriptReference Path=\"~\u002FScripts\u002Fjquery-1.2.6.min\" \u002F>      \n    \u003C\u002FScripts>      \n\u003C\u002Fasp:ScriptManager> \n","js",[83,84,85,154,165,190,200],"code",{"__ignoreMap":11},[86,87,90,94,98,102,106,110,113,115,118,121,123,126,128,131,134,136,139,143,145,148,151],"span",{"class":88,"line":89},"line",1,[86,91,93],{"class":92},"sVt8B","\u003C",[86,95,97],{"class":96},"s9eBZ","script",[86,99,101],{"class":100},"sScJk"," src",[86,103,105],{"class":104},"szBVR","=",[86,107,109],{"class":108},"sZZnC","\"Scripts\u002Fjquery-1.2.6.min.js\"",[86,111,112],{"class":100}," type",[86,114,105],{"class":104},[86,116,117],{"class":108},"\"text\u002Fjavascript\"",[86,119,120],{"class":92},">\u003C\u002F",[86,122,97],{"class":96},[86,124,125],{"class":92},">    or    ",[86,127,93],{"class":104},[86,129,130],{"class":100},"asp",[86,132,133],{"class":92},":ScriptManager runat",[86,135,105],{"class":104},[86,137,138],{"class":108},"\"server\"",[86,140,142],{"class":141},"sj4cs"," ID",[86,144,105],{"class":104},[86,146,147],{"class":108},"\"scriptmanager1\"",[86,149,150],{"class":104},">",[86,152,153],{"class":92},"     \n",[86,155,156,159,162],{"class":88,"line":12},[86,157,158],{"class":92},"    \u003C",[86,160,161],{"class":141},"Scripts",[86,163,164],{"class":92},">      \n",[86,166,168,171,173,176,179,182,184,187],{"class":88,"line":167},3,[86,169,170],{"class":92},"        \u003C",[86,172,130],{"class":96},[86,174,175],{"class":92},":",[86,177,178],{"class":141},"ScriptReference",[86,180,181],{"class":100}," Path",[86,183,105],{"class":104},[86,185,186],{"class":108},"\"~\u002FScripts\u002Fjquery-1.2.6.min\"",[86,188,189],{"class":92}," \u002F>      \n",[86,191,193,196,198],{"class":88,"line":192},4,[86,194,195],{"class":92},"    \u003C\u002F",[86,197,161],{"class":141},[86,199,164],{"class":92},[86,201,203,206,208,211],{"class":88,"line":202},5,[86,204,205],{"class":104},"\u003C\u002F",[86,207,130],{"class":100},[86,209,210],{"class":92},":ScriptManager",[86,212,213],{"class":104},">\n",[32,215,216],{},[217,218,219],"strong",{},"Some Quick Tips",[221,222,223,227,240,246,259,265,271],"ul",{},[224,225,226],"li",{},"If you are using a master page the script reference only needs to exist in the master page",[224,228,229,230,233,234,236,237,239],{},"javascript intellisense will not work in user controls by default as\nthe user control doesn’t have a reference to the js file.  A work around (use the following at the top of the user control).  At runtime ASP.NET will\nnot render this tag however Visual Studio will evaluate the script and provide intellisense",[231,232],"br",{},"\n\u003C% if (false) { %>",[231,235],{},"\n      \u003Cscript src=”..\u002FScripts\u002Fjquery-1.2.6.min.js” type=”text\u002Fjavascript”>",[231,238],{},"\n\u003C% } %>",[224,241,242,243,245],{},"a recommended method of including js files is to create one js file which entail will include references to any number of specific js files, then on your web page\ninclude a reference to this one single js file",[231,244],{},"\n\u003Creference path=”~\u002FScripts\u002Fjquery-1.2.6.min.js” \u002F>",[224,247,248,249,251,254,255,258],{},"a good approach is to remove the version number from the jquery files to allow easier updates to these files in the future",[231,250],{},[217,252,253],{},"Path(s) for Script References","     * ",[217,256,257],{},"File-Relative Paths"," i.e. ..\u002F..\u002Ffile.js This type of path\nis relative to the currently loaded file.  Support - ASP.NET Web forms \u002F MVC",[224,260,261,264],{},[217,262,263],{},"App-Relative Paths"," i.e. ~\u002Ffolder\u002Ffile.js  Is calculated\nfrom the base of your application.  ASP.NET Web forms supports this type of path however\nthe path must be within a scriptreference tag or select asp.net\ncontrols which have runat=”server”",[224,266,267,270],{},[217,268,269],{},"Site-Relative Paths"," i.e. \u002Ffolder\u002Ffile.js  Is calculated from the base of your site.  Supported\nby ASP.NET Web forms \u002F MVC however is not supported by Visual Studio",[224,272,273,276,277,280,284],{},[217,274,275],{},"Absolute Paths"," i.e. ",[36,278],{"href":279},"http:\u002F\u002Fsite\u002Ffolder\u002Ffile.js",[36,281,279],{"href":279,"rel":282},[283],"nofollow"," \nSupported by ASP.NET Web forms \u002F MVC and Visual Studio   If using Visual Studio(ASP.NET Web forms) recommended to use App-Relative paths ~\u002Ffolder\u002Ffile.js. ",[32,286,287],{},"If using MVC use file-relative paths.",[64,289],{"src":290,"alt":11},"\u002Farticles\u002Fimages\u002Fjquery.jpg",[292,293,294],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":11,"searchDepth":12,"depth":12,"links":296},[],"2020-06-11T20:28:49.852Z",null,"\u002Farticles\u002Fimages\u002Fimage_thumb.png",{},"\u002Farticles\u002Fstarting-jquery-and-get-the-downloads-and-patchesfor-visual-studio-net-2008",{"title":27,"description":298},"articles\u002Fstarting-jquery-and-get-the-downloads-and-patchesfor-visual-studio-net-2008",[18,305,306],"javascript","visualstudio","CaoqzxSPqdjjJIKDlApGzP7mizluXjytJfH68p7chaE",{"id":309,"title":310,"author":298,"body":311,"createdAt":436,"description":437,"extension":15,"img":382,"meta":438,"navigation":19,"path":439,"seo":440,"stem":441,"tags":442,"updatedAt":436,"__hash__":445},"articles\u002Farticles\u002Fancm-in-process-start-failure-shenanigans.md","ANCM InProcess Start Failure Shenanigans",{"type":8,"value":312,"toc":434},[313,321,344,351,360,363,368,370,385,388,415,418,421,431],[32,314,315,316,320],{},"If you are using .NET Core and have not received the following error\u002Fexception message I will send you $1.00.  Let me know!  ",[317,318,319],"b",{},"HTTP Error 500.30 - ANCM In-Process Start Failure","\nCommon solutions to this issue:",[221,322,323,326,329,335,338,341],{},[224,324,325],{},"The application failed to start",[224,327,328],{},"The application started but then stopped",[224,330,331,332],{},"The application started but threw an exception during startup   ",[317,333,334],{},"Troubleshooting steps:",[224,336,337],{},"Check the system event log for error messages",[224,339,340],{},"Enable logging the application process' stdout messages",[224,342,343],{},"Attach a debugger to the application process and inspect",[32,345,346,347,350],{},"I have ran into this plenty of times already.  There are many reasons but at it’s root dotnet is not able to start up for one of many reasons.  As I run into my issues I will update this post with them.  So far, with ASP.NET Core 3.1.1  1. The IIS Application Pool – Advanced Settings “Enable 32-Bit Applications” – ",[217,348,349],{},"setting to False fixed my issue ","(this site was deployed to an on-premise IIS Server)  2. Azure installation – It was more difficult to identify the source of the issue as I was not working directly with IIS (Internet Information Server).  I first tried logging via App Service Logs,  and view the streaming logs which led me to error message similar to..",[32,352,353,359],{},[354,355,356,357],"em",{},"”IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.\u003C\u002Fli>     \u003Cli>IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.”",[231,358],{},"\nI then worked towards running the web application from command line to hope it gave me more information.\ni.e. Diagnostic Console – Debug Console then running the web assembly via “dotnet web.dll” (in this case my application was called Web). ",[32,361,362],{},"This gave me a much better startup.cs issue. I had good sense to recognize the issue\u002Fexception was within my startup class. \nI had my first real clue from the following message…",[32,364,365],{},[354,366,367],{},"”Unhandled exception. System.IO.DirectoryNotFoundException: D:\\home\\site\\wwwroot\\Scripts\\ at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters) at\nMicrosoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root) at Web.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider, LinkGenerator lin”",[354,369],{},[32,371,372],{},[354,373,374],{},[36,375,377],{"href":376},"\u002Farticles\u002Fimages\u002Fimage_637160171567190817.png",[64,378],{"title":379,"style":380,"border":381,"alt":379,"src":382,"width":383,"height":384},"image","border: 0px currentcolor; border-image: none; display: inline; background-image: none;",0,"\u002Farticles\u002Fimages\u002Fimage_thumb_637160171568626232.png",722,343,[32,386,387],{},"I had used in prior 2.1 Core solution a scripts static directly which did not exist with this 3.1 solution.",[77,389,393],{"className":390,"code":391,"language":392,"meta":11,"style":11},"language-cs shiki shiki-themes github-light github-dark","app.UseStaticFiles(new StaticFileOptions   {    \nFileProvider = new PhysicalFileProvider\n(Path.Combine(Directory.GetCurrentDirectory(), \"Scripts\")),\nRequestPath = \"\u002FScripts\" });\n","cs",[83,394,395,400,405,410],{"__ignoreMap":11},[86,396,397],{"class":88,"line":89},[86,398,399],{},"app.UseStaticFiles(new StaticFileOptions   {    \n",[86,401,402],{"class":88,"line":12},[86,403,404],{},"FileProvider = new PhysicalFileProvider\n",[86,406,407],{"class":88,"line":167},[86,408,409],{},"(Path.Combine(Directory.GetCurrentDirectory(), \"Scripts\")),\n",[86,411,412],{"class":88,"line":192},[86,413,414],{},"RequestPath = \"\u002FScripts\" });\n",[32,416,417],{},"Once I removed this reference to \u002FScripts things worked and I was up and running. ",[32,419,420],{},"So, just note that this ANCM error is pretty good indication that something is wrong with Startup.cs class and so you really will be looking for logs for some indication as to what.",[32,422,423],{},[36,424,426],{"href":425},"\u002Farticles\u002Fimages\u002Fimage_637160171569717383.png",[64,427],{"title":379,"style":380,"border":381,"alt":379,"src":428,"width":429,"height":430},"\u002Farticles\u002Fimages\u002Fimage_thumb_637160171570874206.png",534,256,[292,432,433],{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":11,"searchDepth":12,"depth":12,"links":435},[],"2020-01-30T21:39:17.213Z","Common issue with .net core solutions when you deploy to a server and get ANCM In-Process failures",{},"\u002Farticles\u002Fancm-in-process-start-failure-shenanigans",{"title":310,"description":437},"articles\u002Fancm-in-process-start-failure-shenanigans",[443,18,444],"azure","netcore","uO_1neDf1NscBqxD75q-Jvy9EuQmMV849La98mkWnks",{"id":447,"title":448,"author":298,"body":449,"createdAt":480,"description":481,"extension":15,"img":298,"meta":482,"navigation":19,"path":483,"seo":484,"stem":485,"tags":486,"updatedAt":480,"__hash__":488},"articles\u002Farticles\u002Fsql-server-reporting-services-ssrs-how-to-open-ssrs-project.md","SQL Server Reporting Services (SSRS)–How to open SSRS Project",{"type":8,"value":450,"toc":478},[451,454,457],[32,452,453],{},"When you're trying to open your SSIS or SSRS solution, you will get a message that the migration has failed or\n'The application which this project type is based on was not found.'",[32,455,456],{},"You can open rptproj files with Visual Studio 2017 with an extension.  Follow the following steps to get going.",[221,458,459,462,465,472,475],{},[224,460,461],{},"Open ‘Microsoft Visual Studio 2017‘.",[224,463,464],{},"In the menu bar, expand ‘Tools‘, then choose ‘Extensions & Updates‘. to install an extension.",[224,466,467,468,471],{},"Search for ‘",[217,469,470],{},"Microsoft Reporting Services Projects","‘, and install this extension.",[224,473,474],{},"To complete the installation, shut down all windows and instances of Microsoft Visual Studio 2017. Then the installer will start.",[224,476,477],{},"Try to open your solution or projects (*.rptproj) again.",{"title":11,"searchDepth":12,"depth":12,"links":479},[],"2019-03-03T21:18:35.918Z","Ever try to open an older SQL Server Reporting Services (SSRS) project and do not know what product it opens with?  SSRS and how to add\u002Fmanage reports always seems to be a problem.  Well, Visual Studio 2017 has an extension that you can use to open the older rptproj files.  Give it a go.",{},"\u002Farticles\u002Fsql-server-reporting-services-ssrs-how-to-open-ssrs-project",{"title":448,"description":481},"articles\u002Fsql-server-reporting-services-ssrs-how-to-open-ssrs-project",[487,18],"sqlserver","mikQhQ-Cqxon8GSkXwjPOgBtZoZDTnq6qSx9SMWr80o",{"id":490,"title":491,"author":298,"body":492,"createdAt":578,"description":579,"extension":15,"img":507,"meta":580,"navigation":19,"path":581,"seo":582,"stem":583,"tags":584,"updatedAt":578,"__hash__":585},"articles\u002Farticles\u002Fattaching-to-net-debugger-wvisual-studio-aspnet-core.md","Attaching to .NET Debugger w\u002FVisual Studio ASP.NET Core",{"type":8,"value":493,"toc":576},[494,497,519,522,526,529,532,542,545,554,557,566],[32,495,496],{},"Attaching from within Visual Studio to the dotnet.exe process Debug – Attach to Process",[55,498,499,500,499,510,499],{},"  \n",[36,501,503],{"href":502},"\u002Farticles\u002Fimages\u002Fimage_thumb3_636794037223872773.png",[64,504],{"style":505,"title":506,"src":507,"alt":506,"width":508,"height":509,"border":381},"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;","image_thumb3","\u002Farticles\u002Fimages\u002Fimage_thumb3_thumb_636794037227151161.png",166,244,[36,511,513],{"href":512},"\u002Farticles\u002Fimages\u002Fimage_thumb4_636794037229825895.png",[64,514],{"style":515,"title":516,"src":517,"alt":516,"width":509,"height":518,"border":381},"border: 0px currentcolor; display: inline; background-image: none;","image_thumb4","\u002Farticles\u002Fimages\u002Fimage_thumb4_thumb_636794037232542538.png",174,[55,520,521],{},"  \nThis works fine, however to me seems too many clicks\u002Fsteps to do efficiently.  \n",[36,523,525],{"href":524},"https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=arcticdev.AnotherAttachToAny","AnotherAttachToAny",[32,527,528],{},"Once installed, I then set keystroke shortcut keys to execute the above steps.  This is how it is currently configured to me.  You can see I have Alt-A setup to immediately attach to the w3process (IIS), and Alt-D attaches to dotnet.exe. ",[32,530,531],{},"This is one keystroke to attach to the running process and any breakpoints within my .net code are hit and I can then step through.",[32,533,534],{},[36,535,537],{"href":536},"\u002Farticles\u002Fimages\u002Fimage_636794037234623240.png",[64,538],{"style":539,"title":379,"src":540,"alt":379,"width":509,"height":541,"border":381},"margin: 0px; display: inline; background-image: none;","\u002Farticles\u002Fimages\u002Fimage_thumb_636794037237173898.png",62,[32,543,544],{},"Configuration of this extension is done through Tools – Options – Another Attach To Any",[32,546,547],{},[36,548,550],{"href":549},"\u002Farticles\u002Fimages\u002Fimage_636794037240524929.png",[64,551],{"style":539,"title":379,"src":552,"alt":379,"width":509,"height":553,"border":381},"\u002Farticles\u002Fimages\u002Fimage_thumb_636794037243711700.png",193,[32,555,556],{},"Setting up a keystroke to one of the above commands is done through Tools – Options – Keyboard",[32,558,559],{},[36,560,562],{"href":561},"\u002Farticles\u002Fimages\u002Fimage_636794037246961946.png",[64,563],{"style":539,"title":379,"src":564,"alt":379,"width":509,"height":565,"border":381},"\u002Farticles\u002Fimages\u002Fimage_thumb_636794037249700449.png",191,[32,567,568,569],{},"This single extension has saved me hundreds of hours ",[64,570],{"className":571,"src":574,"alt":575},[572,573],"wlEmoticon","wlEmoticon-smile","\u002Farticles\u002Fimages\u002FwlEmoticon-smile_636794037251738341.png","Smile",{"title":11,"searchDepth":12,"depth":12,"links":577},[],"2018-12-03T03:15:25.405Z","You have a website up and running, and now you want to connect the Visual Studio Debugger.  This is often the case if you do not start with F5 - Debug to start the browser and automatically attach to the .net debugger.  In reality, I almost never push F5.  Instead, I attach to the debugger on the fly with the approach below.  Take a moment to check it out.",{},"\u002Farticles\u002Fattaching-to-net-debugger-wvisual-studio-aspnet-core",{"title":491,"description":579},"articles\u002Fattaching-to-net-debugger-wvisual-studio-aspnet-core",[444,18,306],"Nscy8wnaq8s7ro0UwOm6dGcZvHofFD7TMOQpO4pRHZs",{"id":587,"title":588,"author":298,"body":589,"createdAt":615,"description":616,"extension":15,"img":298,"meta":617,"navigation":19,"path":618,"seo":619,"stem":620,"tags":621,"updatedAt":615,"__hash__":622},"articles\u002Farticles\u002Fdotnet-new-install-error.md","dotnet new–install Error",{"type":8,"value":590,"toc":613},[591],[32,592,593,594,597,598,600,601,603,604,606,607,610],{},"Error: Could not install …\nError: Value cannot be null.\nParameter name: key\nUsage: new ",[86,595,596],{},"options","\n…",[231,599],{},"\nWhen building a new solution template for ASP.NET Core solution, I received the above error.  I had not seen this with prior template build efforts.  This was new with .NET Core.",[231,602],{},"\nThe error occurs when one of the node_modules folders contain a template.json file.  The solution for me, was to entirely remove the node_modules directory before attempting to build the template.",[231,605],{},"\nReference: ",[36,608],{"title":609,"href":609},"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fcli\u002Fissues\u002F8989",[36,611,609],{"href":609,"rel":612},[283],{"title":11,"searchDepth":12,"depth":12,"links":614},[],"2018-10-01T17:34:36.000Z","When building a new solution template for ASP.NET Core solution, I received the above error.  I had not seen this with prior template build efforts.  This was new with .NET Core.",{},"\u002Farticles\u002Fdotnet-new-install-error",{"title":588,"description":616},"articles\u002Fdotnet-new-install-error",[18,306],"XRM2kTE2W4vJBJM2Tq54l8-3P9fLs6wmg5o6w7hhzcA",{"id":624,"title":625,"author":28,"body":626,"createdAt":748,"description":749,"extension":15,"img":750,"meta":751,"navigation":19,"path":752,"seo":753,"stem":754,"tags":755,"updatedAt":748,"__hash__":756},"articles\u002Farticles\u002Fjquery-mvc-and-textarea-length-validation.md","jQuery \u002F MVC and TextArea Length Validation",{"type":8,"value":627,"toc":746},[628,631,637,640,643,744],[32,629,630],{},"I came across this issue today, and actually surprised I have not had to resolve this problem earlier.",[32,632,633,634,636],{},"When validating a textarea on the client side with jQuery unobtrusive validation (for length) you have to be conscientious about how JavaScript deals with carriage return\u002Fline feed characters in comparison to the posted values to your controller.  For example on the client JavaScript sees CR\u002FLF as \\n while after posted to the server that same CR\u002FLF will be represented by \\r\\n.  If you are validating the user entered data for length your counts will be different depending on the environment (i.e. model will pass validation on the client but fail on the server).",[231,635],{},"\nThe resolution was to fix the data server side.",[32,638,639],{},"This was done with a customization\u002Fextension to the DefaultModelBinder, so that all controller actions will benefit immediately.",[32,641,642],{},"You will notice that I trimmed the original input and then replaced \\r\\n with \\n.",[77,644,646],{"className":390,"code":645,"language":392,"meta":11,"style":11},"        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor)  \n        {  \n            base.BindProperty(controllerContext, bindingContext, propertyDescriptor);  \n  \n            \u002F\u002F Note: if desired, one could restrict the conversion to properties decorated with [StringLength]:  \n            \u002F\u002F &amp;&amp; propertyDescriptor.Attributes.OfType().Any()  \n            if (propertyDescriptor.PropertyType == typeof(string))  \n            {  \n                var originalString = propertyDescriptor.GetValue(bindingContext.Model) as string;  \n                if (!string.IsNullOrEmpty(originalString))  \n                {  \n                    originalString = originalString.Trim();  \n                    var stringWithNormalizedNewlines = originalString.Replace(\"\\r\\n\", \"\\n\");  \n                    propertyDescriptor.SetValue(bindingContext.Model, stringWithNormalizedNewlines);  \n                }  \n            }  \n        }\n",[83,647,648,653,658,663,667,672,678,684,690,696,702,708,714,720,726,732,738],{"__ignoreMap":11},[86,649,650],{"class":88,"line":89},[86,651,652],{},"        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor)  \n",[86,654,655],{"class":88,"line":12},[86,656,657],{},"        {  \n",[86,659,660],{"class":88,"line":167},[86,661,662],{},"            base.BindProperty(controllerContext, bindingContext, propertyDescriptor);  \n",[86,664,665],{"class":88,"line":192},[86,666,499],{},[86,668,669],{"class":88,"line":202},[86,670,671],{},"            \u002F\u002F Note: if desired, one could restrict the conversion to properties decorated with [StringLength]:  \n",[86,673,675],{"class":88,"line":674},6,[86,676,677],{},"            \u002F\u002F &amp;&amp; propertyDescriptor.Attributes.OfType().Any()  \n",[86,679,681],{"class":88,"line":680},7,[86,682,683],{},"            if (propertyDescriptor.PropertyType == typeof(string))  \n",[86,685,687],{"class":88,"line":686},8,[86,688,689],{},"            {  \n",[86,691,693],{"class":88,"line":692},9,[86,694,695],{},"                var originalString = propertyDescriptor.GetValue(bindingContext.Model) as string;  \n",[86,697,699],{"class":88,"line":698},10,[86,700,701],{},"                if (!string.IsNullOrEmpty(originalString))  \n",[86,703,705],{"class":88,"line":704},11,[86,706,707],{},"                {  \n",[86,709,711],{"class":88,"line":710},12,[86,712,713],{},"                    originalString = originalString.Trim();  \n",[86,715,717],{"class":88,"line":716},13,[86,718,719],{},"                    var stringWithNormalizedNewlines = originalString.Replace(\"\\r\\n\", \"\\n\");  \n",[86,721,723],{"class":88,"line":722},14,[86,724,725],{},"                    propertyDescriptor.SetValue(bindingContext.Model, stringWithNormalizedNewlines);  \n",[86,727,729],{"class":88,"line":728},15,[86,730,731],{},"                }  \n",[86,733,735],{"class":88,"line":734},16,[86,736,737],{},"            }  \n",[86,739,741],{"class":88,"line":740},17,[86,742,743],{},"        }\n",[292,745,433],{},{"title":11,"searchDepth":12,"depth":12,"links":747},[],"2017-05-29T20:59:15.3883517Z","Surprised about a jQuery issue.","\u002Farticles\u002Fimages\u002Fc1zuUO5OvF.png",{},"\u002Farticles\u002Fjquery-mvc-and-textarea-length-validation",{"title":625,"description":749},"articles\u002Fjquery-mvc-and-textarea-length-validation",[305,18],"A1TBFqd_HmSDNRRkH9XShYU1vUr45yBIdO-DMLgubPI",{"id":758,"title":759,"author":28,"body":760,"createdAt":884,"description":298,"extension":15,"img":885,"meta":886,"navigation":19,"path":887,"seo":888,"stem":889,"tags":890,"updatedAt":884,"__hash__":891},"articles\u002Farticles\u002Fnet-releases-versions-in-2015.md",".NET Releases & Versions in 2015",{"type":8,"value":761,"toc":882},[762,785,820,835,838,846,857,862,870],[32,763,764,765,767,768,771,772,775,776,779,781,784],{},"In 2015 we will have new releases of .NET Framework, ASP.NET versions, Web Forms, MVC versions.  That is quite a bit to keep track of.  This should make it a little easier.  I am surprised that Microsoft has not made it more clear as to what is included in which version.  They recently starting calling this bundle .NET 2015 and as a bundle includes a number of sub-products.",[231,766],{},"\nSo starting with the ",[217,769,770],{},".NET 2015 ","Bundle….it includes ",[217,773,774],{},".NET 4.6"," AND ",[217,777,778],{},".NET Core",[231,780],{},[217,782,783],{},".NET 4.6 and .NET Core ","includes..(.NET 4.6 is included with Visual Studio 2015)",[221,786,787,794,797,802,805,808,811,814,817],{},[224,788,789,793],{},[36,790,792],{"href":791},"http:\u002F\u002Fblogs.msdn.com\u002Fb\u002Fwebdev\u002Farchive\u002F2015\u002F02\u002F09\u002Fasp-net-mvc-5-2-3-web-pages-3-2-3-and-web-api-5-2-3-release.aspx","ASP.NET 4.6","  is an umbrella term used to describe updates to existing frameworks such as ASP.NET Web Forms\u002FMVC 5\u002FWeb Api 2.",[224,795,796],{},"ASP.NET Web Forms 46",[224,798,799,800],{},"ASP.NET MVC 5.2.3 – updates to MVC 5 found ",[36,801,40],{"href":791},[224,803,804],{},"ASP.NET Web Pages 3.2.3",[224,806,807],{},"ASP.NET Web API 5.2.3",[224,809,810],{},"ASP.NET SignalR 2.1.2",[224,812,813],{},"ASP.NET 5.0 Beta 5 (vNext)  – a .NET platform for build cloud-based apps and can be hosted on IIS or self-hosted in a custom process.  It supports running on both the .NET Framework and .NET Core so by extension supports running on Windows, Linux, OS X etc.",[224,815,816],{},"MVC 6.0 - MVC, Web API, and Web Pages are unified into a single framework – this is a complete rewrite of MVC engine we use today, while we still have controllers, views and models under the hood MVC 6 is an improved and rewritten engine.  Web API is now fully integrated with MVC 6",[224,818,819],{},"C# 6, F# 4, VB 14",[32,821,822,823,827,829,832,834],{},"Note: .NET 4.6 is an in-place update to versions .NET 4, 4.5, 4.5.1, 4.5.2 > this means that after installation c:\\windows\\Microsoft.NET\\Framework(bitness)\\v4.0.30319 will be updated with the latest dlls, this is similar to how .NET 3.5 was an in-place update to .NET 2.0.  See also ",[36,824,826],{"href":825},"https:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fbb822049(v=vs.110).aspx",".NET Framework Versions and Dependencies",[231,828],{},[217,830,831],{},"\nToday (August 2015) ",[231,833],{},"\nSO if you are building an application today you can open Visual Studio 2015 and create new project(s) – web project – selecting .NET 4.6 and ASP.NET 4.6 templates (empty, web forms, mvc, etc.).  However, if you wanting to try out new ASP.NET 5 preview templates those are available too (i.e. choose .NET 4.6 and ASP.NET 5 (Preview) templates such as empty, web api and web application)",[32,836,837],{},"Also if you have not installed .NET 4.6 on the server you would choose to create a new project you could select .NET 4.5.2 and respective ASP.NET 4.5.2 web templates (empty, web forms, mvc, etc.)",[32,839,840,841,843],{},"Note here that Microsoft released Visual Studio 2015 with updates to existing frameworks as well as preview releases of ASP.NET and Entity Framework 7.  So confusing.",[231,842],{},[217,844,845],{},"\nVisual Studio 2015 – Updates",[221,847,848,851,854],{},[224,849,850],{},"JSON Editor",[224,852,853],{},"HTML Editor Updates",[224,855,856],{},"JavaScript Editor Improvements",[32,858,859],{},[217,860,861],{},"Resources",[221,863,864],{},[224,865,866],{},[36,867,869],{"href":868},"http:\u002F\u002Fblogs.msdn.com\u002Fb\u002Fdotnet\u002Fp\u002Fdotnet_sdks.aspx?source=VS2013",".NET SDKs and Downloads",[32,871,872],{},[36,873,875],{"href":874},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-f6d15fa95net-releases-versions-in-2015_11a94-version_4.png",[64,876],{"style":877,"src":878,"border":381,"alt":879,"title":879,"width":880,"height":881},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;","\u002Farticles\u002Fimageswindows-live-writer-f6d15fa95net-releases-versions-in-2015_11a94-version_thumb_1.png","version",240,143,{"title":11,"searchDepth":12,"depth":12,"links":883},[],"2015-06-16T16:09:46.7300000-04:00","\u002Farticles\u002Fimages\u002Fwindows-live-writer-f6d15fa95net-releases-versions-in-2015_11a94-version_thumb_1.png",{},"\u002Farticles\u002Fnet-releases-versions-in-2015",{"title":759,"description":298},"articles\u002Fnet-releases-versions-in-2015",[18,444],"RihqeLfTiAz21FdMOWIpdgYXNEmdlz_YWHgD_XX1Zf0",{"id":893,"title":894,"author":28,"body":895,"createdAt":967,"description":968,"extension":15,"img":298,"meta":969,"navigation":19,"path":970,"seo":971,"stem":972,"tags":973,"updatedAt":967,"__hash__":974},"articles\u002Farticles\u002Fweb-site-to-do-and-not-to-do-s.md","Web Site (to do and not todos)",{"type":8,"value":896,"toc":965},[897,905,908,962],[32,898,899,900,904],{},"I read this post by ",[36,901,903],{"href":902,"target":39},"---------------------------","Josiah Cole"," and have to provide this abbreviated list and less sarcastic version of things to do when designing a web site.",[32,906,907],{},"Do not resize the user’s browser window ever.",[32,909,910,911,913,914,916,917,919,920,922,923,925,926,928,929,931,932,934,935,937,938,940,941,943,944,946,947,949,950,952,953,955,956,958,959,961],{},"If your web site does not immediately load on your home page and deliver your message within a couple of second’s your site needs redesign.",[231,912],{},"\nNever ask your customer which version they want to visit (high\u002Flow bandwidth etc.)",[231,915],{},"\nNever develop a web site entirely in Flash.",[231,918],{},"\nDo not reinvent the website navigation. Put the navigation along the top, left or even right. Period.",[231,921],{},"\nPrint designers do not have the same skill set as web site designers.",[231,924],{},"\nContent is King. Search engines need real text.",[231,927],{},"\nEnsure your web site can work in the major browsers FireFox and Internet Explorer.",[231,930],{},"\nNo flashing items on the web site (no blinking, blipping or barking)",[231,933],{},"\nNever put music on the web site.",[231,936],{},"\nUse text navigation (not graphics)",[231,939],{},"\nA site map with logical sub sections is better than using drop downs.",[231,942],{},"\nIf your site needs a search engine to find content it’s time to redesign the web site.",[231,945],{},"\nThe size of the pages is important. Keep it low and small. 50% of American web users do not have broadband.",[231,948],{},"\nDo not hide your message or obscure what you want users to do.",[231,951],{},"\nAllow individuals to get to the content fast and easily. Make the content easily visible and provide mechanisms to allow users to jump to items of interest.",[231,954],{},"\nIf you use video embed your video in Flash within the browser.",[231,957],{},"\nNever make your users mouse over a graphic to understand what it is or where it will navigate the user to.",[231,960],{},"\nUse new technology sparingly. The users of the web site will not be as impressed by new technical things as you may be.",[32,963,964],{},"Josiah this is a great list of things to do and not do to establish a great web site. These are certainly words to live by.",{"title":11,"searchDepth":12,"depth":12,"links":966},[],"2015-04-20T08:07:18.8100000-04:00","I read this post by Josiah Cole and have to provide this abbreviated list and less sarcastic version of things to do when designing a web site.",{},"\u002Farticles\u002Fweb-site-to-do-and-not-to-do-s",{"title":894,"description":968},"articles\u002Fweb-site-to-do-and-not-to-do-s",[18],"67MSm15IlQYdTDZlaeesCLESt63dq4Hb94JhPe6NeDY",{"id":976,"title":977,"author":28,"body":978,"createdAt":1108,"description":298,"extension":15,"img":298,"meta":1109,"navigation":19,"path":1110,"seo":1111,"stem":1112,"tags":1113,"updatedAt":1108,"__hash__":1114},"articles\u002Farticles\u002Ftesting-web-serviceasmx-remotely-yes-you-can.md","Testing Web Service(ASMX) Remotely (yes, you can!)",{"type":8,"value":979,"toc":1106},[980,983],[32,981,982],{},"Often we test web services by either locally on our workstations or remoting to the server and accessing the asmx page. ",[32,984,985,986,1101,1102],{},"If you try to access the asmx remotely however you are not given the option to test the server (by using the server url address).  By adding the following code the \u003Csystem.web> section of asmx web site web.config you can now test your services remotely.  ",[86,987,991,1002,1019,1034,1048,1062,1080,1094],{"className":988,"style":990},[989],"Apple-style-span","word-spacing: 0px; font: 12px\u002F15px verdana; text-transform: none; color: rgb(51,51,51); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; text-align: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0",[354,992,993],{},[994,995,996],"font",{"size":167},[994,997,999,1000],{"face":998},"Calibri","\u003CwebServices>",[231,1001],{},[354,1003,1004],{},[994,1005,1006],{"size":167},[994,1007,1008,1016,1017],{"face":998},[86,1009,1010,1011],{},"       ",[86,1012,1015],{"className":1013},[1014],"Apple-converted-space"," ","\u003Cprotocols>",[231,1018],{},[354,1020,1021],{},[994,1022,1023],{"size":167},[994,1024,1025,1031,1032],{"face":998},[86,1026,1027,1028],{},"           ",[86,1029,1015],{"className":1030},[1014],"\u003Cadd name=\"HttpSoap12\"\u002F>",[231,1033],{},[354,1035,1036],{},[994,1037,1038],{"size":167},[994,1039,1040,1045,1046],{"face":998},[86,1041,1027,1042],{},[86,1043,1015],{"className":1044},[1014],"\u003Cadd name=\"HttpSoap\"\u002F>",[231,1047],{},[354,1049,1050],{},[994,1051,1052],{"size":167},[994,1053,1054,1059,1060],{"face":998},[86,1055,1027,1056],{},[86,1057,1015],{"className":1058},[1014],"\u003Cadd name=\"HttpGet\"\u002F>",[231,1061],{},[354,1063,1064],{},[994,1065,1066],{"size":167},[994,1067,1068,1074,1077,1078],{"face":998},[86,1069,1070,1071],{},"         ",[86,1072,1015],{"className":1073},[1014],[86,1075,1076],{},"  ","\u003Cadd name=\"HttpPost\"\u002F>",[231,1079],{},[354,1081,1082],{},[994,1083,1084],{"size":167},[994,1085,1086,1091,1092],{"face":998},[86,1087,1010,1088],{},[86,1089,1015],{"className":1090},[1014],"\u003C\u002Fprotocols>",[231,1093],{},[354,1095,1096],{},[994,1097,1098],{"size":167},[994,1099,1100],{"face":998},"\u003C\u002FwebServices>","  ",[86,1103,1105],{"className":1104,"style":990},[989],"The above code addresses the issue related to \"The test form is only available for requests from the local machine.\" error message.",{"title":11,"searchDepth":12,"depth":12,"links":1107},[],"2015-04-20T08:07:17.9200000-04:00",{},"\u002Farticles\u002Ftesting-web-serviceasmx-remotely-yes-you-can",{"title":977,"description":298},"articles\u002Ftesting-web-serviceasmx-remotely-yes-you-can",[18],"SxKDc8JlqMksiHb_H-HoXeE2EcSX8ZxEqtt1Yn_DRPQ",{"id":1116,"title":1117,"author":28,"body":1118,"createdAt":1228,"description":1229,"extension":15,"img":298,"meta":1230,"navigation":19,"path":1231,"seo":1232,"stem":1233,"tags":1234,"updatedAt":1228,"__hash__":1235},"articles\u002Farticles\u002Fcss-lost.md","CSS Lost, Missing, Absent, Gone after Postback in Asp.NET",{"type":8,"value":1119,"toc":1226},[1120,1123,1126,1129,1134,1137,1140],[32,1121,1122],{},"I have a generic function in one of my helper libraries that allows me to open a new browser window when a button is selected.  \nThe button posts back to the server runs some code and opens a new window.  \nI often use this sort of thing on a reporting page allowing me to post some search criteria and open a new window (a pdf report).",[32,1124,1125],{},"I found this type of helper function useful however I found that I was losing my CSS after the postback.",[32,1127,1128],{},"To avoid losing the css keep the following in mind:",[221,1130,1131],{},[224,1132,1133],{},"ensure that your css files are included declarative in your aspx page (not through code behind)",[32,1135,1136],{},"use Page.ClientScript.RegisterStartupScript(this.GetType(),”name”,script); (Not Response.Write)",[32,1138,1139],{},"The end helper function looks something like the following:",[1141,1142,1144,1145,1144,1160,499,1167,1144,1178,1200,1201,1200,1216,1200,1223,1156],"div",{"style":1143},"font-size: 9pt; background: white; color: black; font-family: consolas","   \n",[32,1146,1148,1149,1153,1157],{"style":1147},"margin: 0px","    ",[86,1150,1152],{"style":1151},"color: gray","\u002F\u002F\u002F",[86,1154,1156],{"style":1155},"color: green"," ",[86,1158,1159],{"style":1151},"\u003Csummary>",[32,1161,1148,1162,1164],{"style":1147},[86,1163,1152],{"style":1151},[86,1165,1166],{"style":1155}," redirect to a new page from codebehind",[32,1168,1148,1169,1171,1173,1176],{"style":1147},[86,1170,1152],{"style":1151},[86,1172,1156],{"style":1155},[86,1174,1175],{"style":1151},"\u003C\u002Fsummary>",[86,1177,1148],{"style":1155},[32,1179,1148,1180,1156,1184,1156,1187,1190,1191,1194,1195,1199],{"style":1147},[86,1181,1183],{"style":1182},"color: blue","static",[86,1185,1186],{"style":1182},"public",[86,1188,1189],{"style":1182},"void"," RedirectToNewWindow(",[86,1192,1193],{"style":1182},"string"," url, System.Web.UI.",[86,1196,1198],{"style":1197},"color: #2b91af","Page"," page) {        ","    ",[32,1202,1203,1204,1206,1207,1211,1212,1215],{"style":1147},"        ",[86,1205,1193],{"style":1182}," script = ",[86,1208,1210],{"style":1209},"color: #a31515","\"\u003Cscript>window.open('\""," + url + ",[86,1213,1214],{"style":1209},"\"');\u003C\u002Fscript>\"",";",[32,1217,1218,1219,1222],{"style":1147},"        page.ClientScript.RegisterStartupScript(page.GetType(), ",[86,1220,1221],{"style":1209},"\"redirectscript\"",",script);        ",[32,1224,1225],{"style":1147},"    }",{"title":11,"searchDepth":12,"depth":12,"links":1227},[],"2015-04-20T08:07:17.8100000-04:00","I have a generic function in one of my helper libraries that allows me to open a new browser window when a button is selected.",{},"\u002Farticles\u002Fcss-lost",{"title":1117,"description":1229},"articles\u002Fcss-lost",[18],"b2i1IqyW2Q653DvjckNBJxu4yY2Re8ejfAldTtUJY3I",{"id":1237,"title":1238,"author":28,"body":1239,"createdAt":1303,"description":1304,"extension":15,"img":1305,"meta":1306,"navigation":19,"path":1307,"seo":1308,"stem":1309,"tags":1310,"updatedAt":1303,"__hash__":1311},"articles\u002Farticles\u002Fescape-sequences-and-verbatim-strings-in-c.md","Escape Sequences and Verbatim Strings in C#",{"type":8,"value":1240,"toc":1301},[1241,1244,1247,1250,1255,1258,1261,1264,1267,1270,1273,1276,1279,1282,1285,1288,1295,1298],[32,1242,1243],{},"C# uses special escape sequences within a string to signify that what follows is to be treated differently.  The special character is the backslash .  This character says to treat whatever follows it as though it were part of the string itself. ",[32,1245,1246],{},"string msg = \"Spot the dog said: \" get that dog bone\"\";  \u002F\u002F knowing this the following is good syntax:",[32,1248,1249],{},"Spot the dog said: \"get that dog bone\" \u002F\u002Foutput",[32,1251,1252],{},[217,1253,1254],{},"List of C# Escape Sequences",[32,1256,1257],{},"\"  Display a double quotation mark",[32,1259,1260],{},"'   Display a single quotation mark.",[32,1262,1263],{},"\\  Display a backslash.",[32,1265,1266],{},"\\0  Null (non-printing).",[32,1268,1269],{},"\\a  Alarm (beep terminal alarm).",[32,1271,1272],{},"\\b  Backspace (back up one character position).",[32,1274,1275],{},"\\f   Form feed (advance to next page).",[32,1277,1278],{},"\\n  Newline (advance to next line).",[32,1280,1281],{},"\\r  Carriage return (move to left margin).",[32,1283,1284],{},"\\t  Tab (advance one tab space, often eight characters).",[32,1286,1287],{},"\\v  Vertical tab.",[32,1289,1290,1291,1294],{},"C# provides a way to avoid 'escaping' characters in strings.  You can use the ",[217,1292,1293],{},"verbatim string literal","\ncharacter @ to tell VS.NET to build the string exactly as it appears.\nstring msg = @\"go to c:\\temp\"; \u002F\u002F this would work",[32,1296,1297],{},"The verbatim string can be used to allow a single string to span more than one line i.e.",[32,1299,1300],{},"string msg = @\"this is great\nto be under\nthe sun\";",{"title":11,"searchDepth":12,"depth":12,"links":1302},[],"2015-04-20T08:07:17.4600000-04:00","Lots of escape sequences in c#","\u002Farticles\u002Fimages\u002Fescape.jpg",{},"\u002Farticles\u002Fescape-sequences-and-verbatim-strings-in-c",{"title":1238,"description":1304},"articles\u002Fescape-sequences-and-verbatim-strings-in-c",[18],"bVBNvMdJ6cuQ53UFAK93lprV_NldOOv6yHzK6EMFW1I",{"id":1313,"title":1314,"author":28,"body":1315,"createdAt":1373,"description":298,"extension":15,"img":1369,"meta":1374,"navigation":19,"path":1375,"seo":1376,"stem":1377,"tags":1378,"updatedAt":1373,"__hash__":1379},"articles\u002Farticles\u002Fasp-net-4-feature-increase-the-url-character-length-plus-more.md","ASP.NET 4 Feature Increase the URL character length plus more",{"type":8,"value":1316,"toc":1371},[1317,1320,1337,1351,1361,1364],[32,1318,1319],{},"In previous versions of ASP.NET,  URLs were limited to 260 characters in length (based on the NTFS file-path limit).",[32,1321,1322,1323,1326,1327,1330,1331,1333,1334],{},"But in ASP.NET 4.0 developers have the option of increasing or decreasing  the length of URLs by using  the new ",[317,1324,1325],{},"maxRequestPathLength","\nand ",[317,1328,1329],{},"maxQueryStringLength",".      ",[317,1332,1325],{}," - To allow longer or shorter paths (the portion of the URL that does not include protocol,\nserver name, and query string), modify the maxRequestPathLength attribute.     ",[217,1335,1336],{},"maxQueryStringLength - ",[32,1338,1339,1340,1342,1343,1346,1347,1350],{},"To allow longer or shorter query strings\n, modify the value of the maxQueryStringLength attribute.     For example..  \u003ChttpRuntime maxRequestPathLength=\"360\" maxQueryStringLength=\"1024\" \u002F>",[231,1341],{},"\nASP.NET 4 also enables you to ",[217,1344,1345],{},"configure the characters that are used by the URL character check",". When ASP.NET finds an invalid character\nin the path portion of a URL, it rejects the request and issues an HTTP 400 error. In previous versions of ASP.NET, the URL character checks were limited to\na fixed set of characters. In ASP.NET 4, you can ",[217,1348,1349],{},"customize"," the set of valid characters using the new requestPathInvalidChars attribute of the\nhttpRuntime configuration element, as shown in the following example:",[32,1352,1353,1354,1356,1357,1360],{},"\u003ChttpRuntime requestPathInvalidChars=\"&lt;,&gt;,*,%,&amp;,:,,?\" \u002F>",[231,1355],{},"\nBy default, the ",[217,1358,1359],{},"requestPathInvalidChars"," attribute defines eight characters as invalid.",[32,1362,1363],{},"(In the string that is assigned to requestPathInvalidChars by default, the less than (\u003C), greater than (>), and ampersand (&)",[32,1365,1366,1367],{},"characters are encoded, because the Web.config file is an XML file.) You can customize the set of invalid characters as needed.",[64,1368],{"src":1369,"alt":11,"style":1370},"\u002Farticles\u002Fimages\u002Fhair.jpg","display:none;",{"title":11,"searchDepth":12,"depth":12,"links":1372},[],"2015-04-20T08:07:16.9200000-04:00",{},"\u002Farticles\u002Fasp-net-4-feature-increase-the-url-character-length-plus-more",{"title":1314,"description":298},"articles\u002Fasp-net-4-feature-increase-the-url-character-length-plus-more",[18],"7U2QWX4WIEBG_6ySWSM0ozBd780qpK3opjw_To2BOXs",{"id":1381,"title":1382,"author":28,"body":1383,"createdAt":1373,"description":298,"extension":15,"img":1922,"meta":1923,"navigation":19,"path":1924,"seo":1925,"stem":1926,"tags":1927,"updatedAt":1373,"__hash__":1930},"articles\u002Farticles\u002Fselect2-and-knockout-binding.md","Select2 and Knockout Binding",{"type":8,"value":1384,"toc":1920},[1385,1402,1647,1654,1917],[32,1386,1387,1388,1392,1393,1395,1396,1398,1399,1401],{},"If using ",[36,1389,1391],{"href":1390},"http:\u002F\u002Fivaynberg.github.io\u002Fselect2\u002F","Select2 ","and Knockout, you have the following options for hooking up to html elements. In both of these cases my viewmodel has a property called EvaluatorList with collection object properties of DisplayName and Code.",[231,1394],{},"\n ",[231,1397],{},"\n1.) Manual",[231,1400],{},"\nJavaScript looking like",[77,1403,1406],{"className":1404,"code":1405,"language":305,"meta":11,"style":11},"language-javascript shiki shiki-themes github-light github-dark","        $(\"#txtEvaluator\").select2({  \n            placeholder: 'Evaluator',  \n            multiple:true,  \n            allowClear: true,  \n            id: function (e) { return e.Code },  \n            data: { results: ko.toJS(viewModel.EvaluatorList()), text: 'DisplayName' },  \n            formatSelection: function (item) { return item.DisplayName; },  \n            formatResult: function (item) { return item.DisplayName; }  \n        }).on(\"select2-selecting\", function (e) {  \n            $('#txtEvaluatorId').val(e.val).change();  \n        }).on(\"select2-removed\", function (e) {  \n            $('#txtEvaluatorId').val('').change();  \n        });  \n",[83,1407,1408,1428,1439,1449,1458,1485,1508,1529,1549,1574,1598,1619,1642],{"__ignoreMap":11},[86,1409,1410,1413,1416,1419,1422,1425],{"class":88,"line":89},[86,1411,1412],{"class":100},"        $",[86,1414,1415],{"class":92},"(",[86,1417,1418],{"class":108},"\"#txtEvaluator\"",[86,1420,1421],{"class":92},").",[86,1423,1424],{"class":100},"select2",[86,1426,1427],{"class":92},"({  \n",[86,1429,1430,1433,1436],{"class":88,"line":12},[86,1431,1432],{"class":92},"            placeholder: ",[86,1434,1435],{"class":108},"'Evaluator'",[86,1437,1438],{"class":92},",  \n",[86,1440,1441,1444,1447],{"class":88,"line":167},[86,1442,1443],{"class":92},"            multiple:",[86,1445,1446],{"class":141},"true",[86,1448,1438],{"class":92},[86,1450,1451,1454,1456],{"class":88,"line":192},[86,1452,1453],{"class":92},"            allowClear: ",[86,1455,1446],{"class":141},[86,1457,1438],{"class":92},[86,1459,1460,1463,1466,1469,1472,1476,1479,1482],{"class":88,"line":202},[86,1461,1462],{"class":100},"            id",[86,1464,1465],{"class":92},": ",[86,1467,1468],{"class":104},"function",[86,1470,1471],{"class":92}," (",[86,1473,1475],{"class":1474},"s4XuR","e",[86,1477,1478],{"class":92},") { ",[86,1480,1481],{"class":104},"return",[86,1483,1484],{"class":92}," e.Code },  \n",[86,1486,1487,1490,1493,1496,1499,1502,1505],{"class":88,"line":674},[86,1488,1489],{"class":92},"            data: { results: ko.",[86,1491,1492],{"class":100},"toJS",[86,1494,1495],{"class":92},"(viewModel.",[86,1497,1498],{"class":100},"EvaluatorList",[86,1500,1501],{"class":92},"()), text: ",[86,1503,1504],{"class":108},"'DisplayName'",[86,1506,1507],{"class":92}," },  \n",[86,1509,1510,1513,1515,1517,1519,1522,1524,1526],{"class":88,"line":680},[86,1511,1512],{"class":100},"            formatSelection",[86,1514,1465],{"class":92},[86,1516,1468],{"class":104},[86,1518,1471],{"class":92},[86,1520,1521],{"class":1474},"item",[86,1523,1478],{"class":92},[86,1525,1481],{"class":104},[86,1527,1528],{"class":92}," item.DisplayName; },  \n",[86,1530,1531,1534,1536,1538,1540,1542,1544,1546],{"class":88,"line":686},[86,1532,1533],{"class":100},"            formatResult",[86,1535,1465],{"class":92},[86,1537,1468],{"class":104},[86,1539,1471],{"class":92},[86,1541,1521],{"class":1474},[86,1543,1478],{"class":92},[86,1545,1481],{"class":104},[86,1547,1548],{"class":92}," item.DisplayName; }  \n",[86,1550,1551,1554,1557,1559,1562,1565,1567,1569,1571],{"class":88,"line":692},[86,1552,1553],{"class":92},"        }).",[86,1555,1556],{"class":100},"on",[86,1558,1415],{"class":92},[86,1560,1561],{"class":108},"\"select2-selecting\"",[86,1563,1564],{"class":92},", ",[86,1566,1468],{"class":104},[86,1568,1471],{"class":92},[86,1570,1475],{"class":1474},[86,1572,1573],{"class":92},") {  \n",[86,1575,1576,1579,1581,1584,1586,1589,1592,1595],{"class":88,"line":698},[86,1577,1578],{"class":100},"            $",[86,1580,1415],{"class":92},[86,1582,1583],{"class":108},"'#txtEvaluatorId'",[86,1585,1421],{"class":92},[86,1587,1588],{"class":100},"val",[86,1590,1591],{"class":92},"(e.val).",[86,1593,1594],{"class":100},"change",[86,1596,1597],{"class":92},"();  \n",[86,1599,1600,1602,1604,1606,1609,1611,1613,1615,1617],{"class":88,"line":704},[86,1601,1553],{"class":92},[86,1603,1556],{"class":100},[86,1605,1415],{"class":92},[86,1607,1608],{"class":108},"\"select2-removed\"",[86,1610,1564],{"class":92},[86,1612,1468],{"class":104},[86,1614,1471],{"class":92},[86,1616,1475],{"class":1474},[86,1618,1573],{"class":92},[86,1620,1621,1623,1625,1627,1629,1631,1633,1636,1638,1640],{"class":88,"line":710},[86,1622,1578],{"class":100},[86,1624,1415],{"class":92},[86,1626,1583],{"class":108},[86,1628,1421],{"class":92},[86,1630,1588],{"class":100},[86,1632,1415],{"class":92},[86,1634,1635],{"class":108},"''",[86,1637,1421],{"class":92},[86,1639,1594],{"class":100},[86,1641,1597],{"class":92},[86,1643,1644],{"class":88,"line":716},[86,1645,1646],{"class":92},"        });\n",[32,1648,1649,1650],{},"Option 2) Using ",[36,1651,1653],{"href":1652},"\u002Fblog\u002Fpost\u002F2014\u002F01\u002F20\u002FSelect2-and-Knockout-Binding.aspx","binding handler",[77,1655,1657],{"className":1404,"code":1656,"language":305,"meta":11,"style":11},"ko.bindingHandlers.select2 = {  \n    init: function (element, valueAccessor, allBindingsAccessor) {  \n        var obj = valueAccessor(),  \n            allBindings = allBindingsAccessor(),  \n            lookupKey = allBindings.lookupKey;  \n        $(element).select2(obj);  \n        if (lookupKey) {  \n            var value = ko.utils.unwrapObservable(allBindings.value);  \n            $(element).select2('data', ko.utils.arrayFirst(obj.data.results, function (item) {  \n                return item[lookupKey] === value;  \n            }));  \n        }  \n  \n        ko.utils.domNodeDisposal.addDisposeCallback(element, function () {  \n            $(element).select2('destroy');  \n        });  \n    },  \n    update: function (element) {  \n        $(element).trigger('change');  \n    }  \n};  \n",[83,1658,1659,1669,1695,1711,1723,1733,1745,1753,1772,1802,1816,1821,1826,1830,1846,1862,1867,1872,1888,1905,1911],{"__ignoreMap":11},[86,1660,1661,1664,1666],{"class":88,"line":89},[86,1662,1663],{"class":92},"ko.bindingHandlers.select2 ",[86,1665,105],{"class":104},[86,1667,1668],{"class":92}," {  \n",[86,1670,1671,1674,1676,1678,1680,1683,1685,1688,1690,1693],{"class":88,"line":12},[86,1672,1673],{"class":100},"    init",[86,1675,1465],{"class":92},[86,1677,1468],{"class":104},[86,1679,1471],{"class":92},[86,1681,1682],{"class":1474},"element",[86,1684,1564],{"class":92},[86,1686,1687],{"class":1474},"valueAccessor",[86,1689,1564],{"class":92},[86,1691,1692],{"class":1474},"allBindingsAccessor",[86,1694,1573],{"class":92},[86,1696,1697,1700,1703,1705,1708],{"class":88,"line":167},[86,1698,1699],{"class":104},"        var",[86,1701,1702],{"class":92}," obj ",[86,1704,105],{"class":104},[86,1706,1707],{"class":100}," valueAccessor",[86,1709,1710],{"class":92},"(),  \n",[86,1712,1713,1716,1718,1721],{"class":88,"line":192},[86,1714,1715],{"class":92},"            allBindings ",[86,1717,105],{"class":104},[86,1719,1720],{"class":100}," allBindingsAccessor",[86,1722,1710],{"class":92},[86,1724,1725,1728,1730],{"class":88,"line":202},[86,1726,1727],{"class":92},"            lookupKey ",[86,1729,105],{"class":104},[86,1731,1732],{"class":92}," allBindings.lookupKey;  \n",[86,1734,1735,1737,1740,1742],{"class":88,"line":674},[86,1736,1412],{"class":100},[86,1738,1739],{"class":92},"(element).",[86,1741,1424],{"class":100},[86,1743,1744],{"class":92},"(obj);  \n",[86,1746,1747,1750],{"class":88,"line":680},[86,1748,1749],{"class":104},"        if",[86,1751,1752],{"class":92}," (lookupKey) {  \n",[86,1754,1755,1758,1761,1763,1766,1769],{"class":88,"line":686},[86,1756,1757],{"class":104},"            var",[86,1759,1760],{"class":92}," value ",[86,1762,105],{"class":104},[86,1764,1765],{"class":92}," ko.utils.",[86,1767,1768],{"class":100},"unwrapObservable",[86,1770,1771],{"class":92},"(allBindings.value);  \n",[86,1773,1774,1776,1778,1780,1782,1785,1788,1791,1794,1796,1798,1800],{"class":88,"line":692},[86,1775,1578],{"class":100},[86,1777,1739],{"class":92},[86,1779,1424],{"class":100},[86,1781,1415],{"class":92},[86,1783,1784],{"class":108},"'data'",[86,1786,1787],{"class":92},", ko.utils.",[86,1789,1790],{"class":100},"arrayFirst",[86,1792,1793],{"class":92},"(obj.data.results, ",[86,1795,1468],{"class":104},[86,1797,1471],{"class":92},[86,1799,1521],{"class":1474},[86,1801,1573],{"class":92},[86,1803,1804,1807,1810,1813],{"class":88,"line":698},[86,1805,1806],{"class":104},"                return",[86,1808,1809],{"class":92}," item[lookupKey] ",[86,1811,1812],{"class":104},"===",[86,1814,1815],{"class":92}," value;  \n",[86,1817,1818],{"class":88,"line":704},[86,1819,1820],{"class":92},"            }));  \n",[86,1822,1823],{"class":88,"line":710},[86,1824,1825],{"class":92},"        }  \n",[86,1827,1828],{"class":88,"line":716},[86,1829,499],{"class":92},[86,1831,1832,1835,1838,1841,1843],{"class":88,"line":722},[86,1833,1834],{"class":92},"        ko.utils.domNodeDisposal.",[86,1836,1837],{"class":100},"addDisposeCallback",[86,1839,1840],{"class":92},"(element, ",[86,1842,1468],{"class":104},[86,1844,1845],{"class":92}," () {  \n",[86,1847,1848,1850,1852,1854,1856,1859],{"class":88,"line":728},[86,1849,1578],{"class":100},[86,1851,1739],{"class":92},[86,1853,1424],{"class":100},[86,1855,1415],{"class":92},[86,1857,1858],{"class":108},"'destroy'",[86,1860,1861],{"class":92},");  \n",[86,1863,1864],{"class":88,"line":734},[86,1865,1866],{"class":92},"        });  \n",[86,1868,1869],{"class":88,"line":740},[86,1870,1871],{"class":92},"    },  \n",[86,1873,1875,1878,1880,1882,1884,1886],{"class":88,"line":1874},18,[86,1876,1877],{"class":100},"    update",[86,1879,1465],{"class":92},[86,1881,1468],{"class":104},[86,1883,1471],{"class":92},[86,1885,1682],{"class":1474},[86,1887,1573],{"class":92},[86,1889,1891,1893,1895,1898,1900,1903],{"class":88,"line":1890},19,[86,1892,1412],{"class":100},[86,1894,1739],{"class":92},[86,1896,1897],{"class":100},"trigger",[86,1899,1415],{"class":92},[86,1901,1902],{"class":108},"'change'",[86,1904,1861],{"class":92},[86,1906,1908],{"class":88,"line":1907},20,[86,1909,1910],{"class":92},"    }  \n",[86,1912,1914],{"class":88,"line":1913},21,[86,1915,1916],{"class":92},"};\n",[292,1918,1919],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":11,"searchDepth":12,"depth":12,"links":1921},[],"\u002Farticles\u002Fimages\u002Fko.jpg",{},"\u002Farticles\u002Fselect2-and-knockout-binding",{"title":1382,"description":298},"articles\u002Fselect2-and-knockout-binding",[18,1928,305,1929],"html","knockout","IAV-2N-X-tExH1G5PlY5R0oGGOGSG-lUgmlyANRbjsM",{"id":1932,"title":1933,"author":28,"body":1934,"createdAt":2020,"description":2021,"extension":15,"img":299,"meta":2022,"navigation":19,"path":2023,"seo":2024,"stem":2025,"tags":2026,"updatedAt":2020,"__hash__":2027},"articles\u002Farticles\u002Fasp-net-2-0-compilation-again.md","ASPNET 2 Compilation Again",{"type":8,"value":1935,"toc":2018},[1936,1939,1950],[32,1937,1938],{},"There are a few ways of deploying a .NET 2.0 ASP.NET application",[221,1940,1941,1944,1947],{},[224,1942,1943],{},"using Web Site Deployment Project",[224,1945,1946],{},"using VS.NET Publish Command",[224,1948,1949],{},"using VS.NET Build Command",[32,1951,1952,1953,1955,1956,1959,1960,1395,1962,1964,1965,1967,1968,1971,1972,1975,1976,1978,1986,1988,1989,1991,1992,1395,1994,1996,2000,2002,2005,2006,2008,2011,2012,2014,2017],{},"1.) Using VS.NET Build",[231,1954],{},"\nASP.NET not Visual Studio performs the build.  ASP.NET builds everything, including .cs and .vb code files and places all resulting assemblies in folder structure under Temporary ASP.NET files directory.  As ASP.NET does all of the compilation, the debug setting in the compilation section of the ",[217,1957,1958],{},"web.config controls debug or release mode",".  Compile with debug=true and you'll find the .pdb debugging symbol files alongside each assembly.  In this scenario the Configuration Manager is obsolete (not used) and as such the only option is 'Debug'.",[231,1961],{},[231,1963],{},"\n2.) Using VS.NET Publish",[231,1966],{},"\nThis option is available when you are ready to publish to production.  The Publish command will precompile a web application and place the results into a director of your choosing (IIS\u002FFTP\u002FDirectory).  Options are available on the Publish dialog box that map to aspnet_compiler switches.  The aspnet_compiler tool has option to create pdb files however this is not available on the dialog box (within vs.net).  Publish always builds in ",[217,1969,1970],{},"release ","mode without pdb files.  The Publish command does ",[217,1973,1974],{},"not change the debug setting in the web.config"," SO if you precompile and updateable (option 'allow this precompiled site to be updateable') web site and then update the web site in place (which will result in a dynamic compilation) those dynamic compilations will produce debug code and pdb files.",[231,1977],{},[36,1979,1981],{"href":1980},"\u002Farticles\u002Fimages\u002FWindowsLiveWriter\u002FASP.NET2.0CompilationAgain_A80B\u002Fimage_2.png",[64,1982],{"style":1983,"src":1984,"border":381,"alt":379,"width":509,"height":1985},"border-width: 0px;","\u002Farticles\u002Fimages\u002FWindowsLiveWriter\u002FASP.NET2.0CompilationAgain_A80B\u002Fimage_thumb.png",176,[231,1987],{},"\n3.) Using Web Site Deployment Project (WSD)",[231,1990],{},"\nThis project allows VS.NET to use MSBUILD files provided by WSD to ask for debug and release builds.  This tool uses the aspnet_compiler similar to above with the Publish option however the WSD option will change the debug setting in the web.config to false for release builds (different than the Publish option)  By default the built files will be in respective debug or release directories.",[231,1993],{},[231,1995],{},[86,1997,1999],{"style":1998},"text-decoration: underline;","Conclusion",[231,2001],{},[217,2003,2004],{},"VS.NET Build"," - builds web site to Temporary ASP.NET files directory with options specified in web.config",[231,2007],{},[217,2009,2010],{},"VS.NET Publish"," - builds to release mode (always) however does not change the compilation mode in web.config file (which can lead to less than optimum performance if site is dynamically recompiled)",[231,2013],{},[217,2015,2016],{},"Web Deployment Project"," - Builds based on Configuration Manager mode (debug\u002Frelease) AND updates the web.config with additional options for creating debug symbols and swapping out web.config sections based on release mode",{"title":11,"searchDepth":12,"depth":12,"links":2019},[],"2015-04-20T08:07:16.6100000-04:00","few ways of deploying a .NET 2.0 ASP.NET application.",{},"\u002Farticles\u002Fasp-net-2-0-compilation-again",{"title":1933,"description":2021},"articles\u002Fasp-net-2-0-compilation-again",[18],"Q7K6EcEId9aFUHSq2rTPkmqg7nFfMagSzSQpOK5YPu4",{"id":2029,"title":2030,"author":28,"body":2031,"createdAt":3947,"description":3948,"extension":15,"img":3944,"meta":3949,"navigation":19,"path":3950,"seo":3951,"stem":3952,"tags":3953,"updatedAt":3947,"__hash__":3954},"articles\u002Farticles\u002Fmicrosoft-ajax-features-and-implementation-samples.md","Microsoft AJAX Features and Implementation Samples",{"type":8,"value":2032,"toc":3945},[2033,2036,2042,2056,2059,2079,2084,2101,2151,2180,2183,2191,2194,2404,2407,2424,2427,2435,2492,2597,2600,2608,2611,3011,3013,3016,3026,3941],[32,2034,2035],{},"There are many options within the Microsoft stack of products for AJAX type functionality.  The following article covers the primary mechanisms that utilize the Microsoft out of the box Ajax functionality.  Ajax must be one of the technologies used in all current web applications.  The primary benefit is the improved user experience by providing quick, responsive feedback.",[32,2037,2038,2039,2041],{},"Core features include Ajax Client Libraries and Ajax Server Controls.  These libraries and controls enable the developer to quickly implement solutions within any ASP.NET application. ",[231,2040],{},"\nI have also included in this article the examples for utilizing the Microsoft AJAX libraries using:",[221,2043,2044,2047,2050,2053],{},[224,2045,2046],{},"update panel server control",[224,2048,2049],{},"access to web service from JavaScript",[224,2051,2052],{},"access to page methods (without web service)",[224,2054,2055],{},"HttpRequest\u002FPost from javascript.",[32,2057,2058],{},"AJAX Client Libraries",[221,2060,2061,2064,2067,2070,2073,2076],{},[224,2062,2063],{},"Client-Script libraries that provide features for object-oriented development which enable high level of consistency and modularity in client scripting.",[224,2065,2066],{},"Browser compatibility",[224,2068,2069],{},"Extensions to JavaScript such as classes, namespaces, event handling, inheritance, data types and object serialization",[224,2071,2072],{},"Networking layer that handles communication with web based services",[224,2074,2075],{},"Sys Namespace",[224,2077,2078],{},"Javascript Shortcuts i.e. $get(‘elementId’), $addHandler, $removeHandler",[32,2080,2081],{},[217,2082,2083],{},"Asp.Net AJAX Server Controls",[221,2085,2086,2089,2092,2095,2098],{},[224,2087,2088],{},"ScriptManager",[224,2090,2091],{},"Manages Javascript",[224,2093,2094],{},"Enables partial page rendering w\u002FUpdatePanel",[224,2096,2097],{},"Creates client side proxies for Web Services",[224,2099,2100],{},"Provides registration methods for scripts",[55,2102,499,2103,499],{},[77,2104,2107,2108,2113,2114,2117,2118,2122,2123,2126,2127,2131,2132,2136,2137,2141,2142,2145,2146,2150],{"className":2105},[2106],"csharpcode","\u003Casp:ScriptManager ID=",[86,2109,2112],{"className":2110},[2111],"str","\"mng1\""," runat=",[86,2115,138],{"className":2116},[2111],"  \n                    EnablePartialRendering=",[86,2119,2121],{"className":2120},[2111],"\"true|false\"","  \n                    EnablePageMethods=",[86,2124,2121],{"className":2125},[2111],"  \n                    ScriptMode=",[86,2128,2130],{"className":2129},[2111],"\"Auto|Inherit|Debug|Release\"","  \n                    ScriptPath=",[86,2133,2135],{"className":2134},[2111],"\"...\"",">                          \n                    \u003CScripts>  \n                        \u003Casp:ScriptReference Name=",[86,2138,2140],{"className":2139},[2111],"\"script.js\""," Assembly=",[86,2143,2135],{"className":2144},[2111]," \u002F>  \n                    \u003C\u002FScripts>  \n                    \u003CServices>  \n                        \u003Casp:ServiceReference Path=",[86,2147,2149],{"className":2148},[2111],"\"~\u002FMyWebService.asmx\""," \u002F>                          \n                    \u003C\u002FServices>      \n       \u003C\u002Fasp:ScriptManager>",[221,2152,2153,2156,2159,2162,2165,2168,2171,2174,2177],{},[224,2154,2155],{},"ScriptManagerProxy",[224,2157,2158],{},"Used with Master Pages",[224,2160,2161],{},"If you include the ScriptManager control on the master page, it can act as the ScriptManager control for all content pages.  If you want to register scripts or services declaratively in a content page, you can add a ScriptManagerProxy control to the content page.",[224,2163,2164],{},"UpdatePanel",[224,2166,2167],{},"Improves user experience of application by updating a portion of the web page thereby improving interactivity",[224,2169,2170],{},"By default controls within the update panel can trigger the update.  ChildrenAsTriggers property is by default set to true.  In our example the link button is within the update panel and so can trigger the partial page update.  By default any postback control inside an update panel causes an async postback",[224,2172,2173],{},"Controls outside of the update panel can also trigger the panel contents to update.  For example look at btnGo, it resides outside the panel however it is defined within the panel as a trigger\u002Fcontrol that can force the async update to the panel contents.  Reference the \u003Casp:AsyncPostBackTrigger> element within the \u003CTrigger> element of the updatePanel",[224,2175,2176],{},"set EnableParitalPageRendering=”true”",[224,2178,2179],{},"Shown here is how a timer defined outside of the panel can trigger the update panel to refresh at a defined interval",[55,2181,2182],{},"  \n     \u003Casp:UpdatePanel id=”panel1” runat=”server” \n                              UpdateMode=”Always\u002FConditional” \n                              ChildrenAsTriggers=”true\u002Ffalse”> \n                       \u003CTriggers> \n                             \u003Casp:AsyncPostBackTrigger ControlID=”timer1”\u002F> \n                        \u003C\u002FTriggers> \n                        \u003CContentTemplate> \n                             \u003C!—page content here --> \n                       \u003C\u002FContentTemplate> \n        \u003C\u002Fasp:UpdatePanel> \n       \u003Casp:Timer id=”timer1” runat=”server” Interval=”3000” OnTick=”OnTimerTick”\u002F>  \n",[221,2184,2185,2188],{},[224,2186,2187],{},"UpdateProgress",[224,2189,2190],{},"provides status information about partial-page updates in the UpdatePanel controls.  The content can be customized.  To prevent flashing when a partial-page update is very fast, you can specify a delay before the UpdatePanel control is displayed",[217,2192,2193],{},"\n Update Panel Example ",[55,2195,2196,2197,2260,2261,499],{},"  \nCode behind which responds to the button click to update a label control with the current time.  \n",[1141,2198,499,2200,499],{"style":2199},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 85.8%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,2201,499,2203,499,2216,499,2220,499,2232,499,2235,499,2238,499,2241,499,2243,499,2253,499,2255,499,2257,499],{"style":2202},"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[77,2204,2206,1156,2209,1156,2212,2215],{"style":2205},"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[86,2207,1186],{"style":2208},"color: #0000ff;",[86,2210,2211],{"style":2208},"partial",[86,2213,2214],{"style":2208},"class"," Panel : System.Web.UI.Page",[77,2217,2219],{"style":2218},"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;","{",[77,2221,1200,2222,1156,2225,2227,2228,2231],{"style":2205},[86,2223,2224],{"style":2208},"protected",[86,2226,1189],{"style":2208}," Page_Load(",[86,2229,2230],{"style":2208},"object"," sender, EventArgs e)",[77,2233,2234],{"style":2218},"    {",[77,2236,2237],{"style":2205},"        lblName.Text = DateTime.Now.ToString();",[77,2239,2240],{"style":2218},"    }",[77,2242,1015],{"style":2205},[77,2244,1200,2245,1156,2247,2249,2250,2252],{"style":2218},[86,2246,2224],{"style":2208},[86,2248,1189],{"style":2208}," lnkButton_Click(",[86,2251,2230],{"style":2208}," sender, EventArgs e) {",[77,2254,2237],{"style":2205},[77,2256,2240],{"style":2218},[77,2258,2259],{"style":2205},"}","  \nPage HTML code with embedded update panel which responds to a control within the panel and a button defined as a trigger outside of the panel control.  \n",[1141,2262,499,2264,499],{"style":2263},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 86.23%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,2265,499,2266,499,2269,499,2278,499,2291,499,2299,499,2302,499,2319,499,2338,499,2341,499,2344,499,2351,499,2354,499,2357,499,2368,499,2371,499,2374,499,2377,499,2380,499,2383,499,2385,499,2398,499,2401,499],{"style":2202},[77,2267,2268],{"style":2205},"\u003Cbody>",[77,2270,2271,2272,2113,2276,150],{"style":2218},"    \u003Cform id=",[86,2273,2275],{"style":2274},"color: #006080;","\"form1\"",[86,2277,138],{"style":2274},[77,2279,2280,2281,2113,2284,2286,2287,2290],{"style":2218},"        \u003Casp:ScriptManager ID=",[86,2282,2283],{"style":2274},"\"ScriptManager1\"",[86,2285,138],{"style":2274}," EnablePartialRendering=",[86,2288,2289],{"style":2274},"\"true\"",">\u003C\u002Fasp:ScriptManager>",[77,2292,2293,2294,2113,2297,150],{"style":2218},"        \u003Casp:UpdatePanel ID=",[86,2295,2296],{"style":2274},"\"UpdatePanel1\"",[86,2298,138],{"style":2274},[77,2300,2301],{"style":2205},"            \u003CContentTemplate>",[77,2303,2304,2305,2113,2308,2310,2311,2314,2315,2318],{"style":2218},"                 \u003Casp:Label ID=",[86,2306,2307],{"style":2274},"\"lblName\"",[86,2309,138],{"style":2274}," CssClass=",[86,2312,2313],{"style":2274},"\"lbl\""," Text=",[86,2316,2317],{"style":2274},"\"\"",">\u003C\u002Fasp:Label>",[77,2320,2321,2322,2113,2325,2310,2327,2330,2331,2314,2334,2337],{"style":2218},"                 \u003Casp:LinkButton ID=",[86,2323,2324],{"style":2274},"\"lnkButton\"",[86,2326,138],{"style":2274},[86,2328,2329],{"style":2274},"\"lnk\""," onclick=",[86,2332,2333],{"style":2274},"\"lnkButton_Click\"",[86,2335,2336],{"style":2274},"\"Update\"",">\u003C\u002Fasp:LinkButton>",[77,2339,2340],{"style":2218},"            \u003C\u002FContentTemplate>        ",[77,2342,2343],{"style":2205},"            \u003CTriggers> ",[77,2345,2346,2347,2350],{"style":2218},"              \u003Casp:AsyncPostBackTrigger ControlID=",[86,2348,2349],{"style":2274},"\"btnGo\""," \u002F>",[77,2352,2353],{"style":2205},"            \u003C\u002FTriggers>",[77,2355,2356],{"style":2218},"        \u003C\u002Fasp:UpdatePanel>",[77,2358,2359,2360,2113,2363,2365,2366,150],{"style":2218},"        \u003Casp:UpdateProgress ID=",[86,2361,2362],{"style":2274},"\"UpdateProgress1\"",[86,2364,138],{"style":2274}," AssociatedUpdatePanelID=",[86,2367,2296],{"style":2274},[77,2369,2370],{"style":2205},"            \u003CProgressTemplate>",[77,2372,2373],{"style":2218},"                Updating.",[77,2375,2376],{"style":2205},"            \u003C\u002FProgressTemplate>",[77,2378,2379],{"style":2218},"        \u003C\u002Fasp:UpdateProgress>",[77,2381,2382],{"style":2218},"        \u003Cbr \u002F>",[77,2384,2382],{"style":2205},[77,2386,2387,2388,2113,2390,2310,2392,2314,2395,2350],{"style":2218},"        \u003Casp:Button ID=",[86,2389,2349],{"style":2274},[86,2391,138],{"style":2274},[86,2393,2394],{"style":2274},"\"btn\"",[86,2396,2397],{"style":2274},"\"Go\"",[77,2399,2400],{"style":2218},"    \u003C\u002Fform>",[77,2402,2403],{"style":2205},"\u003C\u002Fbody>",[217,2405,2406],{},"Ajax and Web Service Example",[221,2408,2409,2412,2415,2421],{},[224,2410,2411],{},"Script Callable Web Service",[224,2413,2414],{},"Proxies are automatically generated",[224,2416,2417,2420],{},[86,2418,2419],{},"ScriptService"," Attribute",[224,2422,2423],{},"If the web service returns a complex type, the succeeded callback function receives a return value in the form of Javascript object that corresponds to the server type.",[32,2425,2426],{},"Web Service code (simple function that returns ‘Hello World’)",[221,2428,2429],{},[224,2430,2431,2432,2434],{},"Web Service has ",[86,2433,2419],{}," attribute",[1141,2436,499,2438,499],{"style":2437},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 82.54%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,2439,499,2440,499,2447,499,2450,499,2453,499,2460,499,2465,499,2467,499,2469,499,2472,499,2479,499,2487,499,2490,499],{"style":2202},[77,2441,2442,2443,2446],{"style":2218},"[WebService(Namespace = ",[86,2444,2445],{"style":2274},"\"http:\u002F\u002Ftempuri.org\u002F\"",")]",[77,2448,2449],{"style":2205},"[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]",[77,2451,2452],{"style":2218},"[System.Web.Script.Services.ScriptService]",[77,2454,2455,1156,2457,2459],{"style":2205},[86,2456,1186],{"style":2208},[86,2458,2214],{"style":2208}," MyWebService : System.Web.Services.WebService {",[77,2461,1200,2462,2464],{"style":2205},[86,2463,1186],{"style":2208}," MyWebService () {",[77,2466,2240],{"style":2218},[77,2468,1015],{"style":2205},[77,2470,2471],{"style":2218},"    [WebMethod]",[77,2473,1200,2474,1156,2476,2478],{"style":2205},[86,2475,1186],{"style":2208},[86,2477,1193],{"style":2208}," HelloWorld() {",[77,2480,2481,2482,1156,2484,1215],{"style":2218},"        ",[86,2483,1481],{"style":2208},[86,2485,2486],{"style":2274},"\"Hello World\"",[77,2488,2489],{"style":2205},"    }    ",[77,2491,2259],{"style":2218},[55,2493,2494,2495,499,2595,499],{},"  \nPage Code (page with button which calls js function, which in turn calls the web service defined within ScriptManager-ScriptReference tag)  \n",[1141,2496,499,2498,499],{"style":2497},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 86.21%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,2499,499,2500,499,2507,499,2514,499,2517,499,2522,499,2525,499,2528,499,2545,499,2550,499,2552,499,2555,499,2558,499,2561,499,2563,499,2566,499,2569,499,2571,499,2573,499,2576,499,2579,499,2581,499,2584,499,2586,499,2589,499,2592,499],{"style":2202},[77,2501,2502,2503,2113,2505,150],{"style":2205},"\u003Cform id=",[86,2504,2275],{"style":2274},[86,2506,138],{"style":2274},[77,2508,2509,2510,2113,2512,150],{"style":2218},"    \u003Casp:ScriptManager ID=",[86,2511,2283],{"style":2274},[86,2513,138],{"style":2274},[77,2515,2516],{"style":2205},"        \u003CServices>",[77,2518,2519,2520,2350],{"style":2218},"            \u003Casp:ServiceReference Path=",[86,2521,2149],{"style":2274},[77,2523,2524],{"style":2205},"        \u003C\u002FServices>        ",[77,2526,2527],{"style":2218},"    \u003C\u002Fasp:ScriptManager>",[77,2529,2530,2531,2113,2534,2310,2536,2314,2538,2541,2542,2350],{"style":2205},"    \u003Casp:Button ID=",[86,2532,2533],{"style":2274},"\"btnGet\"",[86,2535,138],{"style":2274},[86,2537,2394],{"style":2274},[86,2539,2540],{"style":2274},"\"Get\""," OnClientClick=",[86,2543,2544],{"style":2274},"\"update();return false\"",[77,2546,2547,2548,150],{"style":2205},"    \u003Cscript type=",[86,2549,117],{"style":2274},[77,2551,1015],{"style":2218},[77,2553,2554],{"style":2205},"        function update() {",[77,2556,2557],{"style":2218},"            MyWebService.HelloWorld(onCompleted, onFailed);",[77,2559,2560],{"style":2205},"        }",[77,2562,1015],{"style":2218},[77,2564,2565],{"style":2205},"        function onCompleted(result, context, methodName) {",[77,2567,2568],{"style":2218},"            alert(result);",[77,2570,2560],{"style":2205},[77,2572,1015],{"style":2218},[77,2574,2575],{"style":2205},"        function onFailed(err, context, methodName) {",[77,2577,2578],{"style":2218},"            alert(err.get_message());",[77,2580,2560],{"style":2205},[77,2582,2583],{"style":2205},"    \u003C\u002Fscript>",[77,2585,1015],{"style":2218},[77,2587,2588],{"style":2205},"\u003C\u002Fform>",[77,2590,2591],{"style":2218},"dy>",[77,2593,2594],{"style":2205},"ml>",[217,2596,1015],{},[217,2598,2599],{},"Page Method Example",[221,2601,2602,2605],{},[224,2603,2604],{},"Allows javascript Ajax call back to page without web service",[224,2606,2607],{},"use EnablePageMethods=true in the ScriptManager control",[55,2609,2610],{},"  \nThe following is a sample showing a code behind static method marked with WebMethod attribute.  \n",[55,2612,499,2613,2694,2695,499,2698,499],{},[1141,2614,499,2616,499],{"style":2615},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 86.84%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,2617,499,2618,499,2629,499,2633,499,2643,499,2647,499,2652,499,2656,499,2660,499,2665,499,2679,499,2686,499,2690,499],{"style":2202},[77,2619,2620],{"style":2205},[217,2621,2622,1156,2624,1156,2626,2628],{},[86,2623,1186],{"style":2208},[86,2625,2211],{"style":2208},[86,2627,2214],{"style":2208}," PageMethod : System.Web.UI.Page",[77,2630,2631],{"style":2218},[217,2632,2219],{},[77,2634,2635],{"style":2205},[217,2636,1200,2637,1156,2639,2227,2641,2231],{},[86,2638,2224],{"style":2208},[86,2640,1189],{"style":2208},[86,2642,2230],{"style":2208},[77,2644,2645],{"style":2218},[217,2646,2234],{},[77,2648,2649],{"style":2205},[217,2650,2651],{},"        Response.Write(DateTime.Now.ToString());",[77,2653,2654],{"style":2218},[217,2655,2240],{},[77,2657,2658],{"style":2205},[217,2659,1015],{},[77,2661,2662],{"style":2218},[217,2663,2664],{},"    [System.Web.Services.WebMethod]",[77,2666,2667],{"style":2205},[217,2668,1200,2669,1156,2671,1156,2673,2675,2676,2678],{},[86,2670,1186],{"style":2208},[86,2672,1183],{"style":2208},[86,2674,1193],{"style":2208}," update(",[86,2677,1193],{"style":2208}," input){",[77,2680,2681],{"style":2218},[217,2682,2481,2683,2685],{},[86,2684,1481],{"style":2208}," input.ToUpper();",[77,2687,2688],{"style":2205},[217,2689,2240],{},[77,2691,2692],{"style":2218},[217,2693,2259],{},"  \nAspx code with a button that calls javascript, which in turn calls the page method ‘update’ to return uppercase string",[217,2696,2697],{},".",[1141,2699,499,2701,499],{"style":2700},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 88.59%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,2702,499,2703,499,2721,499,2738,499,2753,499,2763,499,2774,499,2795,499,2828,499,2866,499,2870,499,2886,499,2894,499,2905,499,2917,499,2930,499,2938,499,2948,499,2956,499,2963,499,2971,499,2981,499,2991,499,3001,499],{"style":2202},[77,2704,2705],{"style":2205},[217,2706,2707,2709,1156,2712,2716,2719],{},[86,2708,93],{"style":2208},[86,2710,1928],{"style":2711},"color: #800000;",[86,2713,2715],{"style":2714},"color: #ff0000;","xmlns",[86,2717,2718],{"style":2208},"=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml\"",[86,2720,150],{"style":2208},[77,2722,2723],{"style":2218},[217,2724,2725,2727,1156,2730,2733,2736],{},[86,2726,93],{"style":2208},[86,2728,2729],{"style":2711},"head",[86,2731,2732],{"style":2714},"runat",[86,2734,2735],{"style":2208},"=\"server\"",[86,2737,150],{"style":2208},[77,2739,2740],{"style":2205},[217,2741,1200,2742,2744,2747,2749,2751],{},[86,2743,93],{"style":2208},[86,2745,2746],{"style":2711},"title",[86,2748,120],{"style":2208},[86,2750,2746],{"style":2711},[86,2752,150],{"style":2208},[77,2754,2755],{"style":2218},[217,2756,2757,2759,2761],{},[86,2758,205],{"style":2208},[86,2760,2729],{"style":2711},[86,2762,150],{"style":2208},[77,2764,2765],{"style":2205},[217,2766,2767,2769,2772],{},[86,2768,93],{"style":2208},[86,2770,2771],{"style":2711},"body",[86,2773,150],{"style":2208},[77,2775,2776],{"style":2218},[217,2777,1200,2778,2780,1156,2783,2786,1156,2789,2791,2793],{},[86,2779,93],{"style":2208},[86,2781,2782],{"style":2711},"form",[86,2784,2785],{"style":2714},"id",[86,2787,2788],{"style":2208},"=\"form1\"",[86,2790,2732],{"style":2714},[86,2792,2735],{"style":2208},[86,2794,150],{"style":2208},[77,2796,2797],{"style":2218},[217,2798,1200,2799,2801,1156,2804,2807,1156,2810,2812,1156,2814,2817,1156,2820,2823,1156,2825],{},[86,2800,93],{"style":2208},[86,2802,2803],{"style":2711},"asp:ScriptManager",[86,2805,2806],{"style":2714},"ID",[86,2808,2809],{"style":2208},"=\"ScriptManager1\"",[86,2811,2732],{"style":2714},[86,2813,2735],{"style":2208},[86,2815,2816],{"style":2714},"EnablePartialRendering",[86,2818,2819],{"style":2208},"=\"true\"",[86,2821,2822],{"style":2714},"EnablePageMethods",[86,2824,2819],{"style":2208},[86,2826,2827],{"style":2208},"\u002F>",[77,2829,2830],{"style":2205},[217,2831,1200,2832,2834,1156,2837,2839,1156,2842,2844,1156,2846,2849,1156,2852,2855,1156,2858,2861,1156,2864],{},[86,2833,93],{"style":2208},[86,2835,2836],{"style":2711},"asp:Button",[86,2838,2806],{"style":2714},[86,2840,2841],{"style":2208},"=\"btnGet\"",[86,2843,2732],{"style":2714},[86,2845,2735],{"style":2208},[86,2847,2848],{"style":2714},"CssClass",[86,2850,2851],{"style":2208},"=\"btn\"",[86,2853,2854],{"style":2714},"Text",[86,2856,2857],{"style":2208},"=\"Get\"",[86,2859,2860],{"style":2714},"OnClientClick",[86,2862,2863],{"style":2208},"=\"update();return false\"",[86,2865,2827],{"style":2208},[77,2867,2868],{"style":2218},[217,2869,1015],{},[77,2871,2872],{"style":2205},[217,2873,2481,2874,2876,1156,2878,2881,2884],{},[86,2875,93],{"style":2208},[86,2877,97],{"style":2711},[86,2879,2880],{"style":2714},"type",[86,2882,2883],{"style":2208},"=\"text\u002Fjavascript\"",[86,2885,150],{"style":2208},[77,2887,2888],{"style":2205},[217,2889,2890,1076],{},[86,2891,2893],{"style":2892},"color: #606060;","   1:",[77,2895,2896],{"style":2218},[217,2897,2898,2901,2902,2904],{},[86,2899,2900],{"style":2892},"   2:","             ",[86,2903,1468],{"style":2208}," update() {",[77,2906,2907],{"style":2205},[217,2908,2909,2912,2913,2916],{},[86,2910,2911],{"style":2892},"   3:","                 PageMethods.update(",[86,2914,2915],{"style":2274},"\"test\"",", onCompleted);",[77,2918,2919],{"style":2218},[217,2920,2921,2924,2925,1156,2927,1215],{},[86,2922,2923],{"style":2892},"   4:","                 ",[86,2926,1481],{"style":2208},[86,2928,2929],{"style":2208},"false",[77,2931,2932],{"style":2205},[217,2933,2934,2937],{},[86,2935,2936],{"style":2892},"   5:","             }",[77,2939,2940],{"style":2218},[217,2941,2942,2901,2945,2947],{},[86,2943,2944],{"style":2892},"   6:",[86,2946,1468],{"style":2208}," onCompleted(result) {",[77,2949,2950],{"style":2205},[217,2951,2952,2955],{},[86,2953,2954],{"style":2892},"   7:","                 alert(result.toString());",[77,2957,2958],{"style":2218},[217,2959,2960,2937],{},[86,2961,2962],{"style":2892},"   8:",[77,2964,2965],{"style":2205},[217,2966,2967,2970],{},[86,2968,2969],{"style":2892},"   9:","         ",[77,2972,2973],{"style":2205},[217,2974,2975,2977,2979],{},[86,2976,205],{"style":2208},[86,2978,97],{"style":2711},[86,2980,150],{"style":2208},[77,2982,2983],{"style":2205},[217,2984,1200,2985,2987,2989],{},[86,2986,205],{"style":2208},[86,2988,2782],{"style":2711},[86,2990,150],{"style":2208},[77,2992,2993],{"style":2218},[217,2994,2995,2997,2999],{},[86,2996,205],{"style":2208},[86,2998,2771],{"style":2711},[86,3000,150],{"style":2208},[77,3002,3003],{"style":2205},[217,3004,3005,3007,3009],{},[86,3006,205],{"style":2208},[86,3008,1928],{"style":2711},[86,3010,150],{"style":2208},[217,3012,1015],{},[217,3014,3015],{},"HTTP Requests (from Javascript) Sample",[55,3017,499,3018],{},[221,3019,3020,3023],{},[224,3021,3022],{},"The async communication layer enables javascript to make a request over the network to any http end point by using Sys.Net.WebRequest class",[224,3024,3025],{},"The sample performs a post and get http request from javascript",[55,3027,3028,3029,3141,3142,3673,3674,3747,3748,499],{},"  \nPage code that initiates the javascript call GetWebRequest().  \n",[1141,3030,499,3032,499],{"style":3031},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 86.48%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,3033,499,3034,499,3042,499,3046,499,3054,499,3059,499,3067,499,3072,499,3077,499,3081,499,3099,499,3116,499,3120,499,3129,499,3133,499,3137,499],{"style":2202},[77,3035,3036],{"style":2205},[217,3037,2502,3038,2113,3040,150],{},[86,3039,2275],{"style":2274},[86,3041,138],{"style":2274},[77,3043,3044],{"style":2218},[217,3045,1015],{},[77,3047,3048],{"style":2205},[217,3049,2107,3050,2113,3052,150],{},[86,3051,2283],{"style":2274},[86,3053,138],{"style":2274},[77,3055,3056],{"style":2218},[217,3057,3058],{},"    \u003CScripts>",[77,3060,3061],{"style":2205},[217,3062,3063,3064,2350],{},"        \u003Casp:ScriptReference Path=",[86,3065,3066],{"style":2274},"\"~\u002Fconnect.js\"",[77,3068,3069],{"style":2218},[217,3070,3071],{},"    \u003C\u002FScripts>",[77,3073,3074],{"style":2205},[217,3075,3076],{},"\u003C\u002Fasp:ScriptManager>",[77,3078,3079],{"style":2218},[217,3080,1015],{},[77,3082,3083],{"style":2218},[217,3084,3085,3086,2113,3088,2310,3090,2314,3092,3095,3096,2350],{},"\u003Casp:Button ID=",[86,3087,2349],{"style":2274},[86,3089,138],{"style":2274},[86,3091,2394],{"style":2274},[86,3093,3094],{"style":2274},"\"GetWebRequest\"","  OnClientClick=",[86,3097,3098],{"style":2274},"\"GetWebRequest();return false;\"",[77,3100,3101],{"style":2205},[217,3102,3085,3103,2113,3106,2310,3108,2314,3110,2541,3113,2350],{},[86,3104,3105],{"style":2274},"\"btnPost\"",[86,3107,138],{"style":2274},[86,3109,2394],{"style":2274},[86,3111,3112],{"style":2274},"\"PostWebRequest\"",[86,3114,3115],{"style":2274},"\"PostWebRequest();return false;\"",[77,3117,3118],{"style":2218},[217,3119,1015],{},[77,3121,3122],{"style":2205},[217,3123,3124,3125,3128],{},"\u003Cdiv id=",[86,3126,3127],{"style":2274},"\"result\"",">initial content\u003C\u002Fdiv>",[77,3130,3131],{"style":2218},[217,3132,1015],{},[77,3134,3135],{"style":2205},[217,3136,1015],{},[77,3138,3139],{"style":2218},[217,3140,2588],{},"  \nJavascript (connect.js) file which performs the webrequest  \n",[1141,3143,499,3145,499],{"style":3144},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 87.69%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,3146,499,3147,499,3155,499,3159,499,3164,499,3168,499,3173,499,3181,499,3185,499,3189,499,3194,499,3203,499,3210,499,3219,499,3226,499,3234,499,3241,499,3245,499,3252,499,3260,499,3267,499,3272,499,3279,499,3286,499,3290,499,3297,499,3302,499,3306,499,3310,499,3317,499,3322,499,3329,499,3333,499,3339,499,3345,499,3349,499,3355,499,3362,499,3369,499,3373,499,3379,499,3386,499,3390,499,3397,499,3401,499,3405,499,3412,499,3417,499,3424,499,3429,499,3438,499,3443,499,3447,499,3453,499,3459,499,3463,499,3469,499,3474,499,3478,499,3482,499,3486,499,3493,499,3500,499,3507,499,3512,499,3520,499,3527,499,3534,499,3538,499,3545,499,3550,499,3563,499,3575,499,3579,499,3586,499,3594,499,3601,499,3605,499,3612,499,3619,499,3623,499,3630,499,3635,499,3642,499,3647,499,3651,499,3655,499,3659,499],{"style":2202},[77,3148,3149],{"style":2205},[86,3150,3152],{"style":3151},"color: #008000;",[217,3153,3154],{},"\u002F\u002F connect.js",[77,3156,3157],{"style":2218},[217,3158,1015],{},[77,3160,3161],{"style":2205},[217,3162,3163],{},"var resultElement;",[77,3165,3166],{"style":2218},[217,3167,1015],{},[77,3169,3170],{"style":2205},[217,3171,3172],{},"function pageLoad() {",[77,3174,3175],{"style":2218},[217,3176,3177,3178,3180],{},"    resultElement = $get(",[86,3179,3127],{"style":2274},");    ",[77,3182,3183],{"style":2205},[217,3184,2259],{},[77,3186,3187],{"style":2218},[217,3188,1015],{},[77,3190,3191],{"style":2205},[217,3192,3193],{},"function GetWebRequest() {",[77,3195,3196],{"style":2218},[217,3197,3198,3199,3202],{},"    alert(",[86,3200,3201],{"style":2274},"\"performing web request\"",");",[77,3204,3205],{"style":2218},[217,3206,1200,3207],{},[86,3208,3209],{"style":3151},"\u002F\u002F Instantiate a WebRequest.",[77,3211,3212],{"style":2205},[217,3213,3214,3215,3218],{},"    var wRequest = ",[86,3216,3217],{"style":2208},"new"," Sys.Net.WebRequest();",[77,3220,3221],{"style":2205},[217,3222,1200,3223],{},[86,3224,3225],{"style":3151},"\u002F\u002F Set the request URL.      ",[77,3227,3228],{"style":2218},[217,3229,3230,3231,3202],{},"    wRequest.set_url(",[86,3232,3233],{"style":2274},"\"getTarget.htm\"",[77,3235,3236],{"style":2205},[217,3237,3198,3238,3202],{},[86,3239,3240],{"style":2274},"\"Target Url: getTarget.htm\"",[77,3242,3243],{"style":2218},[217,3244,1015],{},[77,3246,3247],{"style":2205},[217,3248,1200,3249],{},[86,3250,3251],{"style":3151},"\u002F\u002F Set the request verb.",[77,3253,3254],{"style":2218},[217,3255,3256,3257,3202],{},"    wRequest.set_httpVerb(",[86,3258,3259],{"style":2274},"\"GET\"",[77,3261,3262],{"style":2218},[217,3263,1200,3264],{},[86,3265,3266],{"style":3151},"\u002F\u002F Set the request callback function.",[77,3268,3269],{"style":2205},[217,3270,3271],{},"    wRequest.add_completed(OnWebRequestCompleted);",[77,3273,3274],{"style":2205},[217,3275,1200,3276],{},[86,3277,3278],{"style":3151},"\u002F\u002F Clear the results area.",[77,3280,3281],{"style":2218},[217,3282,3283,3284,1215],{},"    resultElement.innerHTML = ",[86,3285,2317],{"style":2274},[77,3287,3288],{"style":2205},[217,3289,1015],{},[77,3291,3292],{"style":2218},[217,3293,1200,3294],{},[86,3295,3296],{"style":3151},"\u002F\u002F Execute the request.",[77,3298,3299],{"style":2205},[217,3300,3301],{},"    wRequest.invoke();      ",[77,3303,3304],{"style":2218},[217,3305,2259],{},[77,3307,3308],{"style":2205},[217,3309,1015],{},[77,3311,3312],{"style":2218},[86,3313,3314],{"style":3151},[217,3315,3316],{},"\u002F\u002F This function performs a POST Web request.",[77,3318,3319],{"style":2205},[217,3320,3321],{},"function PostWebRequest() {",[77,3323,3324],{"style":2218},[217,3325,3198,3326,3202],{},[86,3327,3328],{"style":2274},"\"Performing Post Web request.\"",[77,3330,3331],{"style":2205},[217,3332,1015],{},[77,3334,3335],{"style":2218},[217,3336,1200,3337],{},[86,3338,3209],{"style":3151},[77,3340,3341],{"style":2205},[217,3342,3214,3343,3218],{},[86,3344,3217],{"style":2208},[77,3346,3347],{"style":2218},[217,3348,1015],{},[77,3350,3351],{"style":2205},[217,3352,1200,3353],{},[86,3354,3225],{"style":3151},[77,3356,3357],{"style":2218},[217,3358,3230,3359,3202],{},[86,3360,3361],{"style":2274},"\"postTarget.aspx\"",[77,3363,3364],{"style":2205},[217,3365,3198,3366,3202],{},[86,3367,3368],{"style":2274},"\"Target Url: postTarget.aspx\"",[77,3370,3371],{"style":2218},[217,3372,1015],{},[77,3374,3375],{"style":2205},[217,3376,1200,3377],{},[86,3378,3251],{"style":3151},[77,3380,3381],{"style":2218},[217,3382,3256,3383,3202],{},[86,3384,3385],{"style":2274},"\"POST\"",[77,3387,3388],{"style":2205},[217,3389,1015],{},[77,3391,3392],{"style":2218},[217,3393,1200,3394],{},[86,3395,3396],{"style":3151},"\u002F\u002F Set the request handler.",[77,3398,3399],{"style":2205},[217,3400,3271],{},[77,3402,3403],{"style":2218},[217,3404,1015],{},[77,3406,3407],{"style":2205},[217,3408,1200,3409],{},[86,3410,3411],{"style":3151},"\u002F\u002F Set the body for he POST.",[77,3413,3414],{"style":2218},[217,3415,3416],{},"    var requestBody =",[77,3418,3419],{"style":2205},[217,3420,2481,3421,1215],{},[86,3422,3423],{"style":2274},"\"Message=Hello! Do you hear me?\"",[77,3425,3426],{"style":2218},[217,3427,3428],{},"    wRequest.set_body(requestBody);",[77,3430,3431],{"style":2205},[217,3432,3433,3434,3437],{},"    wRequest.get_headers()[",[86,3435,3436],{"style":2274},"\"Content-Length\"","] =",[77,3439,3440],{"style":2218},[217,3441,3442],{},"        requestBody.length;",[77,3444,3445],{"style":2205},[217,3446,1015],{},[77,3448,3449],{"style":2218},[217,3450,1200,3451],{},[86,3452,3278],{"style":3151},[77,3454,3455],{"style":2205},[217,3456,3283,3457,1215],{},[86,3458,2317],{"style":2274},[77,3460,3461],{"style":2218},[217,3462,1015],{},[77,3464,3465],{"style":2205},[217,3466,1200,3467],{},[86,3468,3296],{"style":3151},[77,3470,3471],{"style":2218},[217,3472,3473],{},"    wRequest.invoke();",[77,3475,3476],{"style":2205},[217,3477,2259],{},[77,3479,3480],{"style":2218},[217,3481,1015],{},[77,3483,3484],{"style":2205},[217,3485,1015],{},[77,3487,3488],{"style":2218},[86,3489,3490],{"style":3151},[217,3491,3492],{},"\u002F\u002F This callback function processes the ",[77,3494,3495],{"style":2205},[86,3496,3497],{"style":3151},[217,3498,3499],{},"\u002F\u002F request return values. It is called asynchronously ",[77,3501,3502],{"style":2218},[86,3503,3504],{"style":3151},[217,3505,3506],{},"\u002F\u002F by the current executor.",[77,3508,3509],{"style":2205},[217,3510,3511],{},"function OnWebRequestCompleted(executor, eventArgs) {",[77,3513,3514],{"style":2218},[217,3515,1200,3516,3519],{},[86,3517,3518],{"style":2208},"if"," (executor.get_responseAvailable()) {",[77,3521,3522],{"style":2205},[217,3523,2481,3524],{},[86,3525,3526],{"style":3151},"\u002F\u002F Clear the previous results. ",[77,3528,3529],{"style":2218},[217,3530,3531,3532,1215],{},"        resultElement.innerHTML = ",[86,3533,2317],{"style":2274},[77,3535,3536],{"style":2205},[217,3537,1015],{},[77,3539,3540],{"style":2218},[217,3541,2481,3542],{},[86,3543,3544],{"style":3151},"\u002F\u002F Display Web request status. ",[77,3546,3547],{"style":2205},[217,3548,3549],{},"        resultElement.innerHTML +=",[77,3551,3552],{"style":2218},[217,3553,3554,3555,3558,3559,3562],{},"          ",[86,3556,3557],{"style":2274},"\"Status: [\""," + executor.get_statusCode() + ",[86,3560,3561],{"style":2274},"\" \""," +",[77,3564,3565],{"style":2205},[217,3566,3567,3568,3571,3572,1215],{},"                    executor.get_statusText() + ",[86,3569,3570],{"style":2274},"\"]\""," + ",[86,3573,3574],{"style":2274},"\"\u003Cbr\u002F>\"",[77,3576,3577],{"style":2218},[217,3578,1015],{},[77,3580,3581],{"style":2205},[217,3582,2481,3583],{},[86,3584,3585],{"style":3151},"\u002F\u002F Display Web request headers.",[77,3587,3588],{"style":2218},[217,3589,3590,3591,1215],{},"        resultElement.innerHTML += ",[86,3592,3593],{"style":2274},"\"Headers: \"",[77,3595,3596],{"style":2205},[217,3597,3598,3599,1215],{},"        resultElement.innerHTML += executor.getAllResponseHeaders() + ",[86,3600,3574],{"style":2274},[77,3602,3603],{"style":2218},[217,3604,1015],{},[77,3606,3607],{"style":2205},[217,3608,2481,3609],{},[86,3610,3611],{"style":3151},"\u002F\u002F Display Web request body.",[77,3613,3614],{"style":2218},[217,3615,3549,3616,1215],{},[86,3617,3618],{"style":2274},"\"Body:\"",[77,3620,3621],{"style":2205},[217,3622,1015],{},[77,3624,3625],{"style":2218},[217,3626,2481,3627,3629],{},[86,3628,3518],{"style":2208}," (document.all)",[77,3631,3632],{"style":2205},[217,3633,3634],{},"            resultElement.innerText += executor.get_responseData();",[77,3636,3637],{"style":2218},[217,3638,2481,3639],{},[86,3640,3641],{"style":2208},"else",[77,3643,3644],{"style":2205},[217,3645,3646],{},"            resultElement.textContent += executor.get_responseData();",[77,3648,3649],{"style":2218},[217,3650,2240],{},[77,3652,3653],{"style":2205},[217,3654,1015],{},[77,3656,3657],{"style":2218},[217,3658,2259],{},[77,3660,3661],{"style":2205},[217,3662,3663,1471,3665,3668,3669,3672],{},[86,3664,3518],{"style":2208},[86,3666,3667],{"style":2208},"typeof"," (Sys) !== ",[86,3670,3671],{"style":2274},"\"undefined\"",") Sys.Application.notifyScriptLoaded();","  \nTarget Html file used in the Get  \n",[1141,3675,499,3677,499],{"style":3676},"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 88.16%; font-family: consolas, 'Courier New', courier, monospace; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;",[1141,3678,499,3679,499,3690,499,3699,499,3704,499,3709,499,3714,499,3718,499,3723,499,3728,499,3733,499,3738,499,3742,499],{"style":2202},[77,3680,3681],{"style":2205},[217,3682,3683,3684,1156,3687,150],{},"\u003C!DOCTYPE html PUBLIC ",[86,3685,3686],{"style":2274},"\"-\u002F\u002FW3C\u002F\u002FDTD XHTML 1.0 Transitional\u002F\u002FEN\"",[86,3688,3689],{"style":2274},"\"http:\u002F\u002Fwww.w3.org\u002FTR\u002Fxhtml1\u002FDTD\u002Fxhtml1-transitional.dtd\"",[77,3691,3692],{"style":2218},[217,3693,3694,3695,3698],{},"\u003Chtml xmlns=",[86,3696,3697],{"style":2274},"\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml\""," >",[77,3700,3701],{"style":2205},[217,3702,3703],{},"\u003Chead>",[77,3705,3706],{"style":2218},[217,3707,3708],{},"    \u003Ctitle>Hello Page\u003C\u002Ftitle>",[77,3710,3711],{"style":2205},[217,3712,3713],{},"\u003C\u002Fhead>",[77,3715,3716],{"style":2218},[217,3717,2268],{},[77,3719,3720],{"style":2205},[217,3721,3722],{},"    \u003Cp> ",[77,3724,3725],{"style":2218},[217,3726,3727],{},"        Hello there. ",[77,3729,3730],{"style":2205},[217,3731,3732],{},"        I got your GET Web request!",[77,3734,3735],{"style":2218},[217,3736,3737],{},"    \u003C\u002Fp>",[77,3739,3740],{"style":2205},[217,3741,2403],{},[77,3743,3744],{"style":2218},[217,3745,3746],{},"\u003C\u002Fhtml>","  \nPost Aspx Page  \n",[1141,3749,499,3750,499],{"style":2700},[1141,3751,499,3752,499,3764,499,3768,499,3776,499,3780,499,3786,499,3796,499,3801,499,3810,499,3820,499,3825,499,3841,499,3846,499,3854,499,3858,499,3862,499,3866,499,3870,499,3874,499,3882,499,3887,499,3892,499,3897,499,3905,499,3914,499,3919,499,3924,499,3929,499,3933,499,3937,499],{"style":2202},[77,3753,3754],{"style":2205},[217,3755,3756,3757,3760,3761,3763],{},"\u003C%@ Page Language=",[86,3758,3759],{"style":2274},"\"C#\""," AutoEventWireup=",[86,3762,2289],{"style":2274},"  %>",[77,3765,3766],{"style":2218},[217,3767,1015],{},[77,3769,3770],{"style":2205},[217,3771,3683,3772,1156,3774,150],{},[86,3773,3686],{"style":2274},[86,3775,3689],{"style":2274},[77,3777,3778],{"style":2218},[217,3779,1015],{},[77,3781,3782],{"style":2205},[217,3783,3694,3784,3698],{},[86,3785,3697],{"style":2274},[77,3787,3788],{"style":2218},[217,3789,3790,3791,2113,3794,150],{},"\u003Chead id=",[86,3792,3793],{"style":2274},"\"Head1\"",[86,3795,138],{"style":2274},[77,3797,3798],{"style":2205},[217,3799,3800],{},"    \u003Ctitle>Post Target\u003C\u002Ftitle>",[77,3802,3803],{"style":2205},[217,3804,3805,3806,2113,3808,150],{},"    \u003Cscript language=",[86,3807,3759],{"style":2274},[86,3809,138],{"style":2274},[77,3811,3812],{"style":2205},[217,3813,2481,3814,1156,3816,2227,3818,2231],{},[86,3815,2224],{"style":2208},[86,3817,1189],{"style":2208},[86,3819,2230],{"style":2208},[77,3821,3822],{"style":2218},[217,3823,3824],{},"        {",[77,3826,3827],{"style":2205},[217,3828,3829,3830,3832,3833,3836,3837,3840],{},"            ",[86,3831,3518],{"style":2208}," (HttpContext.Current.Request.Form[",[86,3834,3835],{"style":2274},"\"Message\"","] != ",[86,3838,3839],{"style":2208},"null",")",[77,3842,3843],{"style":2218},[217,3844,3845],{},"                LabelID.Text = ",[77,3847,3848],{"style":2205},[217,3849,3850,3851,3853],{},"                    HttpContext.Current.Request.Form[",[86,3852,3835],{"style":2274},"].ToString();",[77,3855,3856],{"style":2218},[217,3857,2560],{},[77,3859,3860],{"style":2218},[217,3861,2583],{},[77,3863,3864],{"style":2205},[217,3865,1015],{},[77,3867,3868],{"style":2218},[217,3869,3713],{},[77,3871,3872],{"style":2205},[217,3873,2268],{},[77,3875,3876],{"style":2218},[217,3877,2271,3878,2113,3880,150],{},[86,3879,2275],{"style":2274},[86,3881,138],{"style":2274},[77,3883,3884],{"style":2205},[217,3885,3886],{},"    \u003Cdiv>",[77,3888,3889],{"style":2218},[217,3890,3891],{},"        \u003Ch1>WebRequestPost Target\u003C\u002Fh1>",[77,3893,3894],{"style":2218},[217,3895,3896],{},"        \u003Cp>",[77,3898,3899],{"style":2205},[217,3900,3901,3902,1101],{},"            \u003Casp:Textbox id=",[86,3903,3904],{"style":2274},"\"LabelID\"",[77,3906,3907],{"style":2218},[217,3908,3909,3910,2113,3912,2827],{},"                Text=",[86,3911,2915],{"style":2274},[86,3913,138],{"style":2274},[77,3915,3916],{"style":2205},[217,3917,3918],{},"        \u003C\u002Fp>",[77,3920,3921],{"style":2205},[217,3922,3923],{},"        Yes, I got your POST Web request!",[77,3925,3926],{"style":2205},[217,3927,3928],{},"    \u003C\u002Fdiv>",[77,3930,3931],{"style":2218},[217,3932,2400],{},[77,3934,3935],{"style":2205},[217,3936,2403],{},[77,3938,3939],{"style":2218},[217,3940,3746],{},[64,3942],{"style":3943,"src":3944,"alt":11},"display: none;","\u002Farticles\u002Fimages\u002Fajax.png",{"title":11,"searchDepth":12,"depth":12,"links":3946},[],"2015-04-20T08:07:16.5000000-04:00","There are many options within the Microsoft stack of products for AJAX type functionality.  The following article covers the primary mechanisms that utilize the Microsoft out of the box Ajax functionality.  Ajax must be one of the technologies used in all current web applications.  The primary benefit is the improved user experience by providing quick, responsive feedback. Core features include Ajax Client Libraries and Ajax Server Controls.",{},"\u002Farticles\u002Fmicrosoft-ajax-features-and-implementation-samples",{"title":2030,"description":3948},"articles\u002Fmicrosoft-ajax-features-and-implementation-samples",[18],"z4UUBACfZQdvJHc_1kqU_wGEoJgjO1kJ2Q4ROa2yb4M",{"id":3956,"title":3957,"author":28,"body":3958,"createdAt":5147,"description":298,"extension":15,"img":5144,"meta":5148,"navigation":19,"path":5149,"seo":5150,"stem":5151,"tags":5152,"updatedAt":5147,"__hash__":5153},"articles\u002Farticles\u002Fasp-net-updatepanel-updateprogress-controls-and-overlays-wait-messages.md","Asp.net UpdatePanel, UpdateProgress Controls and Overlays (Wait Messages)",{"type":8,"value":3959,"toc":5145},[3960,3966,3981,3987,3990,4234,4329,4478,4623,4625,4679,4681,4683,4755,4776,4779,4830,4833,5142],[32,3961,3962,3965],{},[217,3963,3964],{},"Scenario",": While a partial page postback is occurring disable all form fields and give the user a pleasant please wait message that can be used consistently across your application.  We need to create an overlay that works in conjunction with the updatepanel as well as direct from JavaScript.",[32,3967,3968,3971,3972,1156,3975,3978,3980],{},[217,3969,3970],{},"Problem",": Design the update progress html and css so that the entire page is overlaid with gray background.  This works pretty good ",[217,3973,3974],{},"until scrolling",[217,3976,3977],{},"on the page is involved.  When the page is tall enough that the browser scrolls the overlay must by sized dynamically with each post.  If you fail to do this, you will end up with odd visual with the overlay only covering a portion of the page.",[231,3979],{},"\nThe problem above is resolved in the solution described within this post.  It covers the asp.net, html, css and JavaScript code to accomplish the above in re-usable fashion.",[32,3982,3983,3984,3986],{},"I was using the UpdatePanel control which enables you to build rich, client-centric web applications.  By using the UpdatePanel controls you can refresh selected parts of the page instead of refreshing the whole page with a postback.  While the partial page post back occurs an UpdateProgress control is available to provide the user with a friendly ‘please wait’ message.  This all works seamlessly out of the box. ",[231,3985],{},"\nIn my scenario I needed to overlay and disable all controls (make unavailable) for the user while the partial page update happens.  The application allows for file uploads (which cannot participate in partial page updates).  A full post back must occur for this to work correctly. ",[32,3988,3989],{},"My ASPX page has the following structure with typical UpdatePanel, ContentTemplate, Triggers and UpdateProgress controls.  The trigger designates that the btnSubmitAdmin will perform a full postback.  I want the full postback user interaction to look similar as the partial page updates.  As a result, I will be using the same updateprogress visual for both partial and full postbacks.",[1141,3991,499,3994,499],{"id":3992,"style":3993},"codeSnippetWrapper","text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 94.2%; font-family: 'Courier New', courier, monospace; direction: ltr; height: 374px; max-height: 500px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;",[1141,3995,499,3998,499,499,4013,499,499,4030,499,1156,499,4055,499,499,4079,499,1156,499,4090,499,1156,499,4096,499,499,4105,499,499,4114,499,499,4129,499,499,4138,499,1156,499,4148,499,499,4182,499,499,4191,499,499,4210,499,499,4218,499,499,4226,499],{"id":3996,"style":3997},"codeSnippet","text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[77,3999,4001,4003,1156,4005,4008,4011],{"style":4000},"text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[86,4002,93],{"style":2208},[86,4004,2771],{"style":2711},[86,4006,4007],{"style":2714},"onload",[86,4009,4010],{"style":2208},"=\"fncOnLoad()\"",[86,4012,150],{"style":2208},[77,4014,4016,4018,1156,4020,4022,1156,4024,4026,4028],{"style":4015},"text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[86,4017,93],{"style":2208},[86,4019,2782],{"style":2711},[86,4021,2785],{"style":2714},[86,4023,2788],{"style":2208},[86,4025,2732],{"style":2714},[86,4027,2735],{"style":2208},[86,4029,150],{"style":2208},[77,4031,1200,4032,4034,1156,4036,4038,1156,4041,4043,1156,4045,4047,4049,4051,4053],{"style":4000},[86,4033,93],{"style":2208},[86,4035,2803],{"style":2711},[86,4037,2806],{"style":2714},[86,4039,4040],{"style":2208},"=\"Scriptmanager1\"",[86,4042,2732],{"style":2714},[86,4044,2735],{"style":2208},[86,4046,2816],{"style":2714},[86,4048,2819],{"style":2208},[86,4050,120],{"style":2208},[86,4052,2803],{"style":2711},[86,4054,150],{"style":2208},[77,4056,1200,4057,4059,1156,4062,4064,1156,4067,4069,1101,4071,4074,1156,4077],{"style":4000},[86,4058,93],{"style":2208},[86,4060,4061],{"style":2711},"asp:UpdatePanel",[86,4063,2806],{"style":2714},[86,4065,4066],{"style":2208},"=\"updatePanel1\"",[86,4068,2732],{"style":2714},[86,4070,2735],{"style":2208},[86,4072,4073],{"style":2714},"UpdateMode",[86,4075,4076],{"style":2208},"=\"Conditional\"",[86,4078,150],{"style":2208},[77,4080,4081,4082,4084,4087,4089],{"style":4015},"       ",[86,4083,93],{"style":2208},[86,4085,4086],{"style":2711},"ContentTemplate",[86,4088,150],{"style":2208},"               ",[77,4091,2481,4092,4095],{"style":4015},[86,4093,4094],{"style":3151},"\u003C!-- Content Goes Here -->","                ",[77,4097,3554,4098,4100,4102,4104],{"style":4015},[86,4099,205],{"style":2208},[86,4101,4086],{"style":2711},[86,4103,150],{"style":2208},"              ",[77,4106,2481,4107,4109,4112],{"style":4000},[86,4108,93],{"style":2208},[86,4110,4111],{"style":2711},"Triggers",[86,4113,150],{"style":2208},[77,4115,3829,4116,4118,1156,4121,4124,1156,4127,3829],{"style":4015},[86,4117,93],{"style":2208},[86,4119,4120],{"style":2711},"asp:PostBackTrigger",[86,4122,4123],{"style":2714},"ControlID",[86,4125,4126],{"style":2208},"=\"btnSubmitAdmin\"",[86,4128,2827],{"style":2208},[77,4130,2481,4131,4133,4135,4137],{"style":4000},[86,4132,205],{"style":2208},[86,4134,4111],{"style":2711},[86,4136,150],{"style":2208},"     ",[77,4139,4140,4141,4143,4145,4147],{"style":4015},"   ",[86,4142,205],{"style":2208},[86,4144,4061],{"style":2711},[86,4146,150],{"style":2208},"                    ",[77,4149,4140,4150,4152,1156,4155,4157,1156,4160,4162,1156,4164,4167,1156,4169,4172,1156,4174,4177,4180],{"style":4015},[86,4151,93],{"style":2208},[86,4153,4154],{"style":2711},"asp:UpdateProgress",[86,4156,2806],{"style":2714},[86,4158,4159],{"style":2208},"=\"UpdateProgress1\"",[86,4161,2732],{"style":2714},[86,4163,2735],{"style":2208},[86,4165,4166],{"style":2714},"AssociatedUpdatePanelID",[86,4168,4066],{"style":2208},[86,4170,4171],{"style":2714},"DynamicLayout",[86,4173,2819],{"style":2208},[86,4175,4176],{"style":2714},"DisplayAfter",[86,4178,4179],{"style":2208},"=\"1000\"",[86,4181,150],{"style":2208},[77,4183,2481,4184,4186,1156,4189],{"style":4000},[86,4185,93],{"style":2208},[86,4187,4188],{"style":2711},"ProgressTemplate",[86,4190,150],{"style":2208},[77,4192,2901,4194,4196,1156,4199,4201,1156,4204,4206,1156,4208],{"style":4193},"text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; height: 18px; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[86,4195,93],{"style":2208},[86,4197,4198],{"style":2711},"uc1:WaitPanel",[86,4200,2806],{"style":2714},[86,4202,4203],{"style":2208},"=\"WaitPanel1\"",[86,4205,2732],{"style":2714},[86,4207,2735],{"style":2208},[86,4209,2827],{"style":2208},[77,4211,2481,4212,4214,4216],{"style":4000},[86,4213,205],{"style":2208},[86,4215,4188],{"style":2711},[86,4217,150],{"style":2208},[77,4219,1200,4220,4222,4224,1200],{"style":4015},[86,4221,205],{"style":2208},[86,4223,4154],{"style":2711},[86,4225,150],{"style":2208},[77,4227,4228,4230,4232],{"style":4000},[86,4229,205],{"style":2208},[86,4231,2782],{"style":2711},[86,4233,150],{"style":2208},[1141,4235,499,4237,499],{"id":3992,"style":4236},"text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 350px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;",[1141,4238,499,4239,499,1156,499,4245,499,499,4258,499,499,4271,499,499,4286,499,499,4294,499,499,4313,499,499,4321,499],{"id":3996,"style":3997},[77,4240,4241],{"style":4000},[86,4242,4244],{"style":4243},"background-color: #ffff00;","\u003C%@ Control Language=\"VB\" AutoEventWireup=\"false\" CodeFile=\"WaitPanel.ascx.vb\" Inherits=\"Uc_WaitPanel\" %>",[77,4246,2481,4247,4249,1156,4251,4253,4256],{"style":4000},[86,4248,93],{"style":2208},[86,4250,1141],{"style":2711},[86,4252,2785],{"style":2714},[86,4254,4255],{"style":2208},"=\"OuterTableCellOverlay\"",[86,4257,150],{"style":2208},[77,4259,3829,4260,4262,1156,4264,4266,4269],{"style":4015},[86,4261,93],{"style":2208},[86,4263,1141],{"style":2711},[86,4265,2785],{"style":2714},[86,4267,4268],{"style":2208},"=\"InnerTableCellOverlay\"",[86,4270,150],{"style":2208},[77,4272,4095,4273,4275,4277,4279,4280,4282,4284],{"style":4000},[86,4274,93],{"style":2208},[86,4276,317],{"style":2711},[86,4278,150],{"style":2208},"... Please Wait ...",[86,4281,205],{"style":2208},[86,4283,317],{"style":2711},[86,4285,150],{"style":2208},[77,4287,4095,4288,4290,1156,4292],{"style":4015},[86,4289,93],{"style":2208},[86,4291,231],{"style":2711},[86,4293,2827],{"style":2208},[77,4295,4095,4296,4298,1156,4301,4303,1156,4305,4308,1156,4311,4095],{"style":4000},[86,4297,93],{"style":2208},[86,4299,4300],{"style":2711},"asp:Image",[86,4302,2732],{"style":2714},[86,4304,2735],{"style":2208},[86,4306,4307],{"style":2714},"ImageUrl",[86,4309,4310],{"style":2208},"=\"~\u002FImages\u002Findicator_waitanim.gif\"",[86,4312,2827],{"style":2208},[77,4314,3829,4315,4317,4319],{"style":4015},[86,4316,205],{"style":2208},[86,4318,1141],{"style":2711},[86,4320,150],{"style":2208},[77,4322,2481,4323,4325,4327,1101],{"style":4000},[86,4324,205],{"style":2208},[86,4326,1141],{"style":2711},[86,4328,150],{"style":2208},[1141,4330,499,4331,499],{"id":3992,"style":4236},[1141,4332,499,4333,499,499,4340,499,499,4346,499,499,4348,499,499,4380,499,499,4382,499,499,4394,499,499,4400,499,499,4406,499,499,4416,499,499,4424,499,499,4432,499,499,4439,499,499,4442,499,499,4444,499,499,4458,499,499,4465,499,499,4467,499,499,4473,499],{"id":3996,"style":3997},[77,4334,4335,4336,4339],{"style":4000},"Partial ",[86,4337,4338],{"style":2208},"Class"," Uc_WaitPanel",[77,4341,1200,4342,4345],{"style":4015},[86,4343,4344],{"style":2208},"Inherits"," System.Web.UI.UserControl",[77,4347,1015],{"style":4000},[77,4349,1200,4350,1156,4353,4356,4357,4360,4361,1156,4364,1564,4367,4369,4370,4372,4373,1156,4376,4379],{"style":4015},[86,4351,4352],{"style":2208},"Protected",[86,4354,4355],{"style":2208},"Sub"," Uc_WaitPanel_Load(",[86,4358,4359],{"style":2208},"ByVal"," sender ",[86,4362,4363],{"style":2208},"As",[86,4365,4366],{"style":2208},"Object",[86,4368,4359],{"style":2208}," e ",[86,4371,4363],{"style":2208}," System.EventArgs) ",[86,4374,4375],{"style":2208},"Handles",[86,4377,4378],{"style":2208},"Me",".Load",[77,4381,1015],{"style":4000},[77,4383,2481,4384,4387,4388,1156,4390,4393],{"style":4015},[86,4385,4386],{"style":2208},"Dim"," css ",[86,4389,4363],{"style":2208},[86,4391,4392],{"style":2208},"New"," HtmlLink()",[77,4395,2481,4396,4399],{"style":4000},[86,4397,4398],{"style":2208},"With"," css",[77,4401,4402,4403,3840],{"style":4015},"            .Href = ResolveClientUrl(",[86,4404,4405],{"style":2274},"\"~\u002FStyle\u002FWait.css\"",[77,4407,4408,4409,4412,4413],{"style":4000},"            .Attributes(",[86,4410,4411],{"style":2274},"\"rel\"",") = ",[86,4414,4415],{"style":2274},"\"stylesheet\"",[77,4417,4408,4418,4412,4421],{"style":4015},[86,4419,4420],{"style":2274},"\"type\"",[86,4422,4423],{"style":2274},"\"text\u002Fcss\"",[77,4425,4408,4426,4412,4429],{"style":4000},[86,4427,4428],{"style":2274},"\"media\"",[86,4430,4431],{"style":2274},"\"all\"",[77,4433,2481,4434,1156,4437],{"style":4015},[86,4435,4436],{"style":2208},"End",[86,4438,4398],{"style":2208},[77,4440,4441],{"style":4000},"        Page.Header.Controls.Add(css)",[77,4443,1015],{"style":4015},[77,4445,2481,4446,4448,4449,1156,4451,4454,4455,3840],{"style":4000},[86,4447,4386],{"style":2208}," url ",[86,4450,4363],{"style":2208},[86,4452,4453],{"style":2208},"String"," = ResolveClientUrl(",[86,4456,4457],{"style":2274},"\"~\u002FScripts\u002FWait.js\"",[77,4459,4460,4461,4464],{"style":4015},"        Page.ClientScript.RegisterClientScriptInclude(",[86,4462,4463],{"style":2274},"\"wait\"",", url)",[77,4466,1015],{"style":4000},[77,4468,1200,4469,1156,4471],{"style":4015},[86,4470,4436],{"style":2208},[86,4472,4355],{"style":2208},[77,4474,4475,4477],{"style":4000},[86,4476,4436],{"style":2208}," Class",[1141,4479,499,4480,499],{"id":3992},[1141,4481,499,4482,499,499,4487,499,499,4490,499,499,4492,499,499,4500,499,499,4503,499,499,4509,499,499,4515,499,499,4523,499,499,4530,499,499,4538,499,499,4544,499,499,4550,499,1156,499,4552,499,499,4555,499,499,4557,499,499,4565,499,499,4573,499,499,4580,499,499,4585,499,499,4591,499,499,4594,499,499,4600,499,499,4607,499,499,4613,499,499,4621,499],{"id":3996,"style":3997},[77,4483,4484],{"style":4000},[86,4485,4486],{"style":3151},"\u002F* updateprogress css *\u002F",[77,4488,4489],{"style":4015},"    #OuterTableCellOverlay",[77,4491,2234],{"style":4000},[77,4493,2481,4494,1465,4497,1101],{"style":4015},[86,4495,4496],{"style":2208},"background-color",[86,4498,4499],{"style":2274},"white;",[77,4501,4502],{"style":4000},"        filter:alpha(opacity=85);",[77,4504,4505,4506,2481],{"style":4015},"        -moz-opacity:",[86,4507,4508],{"style":2274},"0.85;",[77,4510,4511,4512],{"style":4000},"        z-index: ",[86,4513,4514],{"style":2274},"999;",[77,4516,2481,4517,1465,4520],{"style":4015},[86,4518,4519],{"style":2208},"width",[86,4521,4522],{"style":2274},"100%;",[77,4524,2481,4525,1465,4528],{"style":4000},[86,4526,4527],{"style":2208},"height",[86,4529,4522],{"style":2274},[77,4531,2481,4532,1465,4535],{"style":4015},[86,4533,4534],{"style":2208},"position",[86,4536,4537],{"style":2274},"absolute;",[77,4539,2481,4540,4543],{"style":4000},[86,4541,4542],{"style":2208},"top",": 0;",[77,4545,2481,4546,4549],{"style":4015},[86,4547,4548],{"style":2208},"left",": 0;                        ",[77,4551,2240],{"style":4000},[77,4553,4554],{"style":4000},"    #InnerTableCellOverlay",[77,4556,2234],{"style":4015},[77,4558,2481,4559,1465,4562],{"style":4000},[86,4560,4561],{"style":2208},"border",[86,4563,4564],{"style":2274},"1px solid black;",[77,4566,2481,4567,1465,4570],{"style":4015},[86,4568,4569],{"style":2208},"padding",[86,4571,4572],{"style":2274},"10px;",[77,4574,2481,4575,1465,4577],{"style":4000},[86,4576,4496],{"style":2208},[86,4578,4579],{"style":2274},"#eee;",[77,4581,4511,4582],{"style":4015},[86,4583,4584],{"style":2274},"998;",[77,4586,2481,4587,1465,4589],{"style":4000},[86,4588,4496],{"style":2208},[86,4590,4579],{"style":2274},[77,4592,4593],{"style":4015},"        filter:alpha(opacity=100);",[77,4595,2481,4596,1465,4598],{"style":4000},[86,4597,4534],{"style":2208},[86,4599,4537],{"style":2274},[77,4601,2481,4602,1465,4604],{"style":4015},[86,4603,4542],{"style":2208},[86,4605,4606],{"style":2274},"0pt;",[77,4608,2481,4609,1465,4611,3829],{"style":4000},[86,4610,4548],{"style":2208},[86,4612,4606],{"style":2274},[77,4614,2481,4615,1465,4618,2481],{"style":4015},[86,4616,4617],{"style":2208},"text-align",[86,4619,4620],{"style":2274},"center;",[77,4622,2240],{"style":4000},[1141,4624,1015],{"id":3992},[1141,4626,499,4627,499],{"id":3992},[1141,4628,499,4629,499,499,4652,499,499,4664,499],{"id":3996,"style":3997},[77,4630,4631,4633,1156,4635,4637,1156,4639,4641,1156,4643,4645,1156,4647,4649,1156],{"style":4000},[86,4632,93],{"style":2208},[86,4634,2836],{"style":2711},[86,4636,2806],{"style":2714},[86,4638,4126],{"style":2208},[86,4640,2732],{"style":2714},[86,4642,2735],{"style":2208},[86,4644,2848],{"style":2714},[86,4646,2851],{"style":2208},[86,4648,292],{"style":2714},[86,4650,4651],{"style":2208},"=\"width:100px;\"",[77,4653,3554,4654,4656,1156,4659,4661,1156],{"style":4015},[86,4655,2860],{"style":2714},[86,4657,4658],{"style":2208},"=\"return fncValidateSubmit('Ready to Submit?');\"",[86,4660,2854],{"style":2714},[86,4662,4663],{"style":2208},"=\"Save\"",[77,4665,3554,4666,4669,1156,4671,4674,1156,4677],{"style":4000},[86,4667,4668],{"style":2714},"ToolTip",[86,4670,4663],{"style":2208},[86,4672,4673],{"style":2714},"Visible",[86,4675,4676],{"style":2208},"=\"false\"",[86,4678,2827],{"style":2208},[1141,4680,1015],{},[1141,4682,1015],{},[1141,4684,499,4685,499],{"id":3992},[1141,4686,499,4688,499,499,4693,499,499,4698,499,499,4703,499,499,4711,499,499,4717,499,499,4722,499,499,4728,499,499,4733,499,1156,499,4736,499,499,4742,499,499,4745,499,499,4751,499,499,4753,499],{"id":3996,"style":4687},"text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; height: 239px; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[77,4689,4690],{"style":4000},[86,4691,4692],{"style":3151},"\u002F\u002Fvalidate before submitting signature authority            ",[77,4694,1200,4695,4697],{"style":4015},[86,4696,1468],{"style":2208}," fncValidateSubmit(msg) {",[77,4699,2481,4700],{"style":4000},[86,4701,4702],{"style":3151},"\u002F\u002Fperform some client side validation checks here...",[77,4704,2481,4705,4707,4708,4710],{"style":4015},[86,4706,3518],{"style":2208}," (valid == ",[86,4709,1446],{"style":2208},") {",[77,4712,3829,4713,4716],{"style":4000},[86,4714,4715],{"style":2208},"var"," answer = confirm(msg);                    ",[77,4718,3829,4719,4721],{"style":4015},[86,4720,3518],{"style":2208}," (answer) {",[77,4723,4724,4725,3202],{"style":4000},"                ShowWait(",[86,4726,4727],{"style":2274},"'UpdateProgress1'",[77,4729,4095,4730,4732],{"style":4015},[86,4731,1481],{"style":2208}," answer;",[77,4734,4735],{"style":4000},"            }",[77,4737,4738,4739,4741],{"style":4000},"        } ",[86,4740,3641],{"style":2208}," {",[77,4743,4744],{"style":4015},"            alert(errmsg);",[77,4746,3829,4747,1156,4749,1215],{"style":4000},[86,4748,1481],{"style":2208},[86,4750,2929],{"style":2208},[77,4752,2560],{"style":4015},[77,4754,2240],{"style":4000},[1141,4756,499,4757,499],{"id":3992},[1141,4758,499,4760,499,499,4765,499,499,4768,499,499,4774,499],{"id":3996,"style":4759},"text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; height: 64px; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;",[77,4761,4762,4764],{"style":4000},[86,4763,1468],{"style":2208}," ShowWait(progressControlId) {",[77,4766,4767],{"style":4015},"    SetWaitDimensions();",[77,4769,4770,4771,1215],{"style":4000},"    document.getElementById(progressControlId).style.display = ",[86,4772,4773],{"style":2274},"'block'",[77,4775,2259],{"style":4015},[217,4777,4778],{},"This was an problem.",[1141,4780,499,4782,499],{"id":3992,"style":4781},"text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; height: 204px; max-height: 500px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;",[1141,4783,499,4784,499,499,4798,499,499,4801,499,499,4804,499,499,4807,499,499,4810,499,499,4813,499,499,4816,499,499,4819,499,499,4822,499,499,4825,499,499,4828,499],{"id":3996,"style":3997},[77,4785,4786,4787,4789,1156,4791,4793,4796],{"style":4000},"\u002F\u002F\u002F\u002Fcall the following from ",[86,4788,93],{"style":2208},[86,4790,2771],{"style":2711},[86,4792,4007],{"style":2714},[86,4794,4795],{"style":2208},"=\"load()\"",[86,4797,150],{"style":2208},[77,4799,4800],{"style":4015},"\u002F\u002F\u002F\u002Frequired so that background blur is dimensioned correctly (with respect to scroll issues with browser)",[77,4802,4803],{"style":4000},"\u002F\u002F\u002F\u002Fenable js to be called after ajax postback",[77,4805,4806],{"style":4015},"function loadAjaxHandlers() {",[77,4808,4809],{"style":4000},"    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);",[77,4811,4812],{"style":4015},"    \u002F\u002Fwill process during the initialization of the postback",[77,4814,4815],{"style":4000},"    Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(",[77,4817,4818],{"style":4015},"                    function() {",[77,4820,4821],{"style":4000},"                        SetWaitDimensions();",[77,4823,4824],{"style":4015},"                    }",[77,4826,4827],{"style":4000},"               )",[77,4829,2259],{"style":4015},[32,4831,4832],{},"The following is my complete Wait.js file which you can see sizes the overlay and positions the wait message.",[1141,4834,499,4836,499],{"id":3992,"style":4835},"text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 500px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;",[1141,4837,499,4838,499,499,4843,499,499,4847,499,499,4851,499,499,4856,499,499,4858,499,499,4863,499,499,4865,499,499,4870,499,499,4872,499,499,4874,499,499,4876,499,499,4878,499,499,4880,499,499,4884,499,499,4886,499,499,4890,499,499,4892,499,499,4894,499,499,4899,499,499,4904,499,499,4909,499,499,4917,499,499,4925,499,499,4927,499,499,4933,499,499,4939,499,499,4941,499,499,4946,499,499,4951,499,499,4956,499,499,4958,499,499,4963,499,499,4969,499,499,4973,499,499,4978,499,499,4984,499,499,4986,499,499,4991,499,499,4996,499,499,4998,499,499,5008,499,499,5017,499,499,5019,499,499,5021,499,499,5023,499,499,5028,499,499,5033,499,499,5038,499,499,5043,499,499,5046,499,499,5049,499,499,5057,499,499,5060,499,499,5063,499,499,5067,499,499,5070,499,499,5073,499,499,5075,499,499,5080,499,499,5082,499,499,5084,499,499,5089,499,499,5094,499,499,5099,499,499,5102,499,499,5105,499,499,5110,499,499,5112,499,499,5114,499,499,5119,499,499,5124,499,499,5129,499,499,5132,499,499,5135,499,499,5140,499],{"id":3996,"style":3997},[77,4839,4840],{"style":4000},[86,4841,4842],{"style":3151},"\u002F\u002F\u002F\u002Fcall the following from \u003Cbody onload=\"load()\">",[77,4844,4845],{"style":4015},[86,4846,4800],{"style":3151},[77,4848,4849],{"style":4000},[86,4850,4803],{"style":3151},[77,4852,4853,4855],{"style":4015},[86,4854,1468],{"style":2208}," loadAjaxHandlers() {",[77,4857,4809],{"style":4000},[77,4859,1200,4860],{"style":4015},[86,4861,4862],{"style":3151},"\u002F\u002Fwill process during the initialization of the postback",[77,4864,4815],{"style":4000},[77,4866,4147,4867,4869],{"style":4015},[86,4868,1468],{"style":2208},"() {",[77,4871,4821],{"style":4000},[77,4873,4824],{"style":4015},[77,4875,4827],{"style":4000},[77,4877,2259],{"style":4015},[77,4879,1015],{"style":4000},[77,4881,4882,4764],{"style":4015},[86,4883,1468],{"style":2208},[77,4885,4767],{"style":4000},[77,4887,4770,4888,1215],{"style":4015},[86,4889,4773],{"style":2274},[77,4891,2259],{"style":4000},[77,4893,1015],{"style":4015},[77,4895,4896],{"style":4000},[86,4897,4898],{"style":3151},"\u002F\u002Fset dimensions of blur element, positions progress box",[77,4900,4901,4903],{"style":4015},[86,4902,1468],{"style":2208}," SetWaitDimensions() {",[77,4905,1200,4906,4908],{"style":4000},[86,4907,3518],{"style":2208}," (document.getElementById) {",[77,4910,2481,4911,4913,4914,3202],{"style":4015},[86,4912,4715],{"style":2208}," blur = document.getElementById(",[86,4915,4916],{"style":2274},"'OuterTableCellOverlay'",[77,4918,2481,4919,4921,4922,3202],{"style":4000},[86,4920,4715],{"style":2208}," progress = document.getElementById(",[86,4923,4924],{"style":2274},"'InnerTableCellOverlay'",[77,4926,1015],{"style":4015},[77,4928,4929,4930,1215],{"style":4000},"        progress.style.width = ",[86,4931,4932],{"style":2274},"'444px'",[77,4934,4935,4936,1215],{"style":4015},"        progress.style.height = ",[86,4937,4938],{"style":2274},"'100px'",[77,4940,1015],{"style":4000},[77,4942,2481,4943,4945],{"style":4015},[86,4944,4715],{"style":2208}," vp = getViewport();",[77,4947,2481,4948,4950],{"style":4000},[86,4949,4715],{"style":2208}," dm = getElementDimensions(document.body);",[77,4952,2481,4953,4955],{"style":4015},[86,4954,4715],{"style":2208}," sp = getScrollPosition();",[77,4957,1015],{"style":4000},[77,4959,2481,4960,4962],{"style":4015},[86,4961,3518],{"style":2208}," (vp.height > dm.height)",[77,4964,4965,4966,1215],{"style":4000},"            blur.style.height = vp.height + ",[86,4967,4968],{"style":2274},"'px'",[77,4970,2481,4971],{"style":4015},[86,4972,3641],{"style":2208},[77,4974,4975,4976,1215],{"style":4000},"            blur.style.height = dm.height + ",[86,4977,4968],{"style":2274},[77,4979,4980,4981,1215],{"style":4015},"        blur.style.width = ",[86,4982,4983],{"style":2274},"'100%'",[77,4985,1015],{"style":4000},[77,4987,4988,4989,1215],{"style":4015},"        blur.style.top = (sp.y + ((vp.height - dm.height) \u002F 3)) + ",[86,4990,4968],{"style":2274},[77,4992,4993,4994,1215],{"style":4000},"        blur.style.left = (sp.x + ((vp.width - dm.width) \u002F 2)) + ",[86,4995,4968],{"style":2274},[77,4997,1015],{"style":4015},[77,4999,5000,5001,1564,5003,5005,5006,1215],{"style":4000},"        progress.style.top = document.documentElement.clientHeight \u002F 3 - progress.style.height.replace(",[86,5002,4968],{"style":2274},[86,5004,1635],{"style":2274},") \u002F 2 + ",[86,5007,4968],{"style":2274},[77,5009,5010,5011,1564,5013,5005,5015,1215],{"style":4015},"        progress.style.left = document.body.offsetWidth \u002F 2 - progress.style.width.replace(",[86,5012,4968],{"style":2274},[86,5014,1635],{"style":2274},[86,5016,4968],{"style":2274},[77,5018,1015],{"style":4000},[77,5020,2240],{"style":4015},[77,5022,2259],{"style":4000},[77,5024,5025],{"style":4015},[86,5026,5027],{"style":3151},"\u002F\u002Freturns view port dimensions",[77,5029,5030,5032],{"style":4000},[86,5031,1468],{"style":2208}," getViewport() {",[77,5034,1200,5035,5037],{"style":4015},[86,5036,4715],{"style":2208}," v = { width: 0, height: 0 };",[77,5039,1200,5040,5042],{"style":4000},[86,5041,3518],{"style":2208}," (window.innerHeight) {",[77,5044,5045],{"style":4015},"        v.height = window.innerHeight;",[77,5047,5048],{"style":4000},"        v.width = window.innerWidth;",[77,5050,5051,5052,1156,5054,5056],{"style":4015},"    } ",[86,5053,3641],{"style":2208},[86,5055,3518],{"style":2208}," (document.documentElement.clientHeight) {",[77,5058,5059],{"style":4000},"        v.height = document.documentElement.clientHeight;",[77,5061,5062],{"style":4015},"        v.width = document.documentElement.clientWidth;",[77,5064,5051,5065,4741],{"style":4000},[86,5066,3641],{"style":2208},[77,5068,5069],{"style":4015},"        v.height = document.body.clientHeight;",[77,5071,5072],{"style":4000},"        v.width = document.body.clientWidth;",[77,5074,2240],{"style":4015},[77,5076,1200,5077,5079],{"style":4000},[86,5078,1481],{"style":2208}," v;",[77,5081,2259],{"style":4015},[77,5083,1015],{"style":4000},[77,5085,5086],{"style":4015},[86,5087,5088],{"style":3151},"\u002F\u002Freturns dimensions of element",[77,5090,5091,5093],{"style":4000},[86,5092,1468],{"style":2208}," getElementDimensions(el) {",[77,5095,1200,5096,5098],{"style":4015},[86,5097,4715],{"style":2208}," dim = { width: 0, height: 0 };",[77,5100,5101],{"style":4000},"    dim.width = el.offsetWidth;",[77,5103,5104],{"style":4015},"    dim.height = el.offsetHeight;",[77,5106,1200,5107,5109],{"style":4000},[86,5108,1481],{"style":2208}," dim;",[77,5111,2259],{"style":4015},[77,5113,1015],{"style":4000},[77,5115,5116],{"style":4015},[86,5117,5118],{"style":3151},"\u002F\u002Freturns window scroll position",[77,5120,5121,5123],{"style":4000},[86,5122,1468],{"style":2208}," getScrollPosition() {",[77,5125,1200,5126,5128],{"style":4015},[86,5127,4715],{"style":2208}," pos = { x: 0, y: 0 };",[77,5130,5131],{"style":4000},"    pos.x = window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft;",[77,5133,5134],{"style":4015},"    pos.y = window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop;",[77,5136,1200,5137,5139],{"style":4000},[86,5138,1481],{"style":2208}," pos;",[77,5141,2259],{"style":4015},[64,5143],{"style":3943,"src":5144,"alt":11},"\u002Farticles\u002Fimages\u002Fpanel.jpg",{"title":11,"searchDepth":12,"depth":12,"links":5146},[],"2015-04-20T08:07:16.0300000-04:00",{},"\u002Farticles\u002Fasp-net-updatepanel-updateprogress-controls-and-overlays-wait-messages",{"title":3957,"description":298},"articles\u002Fasp-net-updatepanel-updateprogress-controls-and-overlays-wait-messages",[18],"0Cy_xmk1pTHqsntDFTdovnbYtmnSiOumdscBNMxpfJ4",{"id":5155,"title":5156,"author":28,"body":5157,"createdAt":5175,"description":298,"extension":15,"img":298,"meta":5176,"navigation":19,"path":5177,"seo":5178,"stem":5179,"tags":5180,"updatedAt":5175,"__hash__":5181},"articles\u002Farticles\u002Foutput-text-to-log-file.md","Output text to log file",{"type":8,"value":5158,"toc":5173},[5159,5164,5170],[32,5160,5161,5162,1395],{},"The following method can be used save string messages out to log files.  In the code below I am using a couple class fields to establish the log file name.  These can be customized to meet your need.",[231,5163],{},[77,5165,5169],{"className":5166},[5167,5168],"brush:","csharp","  \npublic void Output(string message) {  \n        if (_logFilePath != stringEmpty) {  \n        string fileName = \"LogFile\";  \n        if (_contentDatabaseName != string.Empty)  \n            fileName += \"_\" + _contentDatabaseName;  \n  \n        fileName += \".txt\";  \n        string filePath = System.IO.Path.Combine(_logFilePath, fileName);  \n        System.IO.StreamWriter sw = System.IO.File.AppendText(filePath); \u002F\u002F Change filename  \n        try {  \n            string logLine = System.String.Format(\"{0:G}: {1}.\", System.DateTime.Now, message);  \n            sw.WriteLine(logLine);  \n        } finally {  \n            sw.Close();  \n        }  \n    }  \n}",[32,5171,5172],{},"Cool eh?",{"title":11,"searchDepth":12,"depth":12,"links":5174},[],"2015-04-20T08:07:14.3500000-04:00",{},"\u002Farticles\u002Foutput-text-to-log-file",{"title":5156,"description":298},"articles\u002Foutput-text-to-log-file",[18],"-p4EpWiQEkv4r2hKPqYV9kpN3R2ct3mifyOTeovi3gM",{"id":5183,"title":5184,"author":28,"body":5185,"createdAt":5232,"description":298,"extension":15,"img":298,"meta":5233,"navigation":19,"path":5234,"seo":5235,"stem":5236,"tags":5237,"updatedAt":5232,"__hash__":5238},"articles\u002Farticles\u002Fiterate-over-object-properties-and-property-attributes-w-reflection.md","Iterate Over Object Properties and Property Attributes w\u002FReflection",{"type":8,"value":5186,"toc":5230},[5187,5190,5220,5226],[32,5188,5189],{},"Define custom attribute class as follows as well as placing the attribute reference on the property “FirstName”.  In the following we are creating our own custom attribute by defining an attribute class which derives from Attribute which makes identifying attribute definitions in metadata easy.  The AttributeUsage attribute can be used to limit which asset the attribute can be placed such as class, struct, property etc.  In addition, in the example below I have disallowed multiple similar attributes from being used on the same property designated by AllowMultiple = false     ",[77,5191,1200,5193,5196,5198,5199,5207,5218],{"className":5192},[5167,5168],[86,5194,5195],{},"AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)",[231,5197],{},"\npublic class CustomItemAttribute : Attribute {",[77,5200,5205],{"className":5201,"code":5203,"language":5204},[5202],"language-text","    public string FieldName { get; set; }  \n\n    private bool _isMultiValue = false;  \n    public bool IsMultiValue {  \n        get { return _isMultiValue; }  \n        set {  \n            _isMultiValue = value;  \n        }  \n    }  \n\n    public CustomItemAttribute(string fieldName) {  \n        this.FieldName = fieldName;          \n    }  \n}  \n","text",[83,5206,5203],{"__ignoreMap":11},[32,5208,5209,5210,5212,5215,5217],{},"public class Item{",[231,5211],{},[86,5213,5214],{},"CustomItem(\"myfieldname\")",[231,5216],{},"\npublic string FirstName { get; set;}",[32,5219,2259],{},[32,5221,5222,5223,5225],{},"Now to iterate over the properties. Notice in the class Item above how we can exclude the 'Attribute' text in the name of the attribute applied to the FirstName property. Below we can use Type.GetProperties method to get the names of the properties for a specific type. The method GetProperties returns an array of PropertyInfo objects and the property names aer available through PropertyInfo.Name. If you want to get only a subset of the properties such as public static ones you can use BindingFlags parameters (Public\u002FNonPublic, Instance\u002FStatic). i.e. PropertyInfo",[86,5224],{}," infos = typeof(Item).GetProperties(BindingFlags.Public|BindingFlags.Static);",[77,5227,5229],{"className":5228},[5167,5168],"        private void IterateOverProperties() {  \n            CustomItemAttribute customItemAttribute;  \n            Type type = typeof(Item);  \n        \u002F\u002Ffor each property of object of Item  \n            foreach (PropertyInfo propInfo in type.GetProperties()) {  \n                \u002F\u002Ffor each custom attribute on the property loop  \n                foreach CustomItemAttribute attr in propInfo.GetCustomAttributes(typeof(CustomItemAttribute), false)) {  \n                    customItemAttribute = attr as CustomItemAttribute;  \n                    if (customItemAttribute != null) {  \n                        string propertyName = propInfo.Name;  \n                        string fieldName = customItemAttribute.FieldName;              \n            \u002F\u002FTODO: add your logic here  \n                    }   \n                }  \n            }  \n        }",{"title":11,"searchDepth":12,"depth":12,"links":5231},[],"2015-04-20T08:07:14.1700000-04:00",{},"\u002Farticles\u002Fiterate-over-object-properties-and-property-attributes-w-reflection",{"title":5184,"description":298},"articles\u002Fiterate-over-object-properties-and-property-attributes-w-reflection",[18],"ZthYNR0xRiDSvIjg9fVGjlPJjgpoE9X9J0htudQFbIM",{"id":5240,"title":5241,"author":28,"body":5242,"createdAt":5276,"description":5277,"extension":15,"img":5278,"meta":5279,"navigation":19,"path":5280,"seo":5281,"stem":5282,"tags":5283,"updatedAt":5276,"__hash__":5285},"articles\u002Farticles\u002Fnet-4-new-gac-locations-gacutil.md",".NET 4 New GAC Locations\u002FGacUtil",{"type":8,"value":5243,"toc":5274},[5244,5247,5250,5253,5256,5259,5262,5265,5268,5271],[32,5245,5246],{}," This is what I know, let me know if you know otherwise.  There are now 2 distinct GAC locations that you have to manage as of the .NET 4 Framework release.",[32,5248,5249],{},"The GAC was split into two, one for each CLR (2.0, 3.5 AND 4.0).  The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0. To avoid issues between CLR 2.0 and CLR 4.0 , the GAC is now split into private GAC’s for each runtime.  The main change is that CLR v2.0 applications now cannot see CLR v4.0 assemblies in the GAC.",[32,5251,5252],{},"In previous .NET versions, when I installed a .NET assembly into the GAC (using gacutil.exe or even drag and drop to the c:\\windows\\assembly directory), I could find it in the ‘C:\\Windows\\assembly’ path.",[32,5254,5255],{},"With .NET 4.0, GAC is now located in the 'C:\\Windows\\Microsoft.NET\\assembly’ path.",[32,5257,5258],{},"In order to install a dll to the .NET 4 GAC it is necessary to use the gacutil found C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\GacUtil.exe  In addition, you can no longer use the drag n' drop (in reality the drag n' drop really executed the gacutil via a windows explorer extension).",[32,5260,5261],{},"After you use the gacutil.exe -i {path to dll} you can view that it is indeed in the gac via gacutil -l (which will list all dlls in the gac).  I used this command and piped the results to a text file via > out.txt which made it easier to find the recently added component.",[32,5263,5264],{},"I was not able to see my gac object in the directory for .net 4 (i.e. c:\\windows\\microsoft.net\\assembly path).  I am not sure why just yet.  Ideas?",[32,5266,5267],{},"At this point, the object is in the local gac however if you are using vs.net 2010 it will still not show up in the list of references. To get the component to show up in the VS.NET list of references can add a registry entry to HKLM\\SOFTWARE\\WOW6432Node\\Microsoft.NETFramework\\v4.0.30319\\AssemblyFoldersEx  At this point, the component is in the local GAC and is in the list of references to be used by vs.net.",[32,5269,5270],{},"Note, I did find that if I just added the path to the registry without adding it to the gac it was available to vs.net.  So, because the component is listed via vs.net add references it does not necessarily mean it is in the gac.",[32,5272,5273],{},"What still confuses me is that I am still unable to view my recently added component in the .NET 4 directories above.  Ideas?",{"title":11,"searchDepth":12,"depth":12,"links":5275},[],"2015-04-20T08:07:14.0800000-04:00","There are now 2 distinct GAC locations that you have to manage as of the .NET 4 Framework release...","\u002Farticles\u002Fimages\u002Fggb4dMDcZM.png",{},"\u002Farticles\u002Fnet-4-new-gac-locations-gacutil",{"title":5241,"description":5277},"articles\u002Fnet-4-new-gac-locations-gacutil",[18,5284],"enterpriselibrary","2K_K7LqZ6HZ_OhbA_zCui0-ixHdV9XtLRHPoIkAcdss",{"id":5287,"title":5288,"author":28,"body":5289,"createdAt":5351,"description":5352,"extension":15,"img":5346,"meta":5353,"navigation":19,"path":5354,"seo":5355,"stem":5356,"tags":5357,"updatedAt":5351,"__hash__":5358},"articles\u002Farticles\u002Fjson-know-more.md","Json–know more",{"type":8,"value":5290,"toc":5347},[5291,5308,5313,5317,5322,5325,5329,5332,5344],[32,5292,5293,5294,5296,5299,5300,5302,5303,5305,5307],{},"{“People”:{",[231,5295],{},[86,5297,5298],{},"\n{“name”:”frank”, “age”:”21”},\n{“name”:”joe”,”age”:44”}\n",",",[231,5301],{},"\n“Markeing”:",[86,5304,5298],{},[231,5306],{},"\n} }",[5309,5310,5312],"h4",{"id":5311},"squiggles-squares-colons-and-commas","Squiggles, Squares, Colons and Commas",[5314,5315,5316],"ol",{},"  \n* Squiggly brackets act as 'containers'   \n* Square brackets holds arrays   \n* Names and values are separated by a colon.   \n* Array elements are separated by commas  \n",[5318,5319,5321],"h3",{"id":5320},"json-is-like-xml-because","\nJSON is like XML because:",[5314,5323,5324],{},"  \n* They are both 'self-describing' meaning that values are named, and thus 'human readable'   \n* Both are hierarchical. (i.e. You can have values within values.)   \n* Both can be parsed and used by lots of programming languages   \n* Both can be passed around using AJAX (i.e. httpWebRequest)  \n",[5318,5326,5328],{"id":5327},"json-is-unlike-xml-because","JSON is UNlike XML because:",[5314,5330,5331],{},"  \n* XML uses angle brackets, with a tag name at the start and end of an element: JSON uses squiggly brackets with the name only at the beginning of the element.   \n* JSON is less verbose so it's definitely quicker for humans to write, and probably quicker for us to read.   \n* JSON can be parsed trivially using the eval() procedure in JavaScript   \n* JSON includes arrays {where each element doesn't have a name of its own}   \n* In XML you can use any name you want for an element, in JSON you can't use reserved words from javascript  \n",[32,5333,5334,5335,5338,5339,5343],{},"On the server-side you can easily serialize\u002Fdeserialize your objects to\u002Ffrom JSON. For ",[83,5336,5337],{},".net"," programmers you can use libraries like ",[36,5340,5342],{"href":5341},"http:\u002F\u002Fwww.newtonsoft.com\u002Fproducts\u002Fjson\u002F","Json.net"," to do this automatically for you (using reflection i assume), or you can generate your own custom code to perform it even faster on a case by case basis.",[64,5345],{"src":5346,"alt":11,"style":1370},"\u002Farticles\u002Fimages\u002FJSON.gif",{"title":11,"searchDepth":12,"depth":12,"links":5348},[5349,5350],{"id":5320,"depth":167,"text":5321},{"id":5327,"depth":167,"text":5328},"2015-04-20T08:07:13.6000000-04:00","{“People”:{\n{“name”:”frank”, “age”:”21”},\n{“name”:”joe”,”age”:44”}\n,\n“Markeing”:\n{“name”:”frank”, “age”:”21”},\n{“name”:”joe”,”age”:44”}\n\n} }",{},"\u002Farticles\u002Fjson-know-more",{"title":5288,"description":5352},"articles\u002Fjson-know-more",[18,305],"OoXmULq_Ve1WX5OVc1z-FhmnTNctKTJ7RjuIMoBl31Q",{"id":5360,"title":5361,"author":28,"body":5362,"createdAt":5425,"description":298,"extension":15,"img":298,"meta":5426,"navigation":19,"path":5427,"seo":5428,"stem":5429,"tags":5430,"updatedAt":5425,"__hash__":5431},"articles\u002Farticles\u002Fdiagnosing-404-errors-on-iis-7-and-asp-net-mvc.md","Diagnosing 404 errors on IIS 7 and ASP.NET MVC",{"type":8,"value":5363,"toc":5423},[5364,5391,5396,5400,5405,5412,5419],[32,5365,5366,5367,5370,5371,5373,5374,5377,5378,5380,5381,1156,5384,5387,5388,5390],{},"Are you running in IIS7 ",[217,5368,5369],{},"integrated mode","?",[231,5372],{},"\nClassic mode of IIS7 does ",[217,5375,5376],{},"not"," automatically map extensionless URLs to ASP.NET (much like IIS6).",[231,5379],{},"\nAlso make sure your ",[83,5382,5383],{},"Web.config",[83,5385,5386],{},"\u003Csystem.webServer>"," tag is configured correctly.",[231,5389],{},"\ni.e.",[77,5392,5393],{},[83,5394,5395],{},"\u003Csystem.webServer>\n    \u003Cvalidation validateIntegratedModeConfiguration=\"false\"\u002F>\n    \u003Cmodules runAllManagedModulesForAllRequests=\"true\"\u002F>\n\u003C\u002Fsystem.webServer>",[77,5397,5398,1015],{},[83,5399],{},[77,5401,5402],{},[83,5403,5404],{},"On my workstation windows 7, 64 bit I had set my app pool to classic and \nadded a \"Wildcard Script Map\" \nto C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll (32bit dll). \nThe end result was my \nweb.confi webServer section looked like",[77,5406,5407,5409],{},[83,5408],{},[83,5410,5411],{},"  \u003Csystem.webServer>\n    \u003Cvalidation validateIntegratedModeConfiguration=\"false\" \u002F>\n    \u003Cmodules runAllManagedModulesForAllRequests=\"true\" \u002F>\n        \u003Chandlers>\n            \u003Cadd name=\"_wildcard 32\" path=\"*\" verb=\"*\" modules=\"IsapiModule\" \n scriptProcessor=\"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll\" \n resourceType=\"Unspecified\" requireAccess=\"None\" \n preCondition=\"classicMode,runtimeVersionv4.0,bitness32\" \u002F>\n        \u003C\u002Fhandlers>\n  \u003C\u002Fsystem.webServer>\n\n\n",[77,5413,5415],{"style":5414},"font-family: Consolas; background: white; color: black; font-size: 13px;",[86,5416,5418],{"style":5417},"color: blue;","  \n",[77,5420,5421,1015],{},[83,5422],{},{"title":11,"searchDepth":12,"depth":12,"links":5424},[],"2015-04-20T08:07:13.5000000-04:00",{},"\u002Farticles\u002Fdiagnosing-404-errors-on-iis-7-and-asp-net-mvc",{"title":5361,"description":298},"articles\u002Fdiagnosing-404-errors-on-iis-7-and-asp-net-mvc",[18],"0t4kM0oaMXwUEwZbS3PO_145nI_leMJKlGcHa5tKNIQ",{"id":5433,"title":5434,"author":28,"body":5435,"createdAt":5527,"description":5528,"extension":15,"img":5447,"meta":5529,"navigation":19,"path":5530,"seo":5531,"stem":5532,"tags":5533,"updatedAt":5534,"__hash__":5535},"articles\u002Farticles\u002Fconvert-string-to-enum-c.md","Convert string to Enum c#",{"type":8,"value":5436,"toc":5525},[5437,5440,5443,5448,5484,5523],[32,5438,5439],{},"Converting a string to enum is quite easy one, but it needs some attention when converting from string to enum. I will try to explain you how you can convert from a string to enum type.  There is a method IsDefined",[32,5441,5442],{},"i.e. Enum.IsDefined(typeof(AddressType), type) however this comparison does not incorporate string CASE options hence you may get undesirable results.  It is best to use the CheckStringValueInEnum method below.",[32,5444,5445],{},[64,5446],{"alt":11,"src":5447},"\u002Farticles\u002Fimages\u002Fcsharp.png",[77,5449,5452],{"className":5450,"code":5451,"language":5168,"meta":11,"style":11},"language-csharp shiki shiki-themes github-light github-dark","AddressType addresssType;  \nif (Formatter.CheckStringValueInEnum(type, AddressType)) {  \n    addresssType = (AddressType)Enum.Parse(typeof(AddressType), type, true);  \n} else {  \n    addresssType = AddressType.NA;  \n}  \n",[83,5453,5454,5459,5464,5469,5474,5479],{"__ignoreMap":11},[86,5455,5456],{"class":88,"line":89},[86,5457,5458],{},"AddressType addresssType;  \n",[86,5460,5461],{"class":88,"line":12},[86,5462,5463],{},"if (Formatter.CheckStringValueInEnum(type, AddressType)) {  \n",[86,5465,5466],{"class":88,"line":167},[86,5467,5468],{},"    addresssType = (AddressType)Enum.Parse(typeof(AddressType), type, true);  \n",[86,5470,5471],{"class":88,"line":192},[86,5472,5473],{},"} else {  \n",[86,5475,5476],{"class":88,"line":202},[86,5477,5478],{},"    addresssType = AddressType.NA;  \n",[86,5480,5481],{"class":88,"line":674},[86,5482,5483],{},"}\n",[77,5485,5487],{"className":5450,"code":5486,"language":5168,"meta":11,"style":11},"\u002F\u002Fused to check existence of string in enum  \npublic static bool CheckStringValueInEnum(string stringValue, Enum e) {  \n    foreach (string enumString in Enum.GetNames(e.GetType()))  \n        if (string.Compare(enumString, stringValue, true) == 0)  \n            return true;  \n    return false;  \n}\n",[83,5488,5489,5494,5499,5504,5509,5514,5519],{"__ignoreMap":11},[86,5490,5491],{"class":88,"line":89},[86,5492,5493],{},"\u002F\u002Fused to check existence of string in enum  \n",[86,5495,5496],{"class":88,"line":12},[86,5497,5498],{},"public static bool CheckStringValueInEnum(string stringValue, Enum e) {  \n",[86,5500,5501],{"class":88,"line":167},[86,5502,5503],{},"    foreach (string enumString in Enum.GetNames(e.GetType()))  \n",[86,5505,5506],{"class":88,"line":192},[86,5507,5508],{},"        if (string.Compare(enumString, stringValue, true) == 0)  \n",[86,5510,5511],{"class":88,"line":202},[86,5512,5513],{},"            return true;  \n",[86,5515,5516],{"class":88,"line":674},[86,5517,5518],{},"    return false;  \n",[86,5520,5521],{"class":88,"line":680},[86,5522,5483],{},[292,5524,433],{},{"title":11,"searchDepth":12,"depth":12,"links":5526},[],"2015-04-20T08:07:13.3200000-04:00","Converting a string to enum is quite easy one, but it needs some attention when converting from string to enum",{},"\u002Farticles\u002Fconvert-string-to-enum-c",{"title":5434,"description":5528},"articles\u002Fconvert-string-to-enum-c",[18],"22015-04-20T08:07:13.3200000-04:00","Xe5Wh1yBT7-7lRS-myPAxDtvsAnlNrkctt8CYz72Gbk",{"id":5537,"title":5538,"author":28,"body":5539,"createdAt":5567,"description":5568,"extension":15,"img":5569,"meta":5570,"navigation":19,"path":5571,"seo":5572,"stem":5573,"tags":5574,"updatedAt":5567,"__hash__":5575},"articles\u002Farticles\u002Fiis-6-mvc-css-troubles-styles-not-recognized.md","IIS 6 MVC CSS Troubles - Styles not recognized",{"type":8,"value":5540,"toc":5565},[5541,5544,5547,5550,5553,5556,5559,5562],[32,5542,5543],{},"Scenario: I deployed my mvc 3 application to IIS 6 (with NTLM authentication). While using Internet Explorer (IE) everything looked great. When I tested the site with other common browsers Chrome\u002FFireFox\u002FSafari none of the styles specified in the css sheet were used.",[32,5545,5546],{},"I first checked with FireFox\u002FFirebug that the css was indeed found. The css sheet was found and returned to the client. I tried to view the css sheet within Firebug and I got the message \"There are no rules. You can create a rule.\"....so the css is found however for some reason it is not being applied in non-Internet Explorer browsers.",[32,5548,5549],{},"The css is reference via the _layout.cshtml as shown...(my first attempts were to modify the path to the css sheet even though I could see the css was accessible to the browser)",[32,5551,5552],{},"I.e. \u003Clink href=\"@Url.Content(\"~\u002FContent\u002FSite.css\")\" rel=\"stylesheet\" type=\"text\u002Fcss\" \u002F>",[32,5554,5555],{},"Next attempts used a couple different online css validation apps to ensure my css syntax was not causing an issue. All checked out ok.",[32,5557,5558],{},"After making a number of minor attempts at digging out additional clues…I checked the IIS 6 setup (everything worked fine locally with IIS 7, so I was narrowing my focus on IIS as being the problem).",[32,5560,5561],{},"Solution: The site is hosted on a Microsoft IIS 6 server, and it was not sending the appropriate MIME type for CSS files. The fix to this problem was to add a custom MIME type associating .CSS files with the type \"text\u002Fcss\". Obviously, IE was able to discern that the downloaded text file was to be used as a style sheet. Interestingly the other browsers did not have that default behavior and relies on the web server to identify the file of type text\u002Fcss.",[32,5563,5564],{},"To resolve, open IIS console, navigate to the root application and add MIME Type text\u002Fcss for documents with the extension .css",{"title":11,"searchDepth":12,"depth":12,"links":5566},[],"2015-04-20T08:07:13.1100000-04:00","I deployed my mvc 3 application to IIS 6 (with NTLM authentication)....","\u002Farticles\u002Fimages\u002Fmvc.gif",{},"\u002Farticles\u002Fiis-6-mvc-css-troubles-styles-not-recognized",{"title":5538,"description":5568},"articles\u002Fiis-6-mvc-css-troubles-styles-not-recognized",[18],"95HhQr_7ApUk2zLKgWpOWgYJyUurRpPpjhvJ3sAnT18",{"id":5577,"title":5578,"author":28,"body":5579,"createdAt":6091,"description":6092,"extension":15,"img":6084,"meta":6093,"navigation":19,"path":6094,"seo":6095,"stem":6096,"tags":6097,"updatedAt":6091,"__hash__":6098},"articles\u002Farticles\u002Fpattern-singleton-c.md","Pattern Singleton c#",{"type":8,"value":5580,"toc":6089},[5581,5641,5739,5749,5760,5769,5785,5850,5857,5863,5866,5982,5993,6005,6060,6068,6077,6087],[32,5582,5583,5584,1395,5586,5588,5589,1395,5591,5593,5594,5597,5598,5601,5602,5605,5606,2697,5608,5610,5611,1395,5613,5615,5616,5618,5619,5622,5623,5625,5626,5629,5630,5632,5633,5636,5637,5640],{},"In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects.",[231,5585],{},[231,5587],{},"\nImplementation of a singleton pattern must satisfy the single instance and global access principles. It requires a mechanism to access the singleton class member without creating a class object and a mechanism to persist the value of class members among class objects. The singleton pattern is implemented by creating a class with a method that creates a new instance of the class if one does not exist. If an instance already exists, it simply returns a reference to that object. To make sure that the object cannot be instantiated any other way, the constructor is made private.",[231,5590],{},[231,5592],{},"\nNote the ",[217,5595,5596],{},"distinction"," between a simple ",[217,5599,5600],{},"static instance"," of a class, and a ",[217,5603,5604],{},"singleton",": although a singleton can be implemented as a static instance, it can also be lazily constructed, requiring no memory or resources until needed. Another notable difference is that static member classes cannot implement an interface, unless that interface is simply a marker. So if the class has to realize a contract expressed by an interface, it really has to be a ",[217,5607,5604],{},[231,5609],{},"\nThe singleton pattern must be carefully constructed in multi-threaded applications. If two threads are to execute the creation method at the same time when a singleton does not yet exist, they both must check for an instance of the singleton and then only one should create the new one. If the programming language has concurrent processing capabilities the method should be constructed to execute as a mutually exclusive operation. ",[231,5612],{},[231,5614],{},"\nThe following is an example implementation with the following benefits:",[231,5617],{},"\na) Because the instance is created inside the ",[217,5620,5621],{},"Instance ","property method, the class can exercise additional functionality (for example, instantiating a subclass), even though it may introduce unwelcome dependencies.",[231,5624],{},"\nb) The instantiation is not performed until an object asks for an instance; this approach is referred to as ",[354,5627,5628],{},"lazy instantiation",". Lazy instantiation avoids instantiating unnecessary singletons when the application starts.",[231,5631],{},"\nThe disadvantage of the following implementation is that it is NOT thread safe for multithreading environments. \nIf separate threads of execution enter the ",[217,5634,5635],{},"Instance ","property method at the same time, more than one instance\nof the ",[217,5638,5639],{},"Singleton"," object may be created. Each thread could execute the following statement and decide that a new instance has to be created:",[77,5642,5644],{"className":5450,"code":5643,"language":5168,"meta":11,"style":11},"using System;  \npublic class Singleton  \n{  \n   private static Singleton instance;\n  \n   private Singleton() {}\n  \n   public static Singleton Instance  \n   {  \n      get   \n      {  \n         if (instance == null)  \n         {  \n            instance = new Singleton();  \n         }  \n         return instance;  \n      }  \n   }  \n}&nbsp;\n",[83,5645,5646,5651,5656,5661,5666,5670,5675,5679,5684,5689,5694,5699,5704,5709,5714,5719,5724,5729,5734],{"__ignoreMap":11},[86,5647,5648],{"class":88,"line":89},[86,5649,5650],{},"using System;  \n",[86,5652,5653],{"class":88,"line":12},[86,5654,5655],{},"public class Singleton  \n",[86,5657,5658],{"class":88,"line":167},[86,5659,5660],{},"{  \n",[86,5662,5663],{"class":88,"line":192},[86,5664,5665],{},"   private static Singleton instance;\n",[86,5667,5668],{"class":88,"line":202},[86,5669,499],{},[86,5671,5672],{"class":88,"line":674},[86,5673,5674],{},"   private Singleton() {}\n",[86,5676,5677],{"class":88,"line":680},[86,5678,499],{},[86,5680,5681],{"class":88,"line":686},[86,5682,5683],{},"   public static Singleton Instance  \n",[86,5685,5686],{"class":88,"line":692},[86,5687,5688],{},"   {  \n",[86,5690,5691],{"class":88,"line":698},[86,5692,5693],{},"      get   \n",[86,5695,5696],{"class":88,"line":704},[86,5697,5698],{},"      {  \n",[86,5700,5701],{"class":88,"line":710},[86,5702,5703],{},"         if (instance == null)  \n",[86,5705,5706],{"class":88,"line":716},[86,5707,5708],{},"         {  \n",[86,5710,5711],{"class":88,"line":722},[86,5712,5713],{},"            instance = new Singleton();  \n",[86,5715,5716],{"class":88,"line":728},[86,5717,5718],{},"         }  \n",[86,5720,5721],{"class":88,"line":734},[86,5722,5723],{},"         return instance;  \n",[86,5725,5726],{"class":88,"line":740},[86,5727,5728],{},"      }  \n",[86,5730,5731],{"class":88,"line":1874},[86,5732,5733],{},"   }  \n",[86,5735,5736],{"class":88,"line":1890},[86,5737,5738],{},"}&nbsp;\n",[32,5740,5741,5742,5745,5746,5748],{},"There is one approach name ‘double-check locking’ to help resolve the above thread-safe issue however the .NET Framework resolve this via the ",[217,5743,5744],{},"static initialization ","implementation.",[231,5747],{},"\n\u003C\nbr>In this strategy, the instance is created the first time any member of the class is referenced. The common language runtime takes care of the variable initialization.",[32,5750,5751,5752,5755,5756,5759],{},"The class is marked ",[217,5753,5754],{},"sealed"," to prevent derivation, which could add instances. In addition, the variable is marked ",[217,5757,5758],{},"readonly",", which means that it can be assigned only during static initialization (which is shown here) or in a class constructor.",[32,5761,5762,5763,5765,5766,5768],{},"This implementation is similar to the preceding example, except that it relies on the common language runtime to initialize the variable. It still addresses the two basic problems that the ",[354,5764,5639],{}," pattern is trying to solve: global access and instantiation control.\nThe public static property provides a global access point to the instance. Also, because the constructor is private, the ",[217,5767,5639],{}," class cannot be instantiated outside of the class itself; therefore, the variable refers to the only instance that can exist in the system.",[32,5770,5771,5772,5774,5775,5778,5779,5782,5783,2697],{},"Because the ",[217,5773,5639],{}," instance is referenced by a private static member variable, the instantiation does not occur until the class is first referenced by a call to the ",[217,5776,5777],{},"Instance"," property. This solution therefore implements a form of the lazy instantiation property, as in the ",[354,5780,5781],{},"Design Patterns"," form of ",[354,5784,5639],{},[77,5786,5788],{"className":5450,"code":5787,"language":5168,"meta":11,"style":11},"public sealed class Singleton  \n{  \n   private static readonly Singleton instance = new Singleton();  \n     \n   private Singleton(){}  \n  \n   public static Singleton Instance  \n   {  \n      get   \n      {  \n         return instance;   \n      }  \n   }  \n}\n",[83,5789,5790,5795,5799,5804,5808,5813,5817,5821,5825,5829,5833,5838,5842,5846],{"__ignoreMap":11},[86,5791,5792],{"class":88,"line":89},[86,5793,5794],{},"public sealed class Singleton  \n",[86,5796,5797],{"class":88,"line":12},[86,5798,5660],{},[86,5800,5801],{"class":88,"line":167},[86,5802,5803],{},"   private static readonly Singleton instance = new Singleton();  \n",[86,5805,5806],{"class":88,"line":192},[86,5807,153],{},[86,5809,5810],{"class":88,"line":202},[86,5811,5812],{},"   private Singleton(){}  \n",[86,5814,5815],{"class":88,"line":674},[86,5816,499],{},[86,5818,5819],{"class":88,"line":680},[86,5820,5683],{},[86,5822,5823],{"class":88,"line":686},[86,5824,5688],{},[86,5826,5827],{"class":88,"line":692},[86,5828,5693],{},[86,5830,5831],{"class":88,"line":698},[86,5832,5698],{},[86,5834,5835],{"class":88,"line":704},[86,5836,5837],{},"         return instance;   \n",[86,5839,5840],{"class":88,"line":710},[86,5841,5728],{},[86,5843,5844],{"class":88,"line":716},[86,5845,5733],{},[86,5847,5848],{"class":88,"line":722},[86,5849,5483],{},[32,5851,1015,5852,5854,5855],{},[231,5853],{},"\nThe only potential downside of this approach is that you have less control over the mechanics of the instantiation. In the Design Patterns form, you were able to use a nondefault constructor or perform other tasks before the instantiation.  Because the .NET Framework performs the initialization in this solution, you do not have these options. In most cases, static initialization is the preferred approach for implementing a Singleton in .NET.\n",[217,5856],{},[32,5858,5859,5862],{},[217,5860,5861],{},"Finally Multithreaded Singleton\n","Static initialization is suitable for most situations. When your application must delay the instantiation, use a non-default constructor or perform other tasks before the instantiation, and work in a multithreaded environment, you need a different solution.  ",[32,5864,5865],{},"The following implementation allows only a single thread to enter the critical area, which the lock block identifies, when no instance of Singleton has yet been created:",[77,5867,5869],{"className":5450,"code":5868,"language":5168,"meta":11,"style":11},"using System;  \npublic sealed class Singleton  \n{  \n   private static volatile Singleton instance;  \n   private static object syncRoot = new Object();  \n  \n   private Singleton() {}  \n  \n   public static Singleton Instance  \n   {  \n      get   \n      {  \n         if (instance == null)   \n         {  \n            lock (syncRoot)   \n            {  \n               if (instance == null)   \n                  instance = new Singleton();  \n            }  \n         }  \n  \n         return instance;  \n      }  \n   }  \n}  \n",[83,5870,5871,5875,5879,5883,5888,5893,5897,5902,5906,5910,5914,5918,5922,5927,5931,5936,5940,5945,5950,5954,5958,5962,5967,5972,5977],{"__ignoreMap":11},[86,5872,5873],{"class":88,"line":89},[86,5874,5650],{},[86,5876,5877],{"class":88,"line":12},[86,5878,5794],{},[86,5880,5881],{"class":88,"line":167},[86,5882,5660],{},[86,5884,5885],{"class":88,"line":192},[86,5886,5887],{},"   private static volatile Singleton instance;  \n",[86,5889,5890],{"class":88,"line":202},[86,5891,5892],{},"   private static object syncRoot = new Object();  \n",[86,5894,5895],{"class":88,"line":674},[86,5896,499],{},[86,5898,5899],{"class":88,"line":680},[86,5900,5901],{},"   private Singleton() {}  \n",[86,5903,5904],{"class":88,"line":686},[86,5905,499],{},[86,5907,5908],{"class":88,"line":692},[86,5909,5683],{},[86,5911,5912],{"class":88,"line":698},[86,5913,5688],{},[86,5915,5916],{"class":88,"line":704},[86,5917,5693],{},[86,5919,5920],{"class":88,"line":710},[86,5921,5698],{},[86,5923,5924],{"class":88,"line":716},[86,5925,5926],{},"         if (instance == null)   \n",[86,5928,5929],{"class":88,"line":722},[86,5930,5708],{},[86,5932,5933],{"class":88,"line":728},[86,5934,5935],{},"            lock (syncRoot)   \n",[86,5937,5938],{"class":88,"line":734},[86,5939,689],{},[86,5941,5942],{"class":88,"line":740},[86,5943,5944],{},"               if (instance == null)   \n",[86,5946,5947],{"class":88,"line":1874},[86,5948,5949],{},"                  instance = new Singleton();  \n",[86,5951,5952],{"class":88,"line":1890},[86,5953,737],{},[86,5955,5956],{"class":88,"line":1907},[86,5957,5718],{},[86,5959,5960],{"class":88,"line":1913},[86,5961,499],{},[86,5963,5965],{"class":88,"line":5964},22,[86,5966,5723],{},[86,5968,5970],{"class":88,"line":5969},23,[86,5971,5728],{},[86,5973,5975],{"class":88,"line":5974},24,[86,5976,5733],{},[86,5978,5980],{"class":88,"line":5979},25,[86,5981,5483],{},[32,5983,5984,5985,5988,5989,5992],{},"This approach ensures that only one instance is created and only when the instance is needed. Also, the variable is declared to be ",[217,5986,5987],{},"volatile"," to ensure that assignment to the instance variable completes before the instance variable can be accessed. Lastly, this approach uses a ",[217,5990,5991],{},"syncRoot ","instance to lock on, rather than locking on the type itself, to avoid deadlocks.",[32,5994,5995,5996,5998,5999,6001,6004],{},"This double-check locking approach solves the thread concurrency problems while avoiding an exclusive lock in every call to the ",[217,5997,5621],{},"property method. It also allows you to delay instantiation until the object is first accessed. In practice, an application rarely requires this type of implementation. In most cases, the static initialization approach is sufficient. ",[231,6000],{},[217,6002,6003],{},"Finally, ","there is a much cleaner approach than above if using .NET 4 or greater.",[77,6006,6008],{"className":5450,"code":6007,"language":5168,"meta":11,"style":11},"public sealed class Singleton  \n{  \n    private static readonly Lazy lazy =  \n        new Lazy(() =&gt; new Singleton());  \n      \n    public static Singleton Instance { get { return lazy.Value; } }  \n  \n    private Singleton()  \n    {  \n    }  \n}\n",[83,6009,6010,6014,6018,6023,6028,6033,6038,6042,6047,6052,6056],{"__ignoreMap":11},[86,6011,6012],{"class":88,"line":89},[86,6013,5794],{},[86,6015,6016],{"class":88,"line":12},[86,6017,5660],{},[86,6019,6020],{"class":88,"line":167},[86,6021,6022],{},"    private static readonly Lazy lazy =  \n",[86,6024,6025],{"class":88,"line":192},[86,6026,6027],{},"        new Lazy(() =&gt; new Singleton());  \n",[86,6029,6030],{"class":88,"line":202},[86,6031,6032],{},"      \n",[86,6034,6035],{"class":88,"line":674},[86,6036,6037],{},"    public static Singleton Instance { get { return lazy.Value; } }  \n",[86,6039,6040],{"class":88,"line":680},[86,6041,499],{},[86,6043,6044],{"class":88,"line":686},[86,6045,6046],{},"    private Singleton()  \n",[86,6048,6049],{"class":88,"line":692},[86,6050,6051],{},"    {  \n",[86,6053,6054],{"class":88,"line":698},[86,6055,1910],{},[86,6057,6058],{"class":88,"line":704},[86,6059,5483],{},[32,6061,6062,6063,6067],{},"It's simple and performs well. It also allows you to check whether or not the instance has been created yet with the ",[36,6064,6066],{"href":6065},"http:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fdd642334.aspx","IsValueCreated"," property, if you need that.",[32,6069,6070,6071,6074],{},"Reference: ",[36,6072],{"title":6073,"href":6073},"http:\u002F\u002Fcsharpindepth.com\u002FArticles\u002FGeneral\u002FSingleton.aspx",[36,6075,6073],{"href":6073,"rel":6076},[283],[32,6078,6079],{},[36,6080,6082],{"href":6081},"\u002Fmedia\u002Farticulate-import\u002Fsingleton.png",[64,6083],{"style":3943,"title":5604,"src":6084,"alt":5604,"width":6085,"height":6086,"border":381},"\u002Farticles\u002Fimages\u002Fsingleton_thumb.png",181,100,[292,6088,433],{},{"title":11,"searchDepth":12,"depth":12,"links":6090},[],"2015-04-20T08:07:12.4800000-04:00","Singleton pattern is a design",{},"\u002Farticles\u002Fpattern-singleton-c",{"title":5578,"description":6092},"articles\u002Fpattern-singleton-c",[18],"MUee6xaTZWbY0EfT4p6OcSf6MrAr5AuTqJfu3KqqEVY",{"id":6100,"title":6101,"author":28,"body":6102,"createdAt":6264,"description":298,"extension":15,"img":298,"meta":6265,"navigation":19,"path":6266,"seo":6267,"stem":6268,"tags":6269,"updatedAt":6264,"__hash__":6271},"articles\u002Farticles\u002Fupgrading-to-mvc-4-from-prior-versions.md","Upgrading to MVC 4 (from prior versions)",{"type":8,"value":6103,"toc":6262},[6104,6112,6123,6131,6134,6147,6150,6155,6190,6204,6207,6209,6212,6250,6259],[32,6105,6106,6107,1395,6109,6111],{},"MVC 4 will happily run alongside ASP.NET MVC version 3 and .NET 4\u002FVS2010. You can thus experiment and create MVC 4 projects without fear of breaking your old applications.",[231,6108],{},[231,6110],{},"\n There are three main methods of upgrading to MVC 4:",[221,6113,6114,6117,6120],{},[224,6115,6116],{},"Copy existing content into a new MVC 4 project",[224,6118,6119],{},"Manually upgrade the project",[224,6121,6122],{},"Utilize the MVC 4 NuGet package (by applying the Microsoft.AspNet.MVC package)",[32,6124,6125,6126,1395,6128,6130],{}," Manual Upgrade Steps:",[231,6127],{},[231,6129],{},"\nOpen up all the web.config files in your project and replace any lines that read as the following:",[77,6132,6133],{},"System.Web.Mvc, Version=3.0.0.0  \nSystem.Web.WebPages, Version=1.0.0.0  \nSystem.Web.Helpers, Version=1.0.0.0  \nSystem.Web.WebPages.Razor, Version=1.0.0.0",[32,6135,6136,6137,1395,6139,6141,6142,6144,6145,1395],{},"With their MVC 4 counterparts:",[231,6138],{},[231,6140],{},"\nSystem.Web.Mvc, Version=4.0.0.0\nSystem.Web.WebPages, Version=2.0.0.0\nSystem.Web.Helpers, Version=2.0.0.0,\nSystem.Web.WebPages.Razor, Version=2.0.0.0,",[231,6143],{},"\nIn the root web.config file, add a new PreserveLoginUrl key entry:",[231,6146],{},[77,6148,6149],{},"\u003CappSettings>  \n  \u003Cadd key=\"webpages:Version\" value=\"2.0.0.0\" \u002F>  \n  \u003Cadd key=\"PreserveLoginUrl\" value=\"true\" \u002F>  \n\u003CappSettings>",[32,6151,6152,6153,1395],{},"Now delete any references to System.Web.MVC (v3). In Solution Explorer, remove the following assembly references:",[231,6154],{},[221,6156,6157,6160,6163,6166,6169,6172,6175,6178,6181,6184,6187],{},[224,6158,6159],{},"System.Web.Mvc (v3.0.0.0)",[224,6161,6162],{},"System.Web.WebPages (v1.0.0.0)",[224,6164,6165],{},"System.Web.Razor (v1.0.0.0)",[224,6167,6168],{},"System.Web.WebPages.Deployment (v1.0.0.0)",[224,6170,6171],{},"System.Web.WebPages.Razor (v1.0.0.0)",[224,6173,6174],{},"Now add references to the new versions of these assemblies:",[224,6176,6177],{},"System.Web.Mvc (v4.0.0.0)",[224,6179,6180],{},"System.Web.WebPages (v2.0.0.0)",[224,6182,6183],{},"System.Web.Razor (v2.0.0.0)",[224,6185,6186],{},"System.Web.WebPages.Deployment (v2.0.0.0)",[224,6188,6189],{},"System.Web.WebPages.Razor (v2.0.0.0)",[32,6191,6192,6193,6195,6196,6198,6199,6201,6202,1395],{},"In Solution Explorer, unload your MVC project as we are going to make some changes to the project file; this won't work if the solution is open.",[231,6194],{},"\nOpen the project file  and replace any references of the ProjectTypeGuids E53F8FEA-EAE0-44A6-8774-FFD645390401 with E3E379DF-F4C6-4180-9B81-6769533ABE47.",[231,6197],{},"\nSave the changes you have made and reload the project.",[231,6200],{},"\nFinally, if your application or its references uses any assemblies compiled against the previous version of MVC, tell these to use MVC4 by adding binding redirect entries such as the following:",[231,6203],{},[77,6205,6206],{},"\u003Cconfiguration>  \n  \u003Cruntime>  \n    \u003CassemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">  \n      \u003CdependentAssembly>  \n        \u003CassemblyIdentity name=\"System.Web.Helpers\"  \n             publicKeyToken=\"31bf3856ad364e35\" \u002F>  \n        \u003CbindingRedirect oldVersion=\"1.0.0.0\" newVersion=\"2.0.0.0\"\u002F>  \n      \u003C\u002FdependentAssembly>  \n      \u003CdependentAssembly>  \n        \u003CassemblyIdentity name=\"System.Web.Mvc\"  \n             publicKeyToken=\"31bf3856ad364e35\" \u002F>  \n        \u003CbindingRedirect oldVersion=\"1.0.0.0-3.0.0.0\" newVersion=\"4.0.0.0\"\u002F>  \n      \u003C\u002FdependentAssembly>  \n      \u003CdependentAssembly>  \n        \u003CassemblyIdentity name=\"System.Web.WebPages\"  \n             publicKeyToken=\"31bf3856ad364e35\" \u002F>  \n        \u003CbindingRedirect oldVersion=\"1.0.0.0\" newVersion=\"2.0.0.0\"\u002F>  \n      \u003C\u002FdependentAssembly>  \n    \u003C\u002FassemblyBinding>  \n  \u003C\u002Fruntime>  \n\u003C\u002Fconfiguration>",[77,6208,1015],{},[32,6210,6211],{},"Notes:",[221,6213,6214,6217,6220,6223,6226,6229,6232,6235,6238,6241,6244,6247],{},[224,6215,6216],{},"I had to do similar updates to the web.config located in the Views directory",[224,6218,6219],{},"If after you build and browse to the home page, you get errors like ‘The type or namespace {fill in} does not exist in the namespace..you are missing an assembly reference’ you may need to set ‘Copy Local = True’ on a few of the references.  In particular I had to set to True for the following assemblies:",[224,6221,6222],{},"Microsoft.Web.Infrastructure",[224,6224,6225],{},"System.Web.Helpers",[224,6227,6228],{},"System.Web.Http",[224,6230,6231],{},"System.Web.Http.WebHost",[224,6233,6234],{},"System.Web.Mvc",[224,6236,6237],{},"System.Web.Razor",[224,6239,6240],{},"System.Web.WebPages",[224,6242,6243],{},"System.Web.WebPages.Deployment",[224,6245,6246],{},"System.Web.WebPages.Razor",[224,6248,6249],{},"WebGrease",[32,6251,6252,6253,6256],{},"ASP.NET MVC 4 new features - ",[36,6254],{"title":6255,"href":6255},"http:\u002F\u002Fwww.asp.net\u002Fwhitepapers\u002Fmvc4-release-notes",[36,6257,6255],{"href":6255,"rel":6258},[283],[32,6260,6261],{},"Note: Also note .NET 4.5 is an extension to 4.0, it does not introduce a new runtime",{"title":11,"searchDepth":12,"depth":12,"links":6263},[],"2015-04-20T08:07:12.3800000-04:00",{},"\u002Farticles\u002Fupgrading-to-mvc-4-from-prior-versions",{"title":6101,"description":298},"articles\u002Fupgrading-to-mvc-4-from-prior-versions",[18,6270],"mvc","GE11lDkpA4HwyWPf4GsE5CSacjnBx_Va3XEsyjiSaN8",{"id":6273,"title":6274,"author":28,"body":6275,"createdAt":6316,"description":6317,"extension":15,"img":6318,"meta":6319,"navigation":19,"path":6320,"seo":6321,"stem":6322,"tags":6323,"updatedAt":6316,"__hash__":6324},"articles\u002Farticles\u002Fintellisense-and-javascript-in-visual-studio-2012.md","Intellisense and JavaScript in Visual Studio 2012",{"type":8,"value":6276,"toc":6314},[6277,6280],[32,6278,6279],{},"In short use _references.js file with your web projects.  What is _references.js?",[32,6281,6282,6283,6286,6287,1395,6289,6291,6292,1395,6294,6296,6297,1395,6299,6301,6302,1395,6304,6306,6307],{},"With the latest Visual Studio a new file _references.js is found in the scripts directory.  As you probably know, the ",[83,6284,6285],{},"\u002F\u002F &lt;reference path=”…” \u002F&gt;"," syntax was introduced in Visual Studio long time ago to make you able to have intellisense in any JavaScript file to include everything defined in the JavaScript located at this path.  Said another way if you write the very first line in any JavaScript file, say “my-page.js”, and make sure the path points to the proper jQuery file, when you write code in “my-page.js”, you’ll get intellisense for everything in the jQuery file.",[231,6288],{},[231,6290],{},"\nThe quality of the intellisense will vary based on the referenced jQuery file, whether it’s minified file (least intellisense info, only member names, sometimes), just standard source\u002Fdebug file, or even one that VsDoc comments (best intellisense, might even have notes on what types you need to pass to methods, when defined in VsDoc comments).",[231,6293],{},[231,6295],{},"\nVisual Studio will give you intellisense from all files that have references in the “_references.js” file. This way you can define the global \u002F common files you use all the time. This might include some library files like jQuery, or some files you use everywhere in the project like some internal utilities files.  In addition, for related files, you can use the “\u003Creference >” syntax on top of every file to connect them (from intellisense point of view).",[231,6298],{},[231,6300],{},"\nThere is only one _references.js file for each project and is located in the \u002Fscripts directory.",[231,6303],{},[231,6305],{},"\nYou can manage this file manually or in the latest Visual Studio  release you can add\u002Fedit references via Tools > Options > Text Editor –> JavaScript –> Intellisense –> References node\n",[36,6308,6310],{"href":6309},"\u002Fmedia\u002Farticulate-import\u002Fimage_6.png",[64,6311],{"style":6312,"src":6313,"border":381,"alt":379,"title":379,"width":509,"height":881},"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;","\u002Farticles\u002Fimages\u002F\u002Fmedia\u002Farticulate-import\u002Fimage_thumb_6.png",{"title":11,"searchDepth":12,"depth":12,"links":6315},[],"2015-04-20T08:07:12.1900000-04:00","How to enable intellisense with Visual Studio and JavaScript","\u002Farticles\u002Fimages\u002Fimage_thumb_6.png",{},"\u002Farticles\u002Fintellisense-and-javascript-in-visual-studio-2012",{"title":6274,"description":6317},"articles\u002Fintellisense-and-javascript-in-visual-studio-2012",[18,306],"oVO-9EOZCUi_NY9jWqCmtawNfh0TKJlWULh6dhsTtJY",1781574758529]