Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2003, 12:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The stuff I added was just a small example which I did in order to see how it worked, but yes I am actually adding the HtmlForm on the fly, so to speak.

The reason why I do this is because I do not want any code what so ever in my .aspx file. I am trying to keep it as simple as possible why all elements are added on the fly. Actually, I have only got one line of code in the .aspx file, and that is the Page directive!

So what about performance...!? I do not have problems with that.

In the PageUI class I have a method that overrides the base, which goes like this...
Code:
protected override void MakeBody()
{
    if(userInterface != null)
    {
        OneCellTable table = new OneCellTable(userInterface);
        table.Width = Unit.Percentage(100);
        table.Height = Unit.Percentage(100);
        table.GridLines    = GridLines.None;
        table.CellPadding = 10;
        table.CellSpacing = 0;
        lblBody.Controls.Add(table);
    }
}
From this setup (small .aspx file, only one .aspx file) I get different advantages. It is very easy to deploy the web site since I only have to manage the source files offline; they are compiled to only one assembly, and furthermore I have only one .aspx file through which the entire site is run through.

I think it is possible this way even to do the events since when you try and look at the html source after the page has been shown in the browser the form is present and the structure is intact.

Jacob.
 
Old October 9th, 2003, 01:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jubii . Thanks for all your time.

I finally made it work, thanks to our correspondance! Here is what I did... I moved one line of code...
Code:
internal override void Initialize()
{        
    if((userInterface = LoadUI()) != null)
    {
        userInterface.Page = this.Page;
        userInterface.CreateUI(this.uiid);
        if(!this.Page.IsPostBack)
        {
            database = new OCMSdatabase(OCMSDatabaseSource.UI);
            database.GetValuesSP(ref reader, "UserInterfaceInfo " + Convert.ToString(this.uiid), uiData);
            this.PageDescription = (uiData[1] != DBNull.Value)? uiData[1].ToString(): "[error]";
        }
    }
    else
    {
        Page.Session.Abandon();
        Page.Response.Redirect("main.aspx");
    }
}
... namely the line of the CreateUI, since it has to create the UI again when it is postback so that it is able to know the events, and then I removed the old line...
Code:
userInterface.Submit();
In the OCMSui I declared the methods/commands for the buttons and I also assigned the EventHandlers in here!

Thanks :)

Jacob.
 
Old October 9th, 2003, 01:14 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Aha! Congrats.

One question, if your ASPX only has the page directive, is you final HTML correct? That is, if you only add the HtmlForm to the page, are you missing <html>, <head> and <body>?

Peter
 
Old October 9th, 2003, 01:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!

The HtmlForm is not the only thing I have added. When I started developing the system, which is a Content Management System (sounds expensive, right? but actually for my own amusement ), I defined a series of fields which should be present on each page, such as Menu, Foot, Body, Head, Side etc. (The Body and Head here is not the HTML body or head).

When I had defined these I was able to make a user control (.ascx) for each of the page types I have got. On these pages the defined fields are present at the places where I want them. The HTML tags BODY, HEAD, HTML etc. can be defined here.

So what I actually got is an .ascx file for the page types in my system, and these are not too complicated all though the cover the entire page from the <HTML> tag to the </HTML> tag. They just hold about 8 fields which I fill up run-time.

Well, now I guess I have got experience with Events aswell. Nice to have forums and people willing to answer :)! Thanks!

Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
form submission...help!? mdbrueckner ASP.NET 2.0 Basics 1 September 19th, 2007 06:16 PM
Extending HtmlForm to render valid HTML rdove84 ASP.NET 1.0 and 1.1 Professional 0 March 8th, 2007 06:13 PM
Stopping frequent submission rajuru Beginning PHP 1 August 20th, 2004 09:56 AM
Simple Form Submission Maxood Beginning PHP 3 July 17th, 2004 06:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.