Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • chris 69 posts 92 karma points
    Oct 30, 2010 @ 01:43
    chris
    0

    Existing aspx, cs and global.asax

    I have a separate module that I would like to add to a currently working umbraco installation. This particular module is actually quite simple, it connects to a sql, do some query, and put it out on tables.

    There are some aspx pages, which has its own cs code files. There are couple cs files in App_code folder, which basically for session and open/close connection to the database.

    There's small couple lines of codes in global.asax for session_start. I googled and read the forum about making it http module, but it doesn't seem to apply to session, only for application start/end.

    How can I integrate all these into an existing umbraco installation? Some forum suggestions said to put all cs in the App_code folder, but this caused application error when browsing the main page of the existing umbraco installation.

  • Harald Ulriksen 207 posts 249 karma points
    Oct 30, 2010 @ 07:33
    Harald Ulriksen
    0

    Hi there,

    depending on the functionality you can either

    • Implement it as xslt extensions
    • Make it into user controls instead of pages
    • Reserve a directory in the umbraco config and use the pages as they are. 

    All these options has advantages and drawbacks. XSLT will let you alter the html separated from the db/session code, but config settings etc. should not be in the xslt file. User controls will give you more control, but you will need to install a package to edit the ascx files.The last option can be very fast for existing pages, but it separates it from the Umbraco backend and you can no longer add the functionality to umbraco pages and templates.

    You should find more info on all of these techniques on the forum, or ask here if you have any further questions,

    Cheers,
    Harald


     

  • Rich Green 2246 posts 4008 karma points
    Oct 30, 2010 @ 09:41
    Rich Green
    0

    The reason you got an error is because there's already an App_Global.asax.dll file in Umbraco/bin directory.

    Delete this file and add your global.asax back, however it's advised not to be in the App_Code directory.

    For further reading check out this thread http://our.umbraco.org/forum/developers/extending-umbraco/2225-Need-to-access-events-in-the-global?p=1

    Basically one of the core team state that the Umbraco App_Global.asax.dll doesn't actually do anything so can be safely removed.

    Then with regards to using your existing cs code, you can implement it as above.

    HTH

    Rich

     

     

  • chris 69 posts 92 karma points
    Oct 30, 2010 @ 23:30
    chris
    0

    If I reserved this as a separate directory, this probably wouldn't go along with the rest of the site. I might go with converting the code behind as a user control. As for deleting the global asax dll, I also read from the forum that it should be done from version 4.5 and up. I'm currently using 4.0.4.2. There isn't any straight forward method to do this, so it seems.

     

Please Sign in or register to post replies

Write your reply to:

Draft