Setting Page Titles 2005 Style

Little tip.

To set the page title on an ASP.NET Web From using Whidbey, add runat=”server” properties to the head and title tags in your HTML:




<br /> </head></code></p> <p>Now, you can set the page easily using:</p> <p><code><br /> this.Title = "My new page title";</code></p> <p>Simple as!</p> <div class="Article_authorBio l-mv4 t-bg-white m-border l-pa3"> <div class="l-d-f l-pt3"> <a class="l-s5 l-pa0 l-mr3 l-round l-o-h" href="https://www.sitepoint.com/author/philip-miseldine/"> <img src="https://secure.gravatar.com/avatar/ac68fbf57913531cc509000d75beddab?s=96&d=mm&r=g" width="96" height="96" alt="" class="avatar avatar-96 wp-user-avatar wp-user-avatar-96 photo avatar-default" /> </a> <div class="f-lh-title"> <div class="f-c-grey-300">Meet the author</div> <div class="f-large"> <a class="f-bold f-c-grey-500" href="https://www.sitepoint.com/author/philip-miseldine/"> Philip Miseldine </a> </div> </div> </div> <div class="f-light f-lh-copy l-mt3">Philip is a Computer Science PhD student at Liverpool John Moores University. He's still not mastered guitar tabs, never finished Mario, and needs a haircut. He discusses life at <a href="http://www.miseldine.com/">http://www.miseldine.com/</a>.</div> </div> </div> </div> </div> </div> <div class="l-w-aside-i l-mt3 l-mh3 l-d-n l-d-f--3col l-fd-col l-fs0"> <div class="l-mb3"> <sp-heading content="Sponsors"></sp-heading> <div class="l-w-100 l-mv3 t-bg-white m-border"><div class="widget maestro maestro-content-type-html hide-for-mobile-SP" id="a5cb9e66a9763a765"><div class="proper-ad-unit"> <div id="proper-ad-sitepoint_sponsor_1"> <script> propertag.cmd.push(function() { proper_display('sitepoint_sponsor_1'); }); </script> </div> </div></div></div> <div class="widget maestro maestro-content-type-html hide-for-mobile-SP" id="a5cb9e66a98f76763"><div class="proper-ad-unit"> <div id="proper-ad-sitepoint_side_1"> <script> propertag.cmd.push(function() { proper_display('sitepoint_side_1'); }); </script> </div> </div></div> </div> <div class="ArticleBox u-premium-preview"></div> <div class="ArticleAside_row"><div class="widget maestro maestro-content-type-html " id="a5cb9e66a99898728"><div class="proper-ad-unit"> <div id="proper-ad-sitepoint_side_2"> <script> propertag.cmd.push(function() { proper_display('sitepoint_side_2'); }); </script> </div> </div></div><div class="widget maestro maestro-content-type-html " id="a5cb9e66a99b9e730"><div class="proper-ad-unit Sticky"> <div id="proper-ad-sitepoint_side_3"> <script> propertag.cmd.push(function() { proper_display('sitepoint_side_3'); }); </script> </div> </div></div> <ads-weighted widget='21' data='{"NL":[{"id":"584","weight":"50","randMax":50},{"id":"585","weight":"50","randMax":100}]}' fallback='' url='setting-page-titles-2005-style' channelSlug='programming'></ads-weighted></div> <div class="ArticleAside_row ArticleAside_newboxads"></div> </div> </div> <div class="u-accordion-end"></div> <div class="l-pa3 l-mt4"> <premium-latest-listing classname="m-border" type="Book" title="Programming Book" href="/premium/library/programming/" slug="programming" limit="4" heading_tag="h4"></premium-latest-listing> </div> <div class="l-d-f l-jc-cen l-w-100 l-mb4"> <a href="/premium/library/programming/" class="Button u-large">All Programming Books</a> </div> <div class="l-d-f l-jc-sb l-w-3col--3col l-mh-auto"> <div class="u-showseriesx l-w-100 l-w-2col-i--2col l-fg1 l-mh3--2col l-mh0--4col"> <div class="widget maestro maestro-content-type-html hide-for-tablet-SP hide-for-mobile-SP" id="a5cb9e66a9a39f649"><span data-sumome-listbuilder-embed-id="6cbb401075afaa88f82a6ddc686573be3368d07928cf833fe1a56254d6ff9849"></span></div> <div id="commentsSection" class="l-pa3 t-bg-white"> </div> </div> </div> <script> let data = 'programming'; if (localStorage && localStorage.SP_categories) { data = JSON.parse(localStorage.SP_categories).toString(); data = data ? data.replace('-', '') : 'programming' } oSpP && oSpP.push('channel', data); </script> </div> </div> <footer role="contentinfo"> <div class="l-w-100 l-d-f Footer-bg"> <div class="l-d-f l-fw-w l-mh-auto"> <div class="l-d-f l-fw-w l-mt4 l-w-100 l-pa3 l-w-3col--4col l-jc-sb l-jc-sa--4col"> <ul> <li class="t-ls-n"> <div class="f-c-white f-large f-bold l-mb2">Stuff We Do</div> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/premium/">Premium</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/community/">Forums</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/html-css/css/">References</a> </li> </ul> <ul> <li class="t-ls-n"> <div class="f-c-white f-large f-bold l-mb2">About</div> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/about-us/">Our Story</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/press/">Press Room</a> </li> </ul> <ul> <li class="t-ls-n"> <div class="f-c-white f-large f-bold l-mb2">Contact</div> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/contact-us/">Contact Us</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="https://sitepoint.zendesk.com/hc/en-us">FAQ</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/write-for-us/">Write for Us</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/advertise/">Advertise</a> </li> </ul> <ul> <li class="t-ls-n"> <div class="f-c-white f-large f-bold l-mb2">Legals</div> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/legals/">Terms of Use</a> </li> <li class="l-ml3 f-c-grey-300 l-mb2"> <a class="Footer-link f-small" href="/privacy-policy/">Privacy Policy</a> </li> </ul> </div> <div class="l-d-n l-d-b--4col l-as-cen Footer-hr" > </div> <div class="l-mt4 l-pa3 l-w-1col--4col"> <ul class="t-ls-n l-d-f l-fw-w l-d-b--3col"> <li> <div class="f-c-white f-large f-bold l-mb2 l-mr3">Connect</div> </li> <li class="f-center"> <a class="f-c-grey-300" href="https://www.facebook.com/sitepoint" rel="noopener" target="_blank"> <i class="fab fa-facebook-square l-i4"></i> </a> <a class="l-pl3 f-c-grey-300" href="http://twitter.com/sitepointdotcom" rel="noopener" target="_blank"> <i class="fab fa-twitter-square l-i4"></i> </a> <a class="l-pl3 f-c-grey-300" href="https://www.sitepoint.com/feed/"> <i class="fas fa-rss-square l-i4"></i> </a> <a class="l-pl3 f-c-grey-300" href="https://plus.google.com/+sitepoint" rel="noopener" target="_blank"> <i class="fab fa-google-plus-square l-i4"></i> </a> </li> <p class="f-c-grey-300 l-mh-auto l-ml3--2col l-ml0--3col l-mv3--4col f-small f-center"> © 2000 – 2019 SitePoint Pty. Ltd. </p> </ul> </div> </div> </div> </footer> <script type="text/javascript"> adroll_adv_id = "DJI3I3WGJBGL7PDJEDAYHV"; adroll_pix_id = "4RKMV6N56FGA7ANPGL4FQW"; (function () { var adblocked = false; var onAdblock = function() { if(adblocked) return; adblocked = true; gaEventQueue && gaEventQueue.track('CanSeeAds', 'adrollBlocked', {'nonInteraction': true}); Array.prototype.slice.call(document.getElementsByClassName('CantSeeAds')) .forEach(function(el) { el.className = el.className.replace('CantSeeAds', ''); }); }; var _onload = function(){ if (document.readyState && !/loaded|complete/.test(document.readyState)){setTimeout(_onload, 10);return} if (!window.__adroll_loaded){__adroll_loaded=true;setTimeout(_onload, 50);return} var scr = document.createElement("script"); var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com"); scr.setAttribute('async', 'true'); scr.type = "text/javascript"; scr.src = host + "/j/roundtrip.js"; scr.onerror = onAdblock; ((document.getElementsByTagName('head') || [null])[0] || document.getElementsByTagName('script')[0].parentNode).appendChild(scr); }; if (window.addEventListener) {window.addEventListener('load', _onload, false);} else {window.attachEvent('onload', _onload)} }()); </script> <sp-cookie-warning></sp-cookie-warning> <!-- START Parse.ly Include: Standard --> <div id="parsely-root" style="display: none"> <div id="parsely-cfg" data-parsely-site="sitepoint.com"></div> </div> <script data-cfasync="false"> (function (s, p, d) { var h = d.location.protocol, i = p + "-" + s, e = d.getElementById(i), r = d.getElementById(p + "-root"), u = h === "https:" ? "d1z2jf7jlzjs58.cloudfront.net" : "static." + p + ".com"; if (e) return; e = d.createElement(s); e.id = i; e.async = true; e.setAttribute('data-cfasync', 'false'); e.src = h + "//" + u + "/p.js"; r.appendChild(e); })("script", "parsely", document); </script> <!-- END Parse.ly Include: Standard --> <script type="text/javascript"> (function(googletag, SP_GPT_Slots) { if(!SP_GPT_Slots.length) return; var SP_GPT_First_Slot_Rendered = false; googletag.cmd.push(function(){ googletag.pubads().addEventListener("slotRenderEnded", function(e){ if (!SP_GPT_First_Slot_Rendered) { gaEventQueue.track("CanSeeAds", "dfpFirstRendered", {"nonInteraction": true}); SP_GPT_First_Slot_Rendered = true; } }); }); })(googletag, SP_GPT_Slots); </script> <div class="widget maestro maestro-content-type-html " id="a5cb9e66a9ba38758"><script id="spout-tag-7c887d1e-c4ea-4682-bad8-216a89ce74e5"> (function() { var r = encodeURIComponent(top.document.referrer.substring(0,250)), p = encodeURIComponent(top.document.location.href.substring(0,250)), t = Date.now(), u = '7c887d1e-c4ea-4682-bad8-216a89ce74e5', e = document.createElement('script'), s = sessionStorage.getItem('spoutable-' + u); if (!s) { var m = Math.random.bind(Math); s = JSON.stringify({ sessionId: [ t, m(), m(), m(), m(), m(), m(), m(), m(), m(), m(), m(), m() ]}); sessionStorage.setItem('spoutable-' + u, s); } e.async = true; e.src='//s.spoutable.com/s?u='+u+'&s='+encodeURIComponent(s)+'&t='+t+'&r='+r+'&p='+p; document.head.appendChild(e); })(); </script></div><div class="widget maestro maestro-content-type-html hide-for-mobile-SP" id="a5cb9e66a9bdf5746"><div id="Sticky--bottom" class="l-d-f l-p-fix l-jc-cen u-fixed l-pt3 l-w-100 l-pt3"> <div class="proper-ad-unit"> <div id="proper-ad-sitepoint_main_1"> <script> propertag.cmd.push(function() { proper_display('sitepoint_main_1'); }); </script> </div> </div> <i class="fas fa-times bottom-ad-close-button l-p-a"></i> </div></div><script type='text/javascript'> /* <![CDATA[ */ var ratingsL10n = {"plugin_url":"https:\/\/www.sitepoint.com\/wp-content\/plugins\/wp-postratings","ajax_url":"https:\/\/www.sitepoint.com\/wp-admin\/admin-ajax.php","text_wait":"Please rate only 1 item at a time.","image":"thumbs","image_ext":"gif","max":"2","show_loading":"1","show_fading":"1","custom":"1"}; var ratings_1_mouseover_image=new Image();ratings_1_mouseover_image.src="https://dab1nmslvvntp.cloudfront.net/wp-content/plugins/wp-postratings/images/thumbs/rating_1_over.gif";var ratings_2_mouseover_image=new Image();ratings_2_mouseover_image.src="https://dab1nmslvvntp.cloudfront.net/wp-content/plugins/wp-postratings/images/thumbs/rating_2_over.gif";; /* ]]> */ </script> <script type='text/javascript' src='https://dab1nmslvvntp.cloudfront.net/wp-content/plugins/wp-postratings/js/postratings-js.js?ver=1.85'></script> <script type='text/javascript' src='//www.sitepoint.com/wp-content/themes/sitepoint/assets/javascripts/scripts-foot-77d7df963c349e8aaeb6f2c765ce9a6e.js?ver=4.9.8'></script> <script type='text/javascript' src='https://www.sitepoint.com/dist/js/compiled.js'></script> <script type='text/javascript' src='https://www.sitepoint.com/wp-includes/js/wp-embed.min.js?ver=4.9.8'></script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.w3-edge.com/products/ Object Caching 15/63 objects using memcached Page Caching using memcached Content Delivery Network via Amazon Web Services: CloudFront: dab1nmslvvntp.cloudfront.net Served from: www.sitepoint.com @ 2019-04-19 08:16:58 by W3 Total Cache -->