PDA

Click to See Complete Forum and Search --> : sub main , aspx.net project, is it possible?


persianboy
Nov 15th, 2003, 11:14 AM
hi,

is it possible to have a aspx project with one module file , which is the startup of the project, and several webforms, in the module for example get the query string value and from there depending on program logic decide which webform to show????

i know we can create a aspx project , then redirect to other projects from it, but if what i mentioned is possible it would be much better ( at least in my case ) because the hole thing will be packed together ,and is easy to deploy

thanks,

hellswraith
Nov 15th, 2003, 05:06 PM
No, you can't use a sub main. The reason is the browser has to request an object from the server, this can be a page, image, web service, etc, but it has to be something tangible that it is allowed access to. A module is NOT something the browser is able to get.

Now, the best way to do this, would be to create a custom server control. You can put all your logic in the control, and include the control on each page you build. That would be one way.

Another way would be to use the Global.asax class. This class provides events that could also possibly help you out in this senerio.

persianboy
Nov 15th, 2003, 10:31 PM
thanks, i'll try the custom server control