Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: ocean10000
basically i'm developing my own cms in ASP.NET this has proven to be a huge learning curve, i have done several full scale CMS projects in PHP (not PHP OOP). so its taken abit to think in the altered manner that is required.
However the system currently works as follows:
User hits homepage - default boltons and modules are fired.
user hits a link to go to a content module page.
the url is apended i.e:
default calls the site class, splits out the url.
default then calls the content module passing in the pageid.
content code is called via Server.Execute();
content module creates its own site class for specific tasks.
now the default module can write to the page header, the site class holds a get/set method to get and write the page header.
however heres my issue,
default creates an instance of site
content creates an instance of site
each write to there own instance of site. so only one will show the correct title, which happens to be default as it sets the page title at the end of the page_load method.
i'm currently looking for a simple and efficient method of multiple modules and boltons reading and writing to the same page title via a method in the site class.
i've looked at XML (it worked) but thats a cop-out IMO, i've thought about using a session varible, that would work (not tested as currently sat at work so no where near my home pc)
So can anyone point me in the right direction at all?
Thanks for reading"
You really should look at doing whatever you want to do without using Server.Execute.
To set the page title, you need to set the Page.Title property. If you are doing this within a control, you can access this via...
basically default loads and runs all modules via whatever is in the query string, bolt ons are also loaded the same as modules but instead of query string thats down to site config/module config.
i'm setting the site up kind of like plug and play, drop the module in and its ready to use on default conifiguration.
thanks for the Page.Title property, i knew of that.
Currently, with the way i've built the system so far, a session varible would probably be the best answer, to fit my model, however, i'd like to avoid that.
so if there is a better solution to this without having to directly link to the modules/boltons, please point me in the right direction.
You're going to have to explain what you mean by "bolt-ons" and "modules". These are not standard terms in the programming world. You need to explain what these things are before I can understand what you're trying to do.
a Bolt on in this case is an addition to a page, a login box enclosed in div tags, this bolts onto the page without affecting other parts just extending functionality.
a module is the main purpose of that section of the site.
i.e. a module could be a ecommerce system or a blog or a news system etc.
a bolton could be a login box with user statistics.
so if a user links to default.aspx?content&pgid=1
they could see the terms and conditions page.
but if they link to
they could see the ecommerce module, displaying all the tops in page 2.
a module holds all the logic, configs,images etc that its requires. default.aspx just simply points to it. The module then access's any of the classes that give access to site features, themes, users, groups etc.
i may be going at this all the wrong way, i've come from a php background with some minor OOP. So for me this is a on going project that will fully intregrate me into .net etc.
As stated i am very much learning as i go along, well i stumbled across a tutorial on using class Current, and storing it in a session varible (might not be the best solution) but by doing this i have been able to call the same class, without defining a new one.
which has allowed each page to be execute the ability to access the same varibles that i am working with, meaning i am able to alter the title without an issue.
Thanks for all the help provided!