[Mono-devel-list] asp.net usercontrols and WriteFile features

charlie monodevellist at charlie.at
Sun Mar 20 15:08:23 EST 2005


Hi Guys,

i have been doing a bit of asp.net programming and have run into a few
features :-). here a code snippet of what I am doing:

Menu.ascx
  public class Menu : System.Web.UI.UserControl
  {

    private void Page_Load(object sender, System.EventArgs e)
    {
    }
    protected override void Render(HtmlTextWriter output)
    {
#if __MonoCS__
      Response.WriteFile("/home/[absolutepath]/html/Menu.html");
#else
      Response.WriteFile("../html/Menu.html");
#endif
    }

Prod.aspx
  <body>
    <gutschn:Menu id="Menu1" runat="server"></gutschn:Menu>


- Response.WriteFile under MS works relative to the as?x file that
contains it, but apparently not so in mono. Thus under IIS including
this webcontrol where both aspx and ascx file are in cgi-bin, pulls in
the the afore mentioned html file from the parallel html directory. I
was able to counter with with #if, not nice, but it works

- UserControl.Render under mono executes to a different time than under
IIS. In IIS the 'included' html gets written where the control is,
whereas under mono the html gets written before the output of the aspx
file. Thus I have my meta-tags, menu and footer and then comes the
<!DOCTYPE and the rest of the page :-(


Has anyone had similar experiences ??

current system is suse 9.2, apache2 and the 1.1.4 / 1.0.6 mix that one
gets off the mono-project homepage
rpm -qa | grep mono
mono-data-1.1.4-1.ximian.10.1
mono-winforms-1.1.4-1.ximian.10.1
mono-basic-1.1.4-1.ximian.10.1
mono-data-oracle-1.1.4-1.ximian.10.1
mono-data-sqlite-1.1.4-1.ximian.10.1
mono-ikvm-1.1.4-1.ximian.10.1
mod_mono-1.0.6-1.ximian.9.1    (now 1.0.7)
mono-devel-1.1.4-1.ximian.10.1
mono-core-1.1.4-1.ximian.10.1
mono-web-1.1.4-1.ximian.10.1
mono-extras-1.1.4-1.ximian.10.1
mono-data-postgresql-1.1.4-1.ximian.10.1
mono-data-sybase-1.1.4-1.ximian.10.1
mono-locale-extras-1.1.4-1.ximian.10.1
mono-complete-1.1.4-1.ximian.10.1
mono-jscript-1.1.4-1.ximian.10.1

mod_mono.so has since been replaced with a svn 1.0.7 compile from source
to take advantage of multiple named applications (works like a charm
*g*, multiple virtual servers with their own applications)

regards
  charlie



More information about the Mono-devel-list mailing list