Wednesday, October 26, 2005

ASP.NET - Relative Url's

ASPX:


HTML Client output:

somewhere else, not inside the control you can use the ResolveUrl("~/bilder/spacer.gif");

Masterpages per Browser

yes its possible to generate for each differnent browser its own MasterPage.

<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default"
ie:MasterPageFile="~/MasterPage_IE.master"
mozilla:MasterPageFile="~/MasterPage_Firefox.master"
%>

ASP.NET 2.0 URLMappings

do we need a special url? as short as possible?

so make from:

http://www.xyz.ch/testApp/testApp1/Version51/thisIsASamplePageWhatEverItIs.aspx

http://www.xyz.ch/myPage.aspx


mappedUrl="~/testApp1/Version51/thisIsASamplePageWhatEverItIs.aspx"/>

MasterPage, How-To change it on the fly

surely you can also change your masterPage on the fly. the only thing which has to be done is the following thing:

NOTICE: think about the page cicle!!!!

protected override void OnPreInit(EventArgs e){object tpl = Request.QueryString["Template"];if (tpl == null tpl.ToString() == "Default"){this.MasterPageFile = "~/Templates/Category/Standard.master";}else{this.MasterPageFile = "~/Templates/Category/Sample.master";}}

JavaScript Debugging

Clear the "disable script debugging" checkbox in Internet Explorer's advanced properties. Add the keyword "debugger" somewhere within your JavaScript.When you run the web page from Visual Studio in debugging mode, viola--when it hits the "debugger" statement, the Visual Studio debugger window takes control, you can set your break points, and proceed as normal. You can even get very clever setting the "debugger" from within script created from you server-side code that's registered with one of the many "Register" client-side script block methods.

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge