Title: RE: [Mono-dev] [PATCH] ASP.NET 2.0 - fix for TemplateSourceDirectory inheritance with master pages

Hello Marek,

To solve the problem you describe, MS set the new property - AppRelativeTemplateSourceDirectory. I think it would be better to follow their solution - then we will be able to share our code (see Control.TemplateSourceDirectory - the JVM version). In addition, if the user overrides TemplateSourceDirectory, his code will not compile under mono.

Regards,
Konstantin Triger



-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Marek Habersack
Sent: Thu 08/02/2007 00:25
To: Mono Development List
Subject: [Mono-dev] [PATCH] ASP.NET 2.0 - fix for TemplateSourceDirectory inheritance with master pages

Hello,

  The attached diff fixes a situation, where ResolveClientUrl wouldn't work
correctly if it was used from within a control placed in a page that uses a
master page, i.e. if the parenthood tree was like:

System.Web.UI.WebControls.ContentPlaceHolder
  System.Web.UI.HtmlControls.HtmlForm
    ASP.test_master
      ASP.Default_aspx

with the site layout:

Default.aspx
subdir/test.master
subdir/Default.aspx

In such situation, ResolveUrl (called by ResolveClientUrl) would return
incorrect URL for any relative address, in the above case, if invoked from
~/Default.aspx:

ResolveClientUrl("subdir/Default.aspx") == subdir/subdir/Default.aspx

This was due to the fact, that ASP.test_master TemplateSourceDirectory code
(generated by the TemplateControlCompiler) would not reach up to its parent,
but would return "~/subdir" instead of "/".

The diff makes two modifications - first it makes sure TemplateSourceDirectory
always returns a HTTP-absolute URL (e.g. /, /subdir etc) and that any template
control checks for its parent's TemplateSourceDir value before returning its
hard-coded source directory.

please review, thanks

marek

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to