<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>My.Ramblings</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/pranav_rastogi/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 05:24:20 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Dev Connections - Las Vegas 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/dev-connections-las-vegas-2013</link>
      <pubDate>Thu, 03 Oct 2013 14:36:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2013/10/03/dev-connections-las-vegas-2013/</guid>
      <description><![CDATA[I presented on ASP.NET SignalR and ASP.NET Identity &amp; Security. Please find the slide decks and...]]></description>
      <content:encoded><![CDATA[<p>I presented on ASP.NET SignalR and ASP.NET Identity &amp; Security. Please find the slide decks and session details below.</p>
<p>&nbsp;</p>
<p><strong><span style="font-size: medium;">Microsoft ASP.NET SignalR: The Real-Time Web Made Simple</span></strong></p>
<p><strong>Session Abstract :&nbsp;</strong></p>
<p><span><span>SignalR is one of the latest components of the ASP.NET runtime, but it can do a lot more than just web. Come learn how you can build a real-time web application with minimal heavy lifting, without needing to learn another large framework. Then, take those lessons and use nearly identical syntax to give Modern Apps, Windows Azure Worker Roles running in the cloud, and other types of applications real-time HTTP functionality. The SignalR abstraction is a shift in how you think about web programming and in what's possible across a multitude of platforms and environments, and this session gets you started quickly with simple demonstrations that walk you through all the major capabilities of the #1 most followed open-source C# project on GitHub that grew to become the latest trick in the ASP.NET developer tool chest.</span><br /></span></p>
<p><strong>Session Link :</strong>&nbsp;<a href="https://www.devconnections.com/dev13/public/SessionDetails.aspx?FromPage=SpeakerList.aspx&amp;SessionID=1008785&amp;SortMenu=102006">https://www.devconnections.com/dev13/public/SessionDetails.aspx?FromPage=SpeakerList.aspx&amp;SessionID=1008785&amp;SortMenu=102006</a></p>
<p>&nbsp;</p>
<p><strong>Slide Deck:</strong>&nbsp;<a href="https://www.slideshare.net/rustd/microsoft-signal-r">https://www.slideshare.net/rustd/microsoft-signal-r</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><span style="font-size: medium;">ASP.NET Identity &amp; Security</span></strong></p>
<p>&nbsp;</p>
<p><strong></strong><span><strong>Session Abstract :</strong> ASP.NET Identity is a new look at the existing ASP.NET membership system. ASP.NET Identity makes it easier to integrate different authentication systems such as local username, password as well as social logins such as Facebook, Twitter etc. It also gives you greater control over persisting data to your backend technology of choice. We will also look at the improvements in VS tooling that let you easily create application that allow users from Windows Azure Active Directory to sign in.</span></p>
<p><strong>Session Link:&nbsp;<a href="https://www.devconnections.com/dev13/public/SessionDetails.aspx?FromPage=SpeakerList.aspx&amp;SessionID=1008786&amp;SortMenu=102006">https://www.devconnections.com/dev13/public/SessionDetails.aspx?FromPage=SpeakerList.aspx&amp;SessionID=1008786&amp;SortMenu=102006</a></strong></p>
<p><strong>Slide Deck:&nbsp;<a href="https://www.slideshare.net/rustd/microsoft-aspnet-identity-security">https://www.slideshare.net/rustd/microsoft-aspnet-identity-security</a></strong> &nbsp;</p>
<p>I hope you enjoyed the talks and build something fun!!!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>My favorite tools and software</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/my-favorite-tools-and-software</link>
      <pubDate>Sat, 02 Mar 2013 18:02:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2013/03/02/my-favorite-tools-and-software/</guid>
      <description><![CDATA[Every handy man has their own set of recommended tools which makes them extremely productive. Other...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: medium;">Every handy man has their own set of recommended tools which makes them extremely productive. Other these years I have developed a liking for a few of them which I would like to share with you. I hope you will like them as well and some of them do increase your productivity.</span></p>
<p><span style="font-size: medium;">I do plan to regularly update this post and add more tools/software as I find more useful ones.</span></p>
<ul>
<li><span style="font-size: medium;"><a href="https://office.microsoft.com/en-us/onenote/">https://office.microsoft.com/en-us/onenote/</a></span></li>
<li><span style="font-size: medium;"><a href="https://www.microsoft.com/web/downloads/platform.aspx">https://www.microsoft.com/web/downloads/platform.aspx</a></span></li>
<li><span style="font-size: medium;"><a href="https://windows.microsoft.com/en-US/windows7/products/features/snipping-tool">https://windows.microsoft.com/en-US/windows7/products/features/snipping-tool</a></span></li>
<li><span style="font-size: medium;"><a href="https://www.microsoft.com/en-us/server-cloud/windows-server/server-virtualization.aspx">https://www.microsoft.com/en-us/server-cloud/windows-server/server-virtualization.aspx</a></span></li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Modern ASP.NET WebForms 4.5–DevIntersection 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/modern-asp-net-webforms-4-5devintersection-2012</link>
      <pubDate>Mon, 10 Dec 2012 15:20:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/12/10/modern-asp-net-webforms-4-5devintersection-2012/</guid>
      <description><![CDATA[Thank you all who came for my talk on ASP.NET WebForms 4.5 at...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">Thank you all who came for my talk on ASP.NET WebForms 4.5 at DevIntersection(<a href="https://devintersection.com/">https://devintersection.com/</a>)</span></p>
<p><span style="font-size: small;">Please find the slides and the samples as follows</span></p>
<p><span style="font-size: small;"><strong>Slides</strong></span></p>
<p><iframe style="border-width: 1px 1px 0px; border-style: solid; border-color: #cccccc; margin-bottom: 5px;" src="https://www.slideshare.net/slideshow/embed_code/15578805" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="427" height="356"></iframe></p>
<div style="margin-bottom: 5px;"><strong><a title="Web forms- DevIntersection" href="https://www.slideshare.net/rustd/web-forms-devintersection" target="_blank">Web forms- DevIntersection</a> </strong> from <strong><a href="https://www.slideshare.net/rustd" target="_blank">rustd</a></strong></div>
<p>&nbsp;</p>
<p><span style="font-size: small;"><strong>Samples</strong></span></p>
<p><iframe src="https://skydrive.live.com/embed?cid=43459A6389A804D9&amp;resid=43459A6389A804D9%212205&amp;authkey=AO-gZ2qc0P5XzfE" frameborder="0" scrolling="no" width="98" height="120">&nbsp;</iframe></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">I have also included my talk walkthrough so you can relate to all the concepts I talked about</span></p>
<p><span style="font-size: small;"><strong>Talk Walkthrough</strong></span></p>
<p><span style="font-size: x-small;">- Outline <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Not the usual flow of features but some interesting things you can do with the webforms framework <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Pattern based development <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Cleaner code <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Extensibility&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><br /> - Templates rendering <br />&nbsp;&nbsp;&nbsp; -- Standards compliant</p>
<p><br /> - OAuth/Open Id Login <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Uncomment AuthConfig <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Login using Google</p>
<p><br /> - Web Optimization <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Debug=true(all files) <br />&nbsp;&nbsp;&nbsp; -- Debug=false(bundled files) <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Framework scripts <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Bundled as nuget packages <br /> - Tips &amp; tricks <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Script Manager <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --- Remappings <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Originally come from aspnet ajaxcdn but you can change it <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- CDN support(enable cdn=true) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Even the bundles <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- LoadSuccessExpression <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- If the network goes out then you can load the scripts locally</p>
<p><br /> - Patterns/Tips &amp; Tricks <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Model Binding <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Basics <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Model Binding <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Routing <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- PRG <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Repository <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Unit Testability <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Dynamic data <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Model Binding Extensibility <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------&nbsp; Aggregate Value Providers and an attribute <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Similar to mvc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----- AdHoc Model Binding <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; No data controls <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Anonymous types cannot be constructed</p>
<p><br />&nbsp;&nbsp;&nbsp; - Control Builder Interceptor <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Customize the compilation system <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Change what kind of code gets generated <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Great of custom control developers <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Edit the codedom of the existing control - not possible before <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Sub class the control <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Reimplement the control builder <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- To use this put it in the config <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Layer of indirection between UI/code something like MVP. Little code talking to UI <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Layer of indirection between code and markup <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Take this idea further along <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Advanced control builder interceptor <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Earlier written using custom controls but with the new feature in v4.5 you can do it more easily</p>
<p><br />&nbsp;&nbsp;&nbsp;&nbsp; -- Command Bubbling <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- WPF/Silverlight <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Rather than event handlers to do business logic - command interface <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Remove as much code as I can <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Code interacts with controls - separation of concerns <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Declarative statements to wire up server controls to data <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Imperative logic factored out into different classes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Webforms has bubbling event(</p>
<p><span style="font-size: x-small;"> Controls like gridview work like this) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Separation of concern/Clean code behind <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Event bubbling to update UI when an event happens(click/button) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- Component driven/event driven </span></p>
<p>--<span style="font-size: x-small;">&nbsp; Tag Mapping <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Code to modify control&hellip;do not put it in the code behind <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Remapping controls <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Custom Templates <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- User voice item <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Load them from database/file etc</span></p>
<p><br />&nbsp; -- Imperative vs declarative <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Declarative - more maintainable - you know everything statically <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Imperative - set stuff dynamically <br />&nbsp;&nbsp;&nbsp; <br /> - Async Support <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Async=false <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Async=true <br />&nbsp;&nbsp;&nbsp; --Async/await usage <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>- FriendlyURLs <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Cleaner Urls which are easy to use <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Show the async demo on a mobile device </p>
<p>- Scaffolding <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Person class <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Scaffold using UI <br />&nbsp;&nbsp;&nbsp;&nbsp; -- CRUD on desktop <br />&nbsp;&nbsp;&nbsp;&nbsp; -- Default on mobile </p>]]></content:encoded>
    </item>
    <item>
      <title>Model Binding Fundamentals</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/model-binding-fundamentals</link>
      <pubDate>Fri, 30 Nov 2012 01:49:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/11/30/model-binding-fundamentals/</guid>
      <description><![CDATA[In the previous post we looked at an overview of what is Model Binding and the benefits it brings in...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: x-small;">In the previous </span><a href="https://blogs.msdn.com/b/pranav_rastogi/archive/2012/10/22/asp-net-webforms-model-binding-overview.aspx" target="_blank">post</a><span style="font-size: x-small;"> we looked at an overview of what is Model Binding and the benefits it brings in for WebForms developers. In this post we will look at the basic fundamentals and how the Model Binding system works with controls.</span></p>
<h3><span style="font-size: small;">Data Binding with Model Binding</span></h3>
<p><span style="font-size: x-small;">Uptil ASP.NET v4.0, data binding in controls happened with data bound controls such as GridView used to bound to data source controls such as ObjectDataSource. We will use this as a reference to understand the flow in the Model Binding System. A lot of the implementation derives inspiration from ObjectDataSource.</span></p>
<p><span style="font-size: x-small;">Following snippet shows how a GridView calls the Model Binding system to get a list of products.</span></p>
<div class="csharpcode">
<div class="csharpcode">
<pre class="alt"> &lt;asp:GridView ID=<span class="str">"getProduct"</span> runat=<span class="str">"server"</span> ItemType=<span class="str">"Products"</span></pre>
<pre>            UpdateMethod=<span class="str">"getProduct_UpdateItem"</span></pre>
<pre class="alt">             SelectMethod=<span class="str">"getProduct_GetData"</span> /&gt;</pre>
<pre><span class="kwrd">public</span> IQueryable&lt;Products&gt; getProduct_GetData()</pre>
<pre class="alt">        {</pre>
<pre>            <span class="kwrd">return</span> _context.Products.ToList();</pre>
<pre class="alt">        }</pre>
<pre>&nbsp;</pre>
<pre class="alt">        <span class="rem">// The id parameter name should match the DataKeyNames value set on the control</span></pre>
<pre>        <span class="kwrd">public</span> <span class="kwrd">void</span> getProduct_UpdateItem(<span class="kwrd">int</span> id)</pre>
<pre class="alt">        {</pre>
<pre>            Products item = <span class="kwrd">null</span>;            </pre>
<pre class="alt">&nbsp;</pre>
<pre>            TryUpdateModel(item);</pre>
<pre class="alt">            <span class="kwrd">if</span> (ModelState.IsValid)</pre>
<pre>            {</pre>
<pre class="alt">                <span class="rem">// Save changes here, e.g. MyDataLayer.SaveChanges();</span></pre>
<pre>&nbsp;</pre>
<pre class="alt">            }</pre>
<pre>        }</pre>
</div>
</div>
<p>&nbsp;</p>
<p><span style="font-size: x-small;">At the heart of the Model Binding system is a datasource called </span><a href="https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.modeldatasource.aspx" target="_blank"><span style="font-size: x-small;">ModelDataSource</span></a><span style="font-size: x-small;">. and </span><a href="https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.modeldatasourceview.aspx" target="_blank"><span style="font-size: x-small;">ModelDataSourceView</span></a><span style="font-size: x-small;"> As a developer when you never Bind the GridView to the ModelDataSource. The DataSource is an implementation detail which takes in value from the control and passes onto the ModelBinding system to perform the Binding &amp; Validation to the model and gives the result back to the control/page.</span></p>
<h3><span style="font-size: small;">Page Execution Flow</span></h3>
<p><span style="font-size: x-small;">Now that we know that there is a datasource involved at the implementation level of the ModelBinding system, let&rsquo;s look at the flow from the control &ndash; ModelBinding &ndash; control. At a very high level this is what happens</span></p>
<ul>
<li><span style="font-size: x-small;">GridView calls the SelectMethod to get the values</span></li>
<li><span style="font-size: x-small;">This initializes the ModelDataSource and it calls the ExecuteSelect method on ModelDataSourceView</span></li>
<li><span style="font-size: x-small;">The ModelDataSourceView calls the DefaultModelBinder</span></li>
<li><span style="font-size: x-small;">DefaultModelBinder looks through all the ModelBinderProviders registered in the system and tried to get the ModelBinder that can provide the value for a given Type</span></li>
<li><span style="font-size: x-small;">The selected ModelBinder gets called to perform the Binding of values to the Model</span></li>
<li><span style="font-size: x-small;">The ModelBinder calls the ValueProvider to get the value.</span></li>
<ul>
<li><span style="font-size: x-small;">This is useful if you want to specify that the value is coming from a control/querystring or other collections</span></li>
</ul>
</ul>
<p><span style="font-size: x-small;">I wanted to put this information out now so that you can get an idea about the plugability areas that exist in the ModelBinding system. In the later posts w We are going to look more into the details</span></p>
<h3><span style="font-size: small;">Model Binders and Model Binder Providers</span></h3>
<p><span style="font-size: x-small;">The initialization of the ModelBindig system registers the following ModelBinders. These&nbsp; partition the responsibilities of the original DefaultModelBinder, making it easy to consume them from your own custom binder or to replace their individual responsibilities. For example, changing how dictionaries are bound application-wide now involves replacing a single provider rather than rewriting the DefaultModelBinder. The binders included in-box are, in order:</span></p>
<p><span style="font-size: x-small;">&middot; <strong>TypeMatchModelBinderProvider</strong> &ndash; If the incoming value is already typed correctly for the target model (e.g. incoming value is string, property to bind is string), short-circuits the entire process and just returns the string.</span></p>
<p><span style="font-size: x-small;">&middot; <strong>BinaryDataModelBinderProvider</strong> &ndash; Handles binding base-64 encoded input to byte[] and System.Linq.Data.Binary models. </span></p>
<p><span style="font-size: x-small;">&middot; <strong>KeyValuePairModelBinderProvider</strong> &ndash; Handles KeyValuePair&lt;TKey, TValue&gt;. Consumed by the dictionary binder.</span></p>
<p><span style="font-size: x-small;">&middot; <strong>ComplexModelDtoModelBinderProvider</strong> &ndash; Handles complex models. Consumed by the mutable object binder. More info on this type in the tutorial at the end of this document.</span></p>
<p><span style="font-size: x-small;">&middot; <strong>ArrayModelBinderProvider</strong> &ndash; Handles T[].</span></p>
<p><span style="font-size: x-small;">&middot; <strong>DictionaryModelBinderProvider</strong> &ndash; Handles IDictionary&lt;TKey, TValue&gt;.</span></p>
<p><span style="font-size: x-small;">&middot; <strong>CollectionModelBinderProvider</strong> &ndash; Handles IEnumerable&lt;T&gt;.</span></p>
<p><span style="font-size: x-small;">&middot; <strong>TypeConverterModelBinderProvider</strong> &ndash; Handles simple type conversions, e.g. incoming value is a string and property to bind is an integer.</span></p>
<h3><span style="font-size: small;">Value Providers</span></h3>
<p><span style="font-size: x-small;">Following are the Value providers which you can use to specify where should the ModelBinding look for when trying to get the value</span></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">Value Providers</span></p>
</td>
<td valign="top" width="341">
<p><strong><span style="font-size: x-small;">Description</span></strong></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">Form</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the Form collection</span></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">Control</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the specified control</span></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">QueryString</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the QueryString collection</span></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">Cookie</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the Cookie collection</span></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">Profile</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the Profile collection</span></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">RouteData</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the Route collection</span></p>
</td>
</tr>
<tr>
<td valign="top" width="198">
<p><span style="font-size: x-small;">Session</span></p>
</td>
<td valign="top" width="341">
<p><span style="font-size: x-small;">The value is retrieved from the Session collection</span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-size: x-small;">In the next few posts we will look at how to do basic create/replace/delete/filtering cases and then look at extending the ModelBinding system using these concepts</span></p>
<p><span style="font-size: x-small;">Hope you will find this useful!!!</span></p>
<p><span style="font-size: x-small;">This has been cross posted to <a href="https://blogs.msdn.com/b/webdev/archive/2012/11/30/model-binding-fundamentals.aspx">https://blogs.msdn.com/b/webdev/archive/2012/11/30/model-binding-fundamentals.aspx</a></span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Interacting with Databases for Web Developers in VS 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/interacting-with-databases-for-web-developers-in-vs-2012</link>
      <pubDate>Mon, 12 Nov 2012 08:42:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/11/12/interacting-with-databases-for-web-developers-in-vs-2012/</guid>
      <description><![CDATA[VS2012 is out and with it brings a host of developer improvements when dealing with data. This post...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: x-small;">VS2012 is out and with it brings a host of developer improvements when dealing with data. This post aims at highlighting a few key improvements which will affect you the most and hopefully you will find this information useful in getting started with the improvements in Visual Studio tooling to interact with databases. While the Data Tooling itself has undergone a lot of changes, this post is geared towards Web Application Developers.</span></p>
<h5><span style="font-size: x-small;">Changes in VS2012</span></h5>
<ul>
<li><span style="font-size: x-small;">VS2012 ships with </span><a href="https://msdn.microsoft.com/en-us/library/cc645993.aspx"><span style="font-size: x-small;">SQL2012</span></a><span style="font-size: x-small;"> engine.</span></li>
<li><span style="font-size: x-small;">VS2012 ships with an enchanced Sql tools(SSDT) which brings in functionality from SSMS(SqlServerManagementStudio) to VS </span>
<ul>
<li><span style="font-size: x-small;">As part of this integration, you will see a new window called &ldquo;SQL Server Object Browser&rdquo;. In this window you can do advanced Database management stuff, such as running sprocs, managing Initial Catalogs etc. which were not possible in &ldquo;Database Explorer&rdquo;</span></li>
<li><span style="font-size: x-small;">Some </span><a href="https://msdn.microsoft.com/en-us/data/hh297028"><span style="font-size: x-small;">videos</span></a><span style="font-size: x-small;"> to learn more about SSDT.</span></li>
</ul>
</li>
<li><span style="font-size: x-small;">"Sql Server Express" is no longer installed with VS. Instead VS ships with "Sql Server Express LocalDB". </span>
<ul>
<li><span style="font-size: x-small;">LocalDB development is supported in VS2012 for .NET v4.0/v4.5 on Windows 8/ Windows 7 &ndash; Client and Server SKUs</span></li>
<li><span style="font-size: x-small;">LocalDB development is supported in VS2012 for .NET v3.5 on Windows 8 only(Client and Server SKUs)</span></li>
</ul>
</li>
<li><span style="font-size: x-small;">Enhanced User experience while upgrading projects from VS2010 to VS2012 </span>
<ul>
<li><span style="font-size: x-small;">This user experience has some guidance which help you upgrade databases which were using SQLExpress to LocalDB</span></li>
</ul>
</li>
<li><span style="font-size: x-small;">Auto loading of ConnectionStrings in ServerExplorer </span>
<ul>
<li><span style="font-size: x-small;">if we detect that your ConnectionString points to a database which exists, then we load the connectionstring in the ServerExplorer so its there when you want to use it. This is an improvement from Dev10 where you had to explicitly add the ConnectionString</span></li>
</ul>
</li>
</ul>
<h5><span style="font-size: x-small;">Why LocalDB?</span></h5>
<p><span style="font-size: x-small;">The quick pitch for LocalDB is the following: &ldquo;It is very easy to install and it requires no management&rdquo; LocalDB runs as your account and not as a system wide service(which is how SqlExpress runs). This </span><a href="https://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx"><span style="font-size: x-small;">post</span></a><span style="font-size: x-small;"> from the SQL team goes in detail about the benefits</span></p>
<p><span style="font-size: x-small;">With all the changes of moving away from SqlExpress to LocalDB, nothing should change in terms of your application development. You should be able to use&nbsp; almost the same connectionStrings as you had with SqlExpress, but instead change the DataSource from &ldquo;.\SQLExpress&rdquo; to &ldquo;(LocalDb)\v11.0&rdquo; and remove the UserInstance flag since LocalDb always runs as your account</span></p>
<h5><span style="font-size: x-small;">Initial Catalog vs AttachDbFileName</span></h5>
<p><span style="font-size: x-small;">If you look at the connectionstring, the templates for ASP.NET WebForms, MVC use in VS 2012, you will notice that the connectionstring looks like follows. This connection is somewhat different to what you might have seen with web projects in VS2010 where we were only using AttachDbFileName.This change has nothing to do with LocalDb, on the contrary this exposes some of the common patterns that have existed when working with SQL.</span></p>
<div class="csharpcode">
<p><span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">="DefaultConnection"</span> <span class="attr">connectionString</span><span class="kwrd">="Data Source=(LocalDb)\v11.0;</span></p>
<p><span class="kwrd">Initial Catalog=aspnet-MvcApplication18-20121022222325;Integrated Security=SSPI;</span></p>
<p><span class="kwrd">AttachDBFilename=|DataDirectory|\aspnet-MvcApplication18-20121022222325.mdf"</span></p>
<p><span class="attr">providerName</span><span class="kwrd">="System.Data.SqlClient"</span> <span class="kwrd">/&gt;</span></p>
</div>
<pre>&nbsp;</pre>
<p><span style="font-size: x-small;">Following is how these two values are used</span></p>
<p><span style="font-size: x-small;"><strong>Initial Catalog</strong>: This entry is a key in the SQL master table which holds all of the databases which were created on an instance. In this case the instance is &ldquo;(LocalDb)\v11.0&rdquo;</span></p>
<p><span style="font-size: x-small;"><strong>AttachDbFileName</strong>: This entry tells SQL the location of the mdf file which holds the database information.</span></p>
<p><span style="font-size: x-small;">The SQL engine uses Initial Catalog to look up the database entry in its master list and load the database file from the path specified by AttachDbFileName</span></p>
<h5><span style="font-size: x-small;">One small caveat</span></h5>
<p><span style="font-size: x-small;">By surfacing this information to the developer, a developer can run into the following situation. Let&rsquo;s say that you ran your application and created a database with the above connectionstring. In this case, if you delete the database file(mdf) from disk and do not change the connectionstring, then SQL will look up the database by the Initial Catalog entry which still exists and will try to load the database from disk based on the AttachDbFileName and since the database does not exist, you will get the following error.</span></p>
<p><span style="font-size: x-small;"><em>&ldquo;Cannot attach the file 'c:\users\foo\documents\visual studio 2012\Projects\MvcApplication18\MvcApplication18\App_Data\aspnet-MvcApplication18-20121022222325.mdf' as database 'aspnet-MvcApplication18-20121022222325'.</em>&rdquo;</span></p>
<p><span style="font-size: x-small;">To workaround this error do either of the following</span></p>
<ul>
<li><span style="font-size: x-small;">Change the Initial Catalog and AttachDbFileName value to be something unique</span></li>
<li><span style="font-size: x-small;">Using SSDT, connect to &ldquo;(LocalDb)\v11.0&rdquo; instance and delete the Initial Catalog entry specified in the database</span></li>
</ul>
<p>The reason the AttachDbFileName entry exists so that the database file gets dropped in App_Data folder of your application.</p>
<h5>&nbsp;</h5>
<h5><span style="font-size: x-small;">How to Videos for basic operations in VS tooling</span></h5>
<p><span style="font-size: x-small;">&nbsp; </span></p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:37a993cf-e3ff-4b44-9dc5-c88f31ca91b9" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">
<div><object width="448" height="252"><param name="movie" value="https://www.youtube.com/v/52meUYO0-5g?hl=en&amp;hd=1" /></object></div>
<div style="width: 448px; clear: both; font-size: .8em;">Working with Entity Framework Code First</div>
</div>
<h5><span style="font-size: x-small;">Cheat sheet of things to remember/do for Data in VS2012</span></h5>
<p><span style="font-size: x-small;">These cheat sheet is useful when you are trying to figure out what instance to use for LocalDB</span></p>
<ul>
<li><span style="font-size: x-small;">Default Instance of Localdb in VS2012 is "(LocalDb)\v11.0" </span>
<ul>
<li><span style="font-size: x-small;">This means whenever you are connecting to a localdb instance you need to type in the above to connect to using Windows Authentication to operate on your database</span></li>
</ul>
</li>
<li><span style="font-size: x-small;">Tools-Options is "(LocalDb)\v11.0" </span>
<ul>
<li><span style="font-size: x-small;">This means that any local database that you create will be created using "(LocalDb)\v11.0" instance</span></li>
<li><span style="font-size: x-small;">If you have SqlExpress installed and you want to use SqlExpress as the default local database server you should change this option in VS. This is a global setting for VS</span></li>
</ul>
</li>
<li><span style="font-size: x-small;">LocalDB does not run with UserInstance=true setting </span>
<ul>
<li><span style="font-size: x-small;">You will get an error when you run your application</span></li>
</ul>
</li>
</ul>
<h5><span style="font-size: x-small;">Helpful links/scripts</span>&nbsp;</h5>
<ul>
<li><a href="https://blogs.msdn.com/b/pranav_rastogi/archive/2012/02/20/mapping-sql-mdf-file-versions-to-sql-product-versions.aspx"><span style="font-size: x-small;">Figuring out the version of your database file</span></a></li>
<li><a href="https://blogs.msdn.com/b/pranav_rastogi/archive/2012/10/23/common-commands-to-manage-a-sql-instance.aspx"><span style="font-size: x-small;">Common commands to manage a SQL instance</span></a></li>
</ul>
<p><span style="font-size: x-small;">I hope this would help you understand the changes in the Data Tooling experience for VS2012. This was cross posted at&nbsp;https://blogs.msdn.com/b/webdev/archive/2012/11/12/interacting-with-databases-for-web-developers-in-vs-2012.aspx</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Building Modern WebForms - DevConnections 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/building-modern-webforms-devconnections-2012</link>
      <pubDate>Tue, 30 Oct 2012 15:50:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/10/30/building-modern-webforms-devconnections-2012/</guid>
      <description><![CDATA[Thank you all for coming for my talk on Building Modern WebForms application.   &#160;  You can...]]></description>
      <content:encoded><![CDATA[<p>Thank you all for coming for my talk on Building Modern WebForms application. </p>  <p>&#160;</p>  <p>You can download the samples from</p>  <p>&#160;<iframe height="120" src="https://skydrive.live.com/embed?cid=43459A6389A804D9&amp;resid=43459A6389A804D9%212205&amp;authkey=AO-gZ2qc0P5XzfE" frameborder="0" width="98" scrolling="no"></iframe></p>  <p> The slide deck is as follows</p> <iframe style="border-width: 1px 1px 0px; border-style: solid; border-color: rgb(204, 204, 204); margin-bottom: 5px;" height="356" marginheight="0" src="https://www.slideshare.net/slideshow/embed_code/14957264" frameborder="0" width="427" marginwidth="0" scrolling="no" allowfullscreen="allowfullscreen"></iframe>   <div style="margin-bottom: 5px;"><strong><a title="Web forms" href="https://www.slideshare.net/rustd/web-forms-14957264" target="_blank">Web forms</a> </strong>from <strong><a href="https://www.slideshare.net/rustd" target="_blank">rustd</a></strong> </div>]]></content:encoded>
    </item>
    <item>
      <title>ASP.NET Web Forms Application (2012) Templates on Visual Studio 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/asp-net-web-forms-application-2012-templates-on-visual-studio-2010</link>
      <pubDate>Mon, 29 Oct 2012 01:42:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/10/29/asp-net-web-forms-application-2012-templates-on-visual-studio-2010/</guid>
      <description><![CDATA[The release of Visual Studio 2012 included updated templates for ASP.NET WebForms, MVC and WebPages....]]></description>
      <content:encoded><![CDATA[<p><span size="2" style="font-size: x-small;">The release of Visual Studio 2012 included updated templates for ASP.NET WebForms, MVC and WebPages. The templates showcased the use of modern standards in HTML5, CSS and JavaScript. Apart from these, they also showcased social login via Twitter, Facebook etc.&nbsp; Scott Hanselman has a short video demonstrating </span><a href="https://www.asp.net/vnext/overview/videos/oauth-in-the-default-aspnet-45-templates" target="_blank"><span size="2" style="font-size: x-small;">social login</span></a><span size="2" style="font-size: x-small;">. While this amazing goodness was available for developers who had access to VS2012. If you were a Web Forms developer using VS2010SP1, then there was no way for you install these templates. </span></p>
<p><span size="2" style="font-size: x-small;">To solve this problem, I created a Visual Studio Extension which will install the templates that we shipped with VS2012.</span></p>
<p><span size="2" style="font-size: x-small;"><strong><span style="background-color: #ffff00;">Note</span>: </strong>This Extension is by no means supported by Microsoft. It is something I created in my own spare time to make it easier for WebForms developers using VS2010SP1 to use the updated templates that we shipped with VS2012</span></p>
<p>&nbsp;</p>
<h2>Download and Use the Extension</h2>
<ul>
<li>If you are using VS2010SP1, then you can do the following else you can download the extension(<a href="https://visualstudiogallery.msdn.microsoft.com/ec79e369-51bd-4212-83d0-71349d038461" target="_blank">ASPNETWebForms</a>) from the VS Gallery</li>
<li><span size="2" style="font-size: x-small;">Open VS2010SP1</span></li>
<li><span size="2" style="font-size: x-small;">Click Tools &ndash; Extension Manager</span></li>
<li><span size="2" style="font-size: x-small;">Goto Online Gallery and search for &ldquo;aspnet webforms&rdquo;</span></li>
<li><span size="2" style="font-size: x-small;">Alternately, you can search for the name of the extensions &ldquo;<strong>ASPNETWebForms</strong>&rdquo;</span></li>
<li><span size="2" style="font-size: x-small;">Once you have searched for the extension, it will appear as follows in the search result</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/6765.extensionsearch_4C4E3478.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/6765.extensionsearch_5F00_4C4E3478.png"><img title="extensionsearch" style="display: inline; background-image: none;" border="0" alt="extensionsearch" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/1050.extensionsearch_thumb_6F2EF628.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/1050.extensionsearch_5F00_thumb_5F00_6F2EF628.png" width="564" height="312" /></a></li>
</ul>
<p>&nbsp;</p>
<ul>
<li><span size="2" style="font-size: x-small;">Download the extension/ The templates will show up in the File-New project dialog in the following category(Visual C#&ndash; Web)</span></li>
<li><span size="2" style="font-size: x-small;">To use the installed templates, create the project in &ldquo;File &ndash; New Project &ndash; Visual C#-Web &ndash; ASPNETWebFormsApplication&rdquo;</span></li>
</ul>
<blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/2642.extension_installed_4311F937.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/2642.extension_5F00_installed_5F00_4311F937.png"><img title="extension_installed" style="display: inline; background-image: none;" border="0" alt="extension_installed" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/6765.extension_installed_thumb_3B1A56D5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/6765.extension_5F00_installed_5F00_thumb_5F00_3B1A56D5.png" width="555" height="361" /></a></p>
</blockquote>
<ul>
<li><span size="2" style="font-size: x-small;">Once the project is created, follow the instructions in the readme.txt file to Build &amp; Run the project</span></li>
</ul>
<p><a href="https://visualstudiogallery.msdn.microsoft.com/ec79e369-51bd-4212-83d0-71349d038461"><span size="2" style="font-size: x-small;">https://visualstudiogallery.msdn.microsoft.com/ec79e369-51bd-4212-83d0-71349d038461</span></a><span size="2" style="font-size: x-small;"> has more details about the Extension and also what SKUs are supported.</span></p>
<p><span size="2" style="font-size: x-small;">Please do give feedback on the <a href="https://visualstudiogallery.msdn.microsoft.com/ec79e369-51bd-4212-83d0-71349d038461" target="_blank">VS Gallery</a> for the extension.<br /></span></p>
<p><span size="2" style="font-size: x-small;"></span></p>
<p><span size="2" style="font-size: x-small;">This post has been cross posted at&nbsp;<a href="https://blogs.msdn.com/b/webdev/archive/2012/10/29/asp-net-web-forms-application-2012-templates-on-visual-studio-2010.aspx">https://blogs.msdn.com/b/webdev/archive/2012/10/29/asp-net-web-forms-application-2012-templates-on-visual-studio-2010.aspx</a>&nbsp;</span></p>
<p><span size="2" style="font-size: x-small;"></span></p>
<p><span size="2" style="font-size: x-small;"></span></p>
<p><span size="2" style="font-size: x-small;"></span></p>
<p><span size="2" style="font-size: x-small;"></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Common commands to manage a Sql Instance</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/common-commands-to-manage-a-sql-instance</link>
      <pubDate>Tue, 23 Oct 2012 00:32:01 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/10/23/common-commands-to-manage-a-sql-instance/</guid>
      <description><![CDATA[This post is a repository of commands that I have been commonly using to manage a Sql Instance....]]></description>
      <content:encoded><![CDATA[<p>This post is a repository of commands that I have been commonly using to manage a Sql Instance.</p>  <h3>List the sys admins on a instance</h3>  <p>select [name] from sys.syslogins where sysadmin=1</p>  <h3>Add yourself/someone as a sysadmin on sql instance</h3>  <p>EXEC master..sp_addsrvrolemember @loginame = N'redmond\pranavra', @rolename = N'sysadmin'</p>  <p>EXEC master..sp_addsrvrolemember @loginame = N'BUILTIN\Administrators', @rolename = N'sysadmin'</p>  <p>EXEC master..sp_addsrvrolemember @loginame = N'REDMOND\aapfte', @rolename = N'sysadmin'</p>  <p>&#160;</p>  <h3>Remove yourself/someone as a sysadmin on sql instance</h3>  <p>EXEC sp_droprolemember 'sysadmin', 'redmond\pranavra'</p>  <h3>Running these commands if you do not have VS Pro and cannot connect to TSqlEditor</h3>  <ul>   <li>Open an admin prompt </li>    <li>Goto SQLInstall\Microsoft SQL Server\MSSQL.X\MSSQL\Binn eg D:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn</li>    <li>sqlcmd -SComputerName\InstanceName Eg Sqlcmd -S .\SQLEXPRESS</li>    <li>Execute the command as you need eg     <ul>       <li>select [name] from sys.syslogins where sysadmin=1</li>        <li>Go</li>     </ul>   </li> </ul>  <h3>Changing compatibility version of sqldatabase</h3>  <p>EXEC sp_dbcmptlevel 'aspnet-WebApplication3-20120502172054', 90 </p>]]></content:encoded>
    </item>
    <item>
      <title>ASP.NET WebForms Model Binding – Overview</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/asp-net-webforms-model-binding-overview</link>
      <pubDate>Mon, 22 Oct 2012 23:14:00 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/10/22/asp-net-webforms-model-binding-overview/</guid>
      <description><![CDATA[This is the first post in the part of series around Model Binding. In this post I will introduce...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: x-small;">This is the first post in the part of series around Model Binding. In this post I will introduce Model Binding integration in ASP.NET WebForms while focusing on history, benefits, principles and the integration of Model Binding. In the upcoming posts, I will be going into the details about the features that are supported by this system.</span></p>
<h3>What is Model Binding</h3>
<p><span style="font-size: x-small;">Model Binding is a system which binds a value submitted from the client to a model on the server so that the model is available for inspection for validation rules and processing on the server. In essence the system has two fundamental functions &ndash; Binding &amp; Validation.</span></p>
<p><span style="font-size: x-small;">In a WebForms application, data binding(from client to server and vice versa) typically happens via Data Bound and Data Source controls. While this approach has the advantages of an experience where you can get your application up and running easily, it does have some drawbacks for some developers who want to tap in more modern ways of developing applications, such as : doing validation using Data Annotations, <a name="PRG"></a></span><span style="font-size: x-small;">PRG pattern, Repository patters, cleaner page code behind etc.</span></p>
<h3>History Behind Model Binding</h3>
<p><span style="font-size: x-small;">Model Binding as a system has existed in many Frameworks. Rails implements the core functions of Binding &amp; Validation in its own way. ASP.NET MVC had Model binding support since its early stages. When ASP.NET MVC2 was released, the team released a prototype of an &ldquo;</span><a href="https://aspnet.codeplex.com/downloads/get/110748" target="_blank"><span style="font-size: x-small;">Extensible Model Binding system</span></a><span style="font-size: x-small;">&rdquo;. This prototype made it possible for a&nbsp; Framework developer to write their own Model Binding system, should they choose to do so.(of course anyone in their right minds would not attempt it, but the ASP.NET team decided anyways to do this for WebForms)</span></p>
<p><span style="font-size: x-small;">Infact this Extensible Model Binding was how the team derived lots of inspiration from while trying to implement a Model Binding System that integrates the flexibility of Model Binding system and power of controls. ASP.NET WebAPI also derives some inspiration from this extensible model when ASP.NET WebAPI added support for binding using different formatters.</span></p>
<h3>Benefits of Model Binding</h3>
<p><span style="font-size: x-small;">With the introduction of Model Binding, it is now much easier to build modern webforms applications. Following are the areas where this integration adds value</span></p>
<ul>
<li><span style="font-size: x-small;">Rich controls support</span></li>
<ul>
<li><span style="font-size: x-small;">All the existing data bound controls such as GridView, ListView etc have been updated to work with Model Binding so you should be able to reuse the rich functionality of these controls</span></li>
</ul>
<li><span style="font-size: x-small;">Validation</span></li>
<ul>
<li><span style="font-size: x-small;">Modern ways of validation using Data Annotation attributes</span></li>
<li><span style="font-size: x-small;">Easier to propagate validation errors from Business Layer back to the UI on the page</span></li>
<li><span style="font-size: x-small;">Easier to integrate model level validation errors(from ORM such as EF or anything of your choice) when saving the record in the database</span></li>
</ul>
<li><span style="font-size: x-small;">Dynamic Data support</span></li>
<ul>
<li><span style="font-size: x-small;">Easier to add validation via Data Annotations and client side validation</span></li>
<li><span style="font-size: x-small;">Easier to customize the UI for columns using Data Annotations and Field Templates</span></li>
<ul>
<li><span style="font-size: x-small;">Add rich UI for integrating jquery based DateTime picker for DateTime fields</span></li>
</ul>
<li><span style="font-size: x-small;">Easier to customize the entities using Data Annotations and Entity Templates</span></li>
</ul>
<li><span style="font-size: x-small;">Easier to embrace the following patterns</span></li>
<ul>
<li><span style="font-size: x-small;">Unit Testing the application layer</span></li>
<li><a href="https://en.wikipedia.org/wiki/Post/Redirect/Get" target="_blank"><span style="font-size: x-small;">PRG pattern</span></a></li>
<li><span style="font-size: x-small;">Repository pattern</span></li>
<li><span style="font-size: x-small;">Cleaner page code behind methods. These server side code files do not have any application functional code and they only focus on UI interactions</span></li>
</ul>
<li><span style="font-size: x-small;">Extensible Model Binding system</span></li>
<ul>
<li><span style="font-size: x-small;">Support scenarios of binding in advanced scenarios such as complex types, ad-hoc Model Binding</span></li>
<li><span style="font-size: x-small;">Customize the existing implementation to enable more commonly used scenarios easier such as Master Details view</span></li>
<li><span style="font-size: x-small;">Add more Binders and Value providers</span>&nbsp;</li>
</ul>
</ul>
<p><span style="font-size: x-small;">I hope so far this would help you understand the bigger picture with WebForms Model Binding and value it brings to an application developer. As Scott Hanselman </span><a href="https://www.hanselman.com/blog/OneASPNETSneakPeekElegantWebFormsAndSnowballsInHell.aspx" target="_blank"><span style="font-size: x-small;">noted</span></a><span style="font-size: x-small;">, this integration also brings ASP.NET MVC/WebForms application development much closer.</span></p>
<p><span style="font-size: x-small;">In the next post we will be looking at some high level fundamentals and features on Model Binding in WebForms</span></p>
<p>Cross posted to https://blogs.msdn.com/b/webdev/archive/2012/11/15/asp-net-webforms-model-binding-overview.aspx&nbsp;&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>ASP.NET 4.5 ScriptManager Improvements in WebForms</title>
      <link>https://docs.microsoft.com/archive/blogs/pranav_rastogi/asp-net-4-5-scriptmanager-improvements-in-webforms</link>
      <pubDate>Fri, 21 Sep 2012 02:07:45 GMT</pubDate>
      <dc:creator><![CDATA[pranav rastogi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pranav_rastogi/2012/09/21/asp-net-4-5-scriptmanager-improvements-in-webforms/</guid>
      <description><![CDATA[The ScriptManger control has undergone some key targeted changes in ASP.NET 4.5 which makes it...]]></description>
      <content:encoded><![CDATA[<p>The ScriptManger control has undergone some key targeted changes in ASP.NET 4.5 which makes it easier to register, manage and combine scripts using the ASP.NET <a href="https://aspnetoptimization.codeplex.com/" target="_blank">weboptimization</a> feature. This post will highlight the changes that have happened to this control</p>  <h2>Easy Integration with JQuery and JQueryUI</h2>  <p>The <a href="https://github.com/rustd/ASPNETTemplates" target="_blank">default templates</a> for WebForms ship with the following packages “<strong><a href="https://nuget.org/packages/AspNet.ScriptManager.jQuery" target="_blank">AspNet.ScriptManager.jQuery</a></strong>” and “<strong><a href="https://nuget.org/packages/AspNet.ScriptManager.jQuery.UI.Combined" target="_blank">AspNet.ScriptManager.jQuery.UI.Combined</a></strong>”. These packages make it easier to bring in jquery and jqueryUI libraries&#160; and also register them with the ScriptManager. Here is how it works.</p>  <p>These packages add the following <a href="https://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.scriptresourcemapping.aspx" target="_blank">ScriptMappings</a> for jquery and jqueryUI in the <a href="https://haacked.com/archive/2010/05/16/three-hidden-extensibility-gems-in-asp-net-4.aspx" target="_blank">PreApplicationStart</a> method of the application</p>  <h3>JQuery</h3>  <div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">   <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">     <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(0, 0, 255);">string</span> str = <span style="color: rgb(0, 96, 128);">&quot;1.7.1&quot;</span>;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    ScriptManager.ScriptResourceMapping.AddDefinition(<span style="color: rgb(0, 96, 128);">&quot;jquery&quot;</span>, <span style="color: rgb(0, 0, 255);">new</span> ScriptResourceDefinition</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        Path = <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/jquery-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.min.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        DebugPath = <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/jquery-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnPath = <span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/jQuery/jquery-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.min.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        CdnDebugPath = <span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/jQuery/jquery-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnSupportsSecureConnection = <span style="color: rgb(0, 0, 255);">true</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        LoadSuccessExpression = <span style="color: rgb(0, 0, 255);">&quot;window.jQuery&quot;</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    });</pre>
<!--CRLF--></div>
</div>

<h3>JQuery.UI</h3>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(0, 0, 255);">string</span> str = <span style="color: rgb(0, 96, 128);">&quot;1.8.20&quot;</span>;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    ScriptManager.ScriptResourceMapping.AddDefinition(<span style="color: rgb(0, 96, 128);">&quot;jquery.ui.combined&quot;</span>, <span style="color: rgb(0, 0, 255);">new</span> ScriptResourceDefinition</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        Path = <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/jquery-ui-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.min.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        DebugPath = <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/jquery-ui-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnPath = <span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/jquery.ui/&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;/jquery-ui.min.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        CdnDebugPath = <span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/jquery.ui/&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;/jquery-ui.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnSupportsSecureConnection = <span style="color: rgb(0, 0, 255);">true</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    });</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<p>These SciptMappings are registered with ScriptManager as follows</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">&lt;asp:ScriptManager runat=<span style="color: rgb(0, 96, 128);">&quot;server&quot;</span>&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        &lt;Scripts&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;jquery&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;jquery.ui.combined&quot;</span> /&gt;            </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        &lt;/Scripts&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    &lt;/asp:ScriptManager&gt;</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<p>Now you can enjoy all the benefits of having ScriptManager such as</p>

<h3>Debug/Release Support</h3>

<p>If you are debugging your application(debug=true) in web.config then ScriptManager will serve the scripts from debug path(non minified scripts) such as “~/Scripts/jquery-1.7.1.js”</p>

<h3>CDN Support</h3>

<p>If your set EnableCDN=true on the ScriptManager control, then all the Scripts will be served from the CDN path such as “<a href="https://ajax.aspnetcdn.com/ajax/jquery-1.7.1.js">https://ajax.aspnetcdn.com/ajax/jquery-1.7.1.js</a>”</p>

<h3>Override Script Mappings</h3>

<p>Let’s assume that you wanted to override the scriptmappings to change the CDN path where these scripts are served from. You can do so by changing the scriptmapping before the page is accessed. Typically doing this in Global.asax is better</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(0, 0, 255);">string</span> str = <span style="color: rgb(0, 96, 128);">&quot;1.7.1&quot;</span>;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    ScriptManager.ScriptResourceMapping.AddDefinition(<span style="color: rgb(0, 96, 128);">&quot;jquery&quot;</span>, <span style="color: rgb(0, 0, 255);">new</span> ScriptResourceDefinition</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        Path = <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/jquery-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.min.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        DebugPath = <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/jquery-&quot;</span> + str + <span style="color: rgb(0, 96, 128);">&quot;.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnPath = <span style="color: rgb(0, 96, 128);">&quot;https://https://code.jquery.com/jquery-&quot;</span>+ str + <span style="color: rgb(0, 96, 128);">&quot;.min.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        CdnDebugPath = <span style="color: rgb(0, 96, 128);">&quot;https://code.jquery.com/jquery-&quot;</span>+ str + <span style="color: rgb(0, 96, 128);">&quot;.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnSupportsSecureConnection = <span style="color: rgb(0, 0, 255);">true</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    });</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<h3>Updating Jquery/JqueryUI libraries</h3>

<p>Let’s say a new version of Jquery or JqueryUI comes along. Traditionally you would have to download the jquery packages for these libraries and then update the script references everywhere on your pages. With the above integration of AspNet.ScriptManager.Jquery packges this scenario really becomes easy since when you update Jquery/JqueryUI you will get corresponding versions of AspNet.ScriptManager.Jquery/AspNet.ScriptManager.Jquery.UI which will update the scriptmappings to the current version of jquery that was downloaded and you do not have to change anything in your application</p>

<h2>LoadSuccessExpression</h2>

<p>This is a new property which is added to the ScriptMapping and it takes care of the following use case. Imagine that you are serving your scripts from a CDN path and if there is an outage in the CDN, your site will be affected because you will not be able to serve any scripts. This property takes in an expression which evaluates whether the script was loaded correctly and if it fails then it renders the script from the local application path. </p>

<p>Following is how the script tag looks like for jquery(assuming that you are serving scripts from CDN)</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">&lt;script src=<span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.1.js&quot;</span> type=<span style="color: rgb(0, 96, 128);">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">&lt;script type=<span style="color: rgb(0, 96, 128);">&quot;text/javascript&quot;</span>&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(0, 128, 0);">//&lt;![CDATA[</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">(window.jQuery)||document.write(<span style="color: rgb(0, 96, 128);">'&lt;script type=&quot;text/javascript&quot; src=&quot;Scripts/jquery-1.8.1.js&quot;&gt;&lt;\/script&gt;'</span>);<span style="color: rgb(0, 128, 0);">//]]&gt;</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">&lt;/script&gt;</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<h2>Remapping Framework scripts</h2>

<p>One neat improvement that happened in ASP.NET 4.5 is the decoupling of the “Microsoft Ajax script files(MicrosoftAjaxCore etc)” and the WebForms scripts(GridView.js etc). We did the work in this release so you can serve these scripts from your application Scripts folder rather than load then up from System.Web This makes the scripts easily redistributable and updateable. The following section explains on how you can use these scripts and combine them with WebOptimization feature</p>

<h3>Serving Framework Scripts from inside the application</h3>

<p>We created the following 2 packages “<a href="nuget.org/packages/Microsoft.AspNet.ScriptManager.MSAjax" target="_blank">Microsoft.AspNet.ScriptManager.MSAjax</a>” “<a href="nuget.org/packages/Microsoft.AspNet.ScriptManager.WebForms" target="_blank">Microsoft.AspNet.ScriptManager.WebForms</a>” which do the following</p>

<p>Install the Scripts into your application so it looks like follows</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/1832.fxscripts_0D3AE7EC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/1832.fxscripts_5F00_0D3AE7EC.png"><img title="fxscripts" style="display: inline; background-image: none;" border="0" alt="fxscripts" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/8875.fxscripts_thumb_66009EB6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/8875.fxscripts_5F00_thumb_5F00_66009EB6.png" width="318" height="414" /></a></p>

<p>These packages also create the following scriptmappings so that they can be registered with ScriptManager as follows</p>

<h3>MicrosoftAjax scripts</h3>

<p>We are registering all the scripts and we are bundling them together as “MsAjaxBundle”</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">ScriptManager.ScriptResourceMapping.AddDefinition(<span style="color: rgb(0, 96, 128);">&quot;MsAjaxBundle&quot;</span>, <span style="color: rgb(0, 0, 255);">new</span> ScriptResourceDefinition</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        Path = <span style="color: rgb(0, 96, 128);">&quot;~/bundles/MsAjaxJs&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnPath = <span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/4.5/6/MsAjaxBundle.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        LoadSuccessExpression = <span style="color: rgb(0, 96, 128);">&quot;window.Sys&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnSupportsSecureConnection = <span style="color: rgb(0, 0, 255);">true</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    });</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjax.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys._Application &amp;&amp; Sys.Observer&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxCore.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Type &amp;&amp; Sys.Observer&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxGlobalization.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.CultureInfo&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxSerialization.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.Serialization&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxComponentModel.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.CommandEventArgs&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxNetwork.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.Net &amp;&amp; Sys.Net.WebRequestExecutor&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxHistory.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.HistoryEventArgs&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxWebServices.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.Net &amp;&amp; Sys.Net.WebServiceProxy&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxTimer.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.UI &amp;&amp; Sys.UI._Timer&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxWebForms.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.WebForms&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    PreApplicationStartCode.AddMsAjaxMapping(<span style="color: rgb(0, 96, 128);">&quot;MicrosoftAjaxApplicationServices.js&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;window.Sys &amp;&amp; Sys.Services&quot;</span>);</pre>
<!--CRLF--></div>
</div>

<p>Here is the Bundle definition for these scripts</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">bundles.Add(<span style="color: rgb(0, 0, 255);">new</span> ScriptBundle(<span style="color: rgb(0, 96, 128);">&quot;~/bundles/MsAjaxJs&quot;</span>).Include(</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">                <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/MsAjax/MicrosoftAjax.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">                <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">                <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">                <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js&quot;</span>));</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<p>Here is the ScriptManger registration for these scripts</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">&lt;asp:ScriptManager runat=<span style="color: rgb(0, 96, 128);">&quot;server&quot;</span> &gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        &lt;Scripts&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;%--Framework Scripts--%&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;MsAjaxBundle&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;%--Site Scripts--%&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        &lt;/Scripts&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    &lt;/asp:ScriptManager&gt;</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<h3>WebForms scripts</h3>

<p>We are registering all the scripts and we are bundling them together as “WebFormsBundle”</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">ScriptManager.ScriptResourceMapping.AddDefinition(<span style="color: rgb(0, 96, 128);">&quot;WebFormsBundle&quot;</span>, <span style="color: rgb(0, 0, 255);">new</span> ScriptResourceDefinition</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        Path = <span style="color: rgb(0, 96, 128);">&quot;~/bundles/WebFormsJs&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnPath = <span style="color: rgb(0, 96, 128);">&quot;https://ajax.aspnetcdn.com/ajax/4.5/6/WebFormsBundle.js&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        LoadSuccessExpression = <span style="color: rgb(0, 96, 128);">&quot;window.WebForm_PostBackOptions&quot;</span>, </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        CdnSupportsSecureConnection = <span style="color: rgb(0, 0, 255);">true</span></pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    });</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<p>Bundle Definition</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">bundles.Add(<span style="color: rgb(0, 0, 255);">new</span> ScriptBundle(<span style="color: rgb(0, 96, 128);">&quot;~/bundles/WebFormsJs&quot;</span>).Include(</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/WebForms.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/WebUIValidation.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/MenuStandards.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/Focus.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/GridView.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/DetailsView.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/TreeView.js&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">                  <span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/WebParts.js&quot;</span>));</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<h3>ScriptManager registration</h3>

<p>The reason we have the Assembly and the Path attribute here is because ScriptManager special cases these scripts when it tries to load them, so we had to make some special arrangements with ScriptManager code to make this work <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/37/85/metablogapi/7128.wlEmoticon-smile_178C0C4C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-37-85-metablogapi/7128.wlEmoticon_2D00_smile_5F00_178C0C4C.png" /> This is a process which is called deduping. Basically when the ScriptManager tried to load up these scripts, it can load them up from System.Web or the path attribute and eventually in this case, the ScriptManager dedupes the script references and serves the scripts from the path attribute. This is part of the “special arrangement” that we did in ScriptManager. We were very cautious when doing this given this code path was on a very critical path for mainline ScriptManager scenarios which we did not want to regress.</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">&lt;asp:ScriptManager runat=<span style="color: rgb(0, 96, 128);">&quot;server&quot;</span> &gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">        &lt;Scripts&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;%--Framework Scripts--%&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;WebForms.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/WebForms.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;WebUIValidation.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/WebUIValidation.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;MenuStandards.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/MenuStandards.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;GridView.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/GridView.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;DetailsView.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/DetailsView.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;TreeView.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/TreeView.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;WebParts.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/WebParts.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;Focus.js&quot;</span> Assembly=<span style="color: rgb(0, 96, 128);">&quot;System.Web&quot;</span> Path=<span style="color: rgb(0, 96, 128);">&quot;~/Scripts/WebForms/Focus.js&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">            &lt;asp:ScriptReference Name=<span style="color: rgb(0, 96, 128);">&quot;WebFormsBundle&quot;</span> /&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">            &lt;%--Site Scripts--%&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">&#160;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">        &lt;/Scripts&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">    &lt;/asp:ScriptManager&gt;</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<p>When you run this page you will get script references as follows</p>

<div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);">
  <div id="codeSnippet" style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">&lt;script src=<span style="color: rgb(0, 96, 128);">&quot;/bundles/MsAjaxJs?v=J4joXQqg80Lks57qbGfUAfRLic3bXKGafmR6wE4CFtc1&quot;</span> type=<span style="color: rgb(0, 96, 128);">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);">&lt;script src=<span style="color: rgb(0, 96, 128);">&quot;/bundles/WebFormsJs?v=q9E9g87bUDaS624mcBuZsBaM8xn2E5zd-f4FCdIk2cA1&quot;</span> type=<span style="color: rgb(0, 96, 128);">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;">    &lt;script type=<span style="color: rgb(0, 96, 128);">&quot;text/javascript&quot;</span>&gt;</pre>
<!--CRLF--></div>
</div>

<p>&#160;</p>

<p>So these were the improvements that happened in the ScriptManager control for registering scripts. In case you want to refresh your memory, <a href="https://weblogs.asp.net/infinitiesloop/archive/2009/11/23/asp-net-4-0-scriptmanager-improvements.aspx" target="_blank">ScriptManager</a> was greatly enhanced in ASP.NET v4.0 and Dave Reed had a fantastic post about it, which I strongly recommend to go through.</p>]]></content:encoded>
    </item>
  </channel>
</rss>