IsPostBack value incorrect using Server.Transfer in Front Controller plus Visual Inheritance

G

Guest

I am going through the front controller http://msdn.microsoft.com/library/d...s/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer occurs. I get invalid IsPostBack results which I believe can fixed using the patch in KB:821156. How do I get this patch?

Another question in the same pattern is when using LoadConrol to load a .ascx file I get "maps to another application, which is not allowed" error which is because the file I have is truly in another application. The problem is this to use the design pattern above it is not useful if I cannot load a control in another application but can infact load a page from another site.

Suppose I had three applications shown below. I only want to have files in the applications that are different from each other (Visual Inheritance). I know, I know you cant inherit a html page, yea, yea, yea read on. Lets assume that Application1 is our base application and all other applications inherit from it. For example Application1 login.aspx, Application2 login.aspx are different from each other.

IIS
|
|-Application1
| |
| |-default.aspx
| |-mycontrol.ascx
| '-login.aspx
|
|-Application2
| |
| '-default.aspx
|
'-Application3
|
'-login.aspx

Using the design pattern I can load default.aspx from Application1 using Server.Transfer when the user goes to http://localhost/Application3/default.aspx because I have an HttpHandler which says if the user attempts to access Application3/*.aspx transfer them to Application1/default.aspx if Application3 does not contain the requested *.aspx page. This in fact works quite nicely.

However if Application1's default.aspx says to LoadControl("mycontrol.ascx") I get the "maps to another application, which is not allowed" error which in fact is also true BUT if I can Server.Transfer to another page then I should be able to load a control that is in the same directory as that page "Another application" or not. It appears that even though the pattern says in can implement a model-view-controller it doesn't do so well with the "view" part.

I attempted to trick IIS into thinking that the control is in a virtual directory under Application3 but this only works to a certain extent. If I want to override mycontrol.ascx in Application3 then I need to remove the virtual directory and copy the structure entirely. This does not meet my first requirement to not duplicate files across applications (and I have a lot of directories). I am two seconds shy from hacking together my own LoadControl but I REALLY don't want to do this.

Now if anyone has a suggestion on an alternative to this I am listening. I am trying to get a visual inheritance methodology to work as we have many customers and don't want to duplicate the entire site for each one. I only want to change pages that are customer specific.

To send me an email
nospamscotchy32000 yahoo com <--- remove nospam and insert a @ and . to mail me.
 
R

Rad

call support and tell them you need the patch from that Q article you
mentioned..


Mr Wizard said:
I am going through the front controller
http://msdn.microsoft.com/library/d...s/dnpatterns/html/ImpFrontControllerInASP.asp
and all works well except when the server.transfer occurs. I get invalid
IsPostBack results which I believe can fixed using the patch in KB:821156.
How do I get this patch?
Another question in the same pattern is when using LoadConrol to load a
..ascx file I get "maps to another application, which is not allowed" error
which is because the file I have is truly in another application. The
problem is this to use the design pattern above it is not useful if I cannot
load a control in another application but can infact load a page from
another site.
Suppose I had three applications shown below. I only want to have files
in the applications that are different from each other (Visual Inheritance).
I know, I know you cant inherit a html page, yea, yea, yea read on. Lets
assume that Application1 is our base application and all other applications
inherit from it. For example Application1 login.aspx, Application2
login.aspx are different from each other.
IIS
|
|-Application1
| |
| |-default.aspx
| |-mycontrol.ascx
| '-login.aspx
|
|-Application2
| |
| '-default.aspx
|
'-Application3
|
'-login.aspx

Using the design pattern I can load default.aspx from Application1 using
Server.Transfer when the user goes to
http://localhost/Application3/default.aspx because I have an HttpHandler
which says if the user attempts to access Application3/*.aspx transfer them
to Application1/default.aspx if Application3 does not contain the requested
*.aspx page. This in fact works quite nicely.
However if Application1's default.aspx says to
LoadControl("mycontrol.ascx") I get the "maps to another application, which
is not allowed" error which in fact is also true BUT if I can
Server.Transfer to another page then I should be able to load a control that
is in the same directory as that page "Another application" or not. It
appears that even though the pattern says in can implement a
model-view-controller it doesn't do so well with the "view" part.
I attempted to trick IIS into thinking that the control is in a virtual
directory under Application3 but this only works to a certain extent. If I
want to override mycontrol.ascx in Application3 then I need to remove the
virtual directory and copy the structure entirely. This does not meet my
first requirement to not duplicate files across applications (and I have a
lot of directories). I am two seconds shy from hacking together my own
LoadControl but I REALLY don't want to do this.
Now if anyone has a suggestion on an alternative to this I am listening.
I am trying to get a visual inheritance methodology to work as we have many
customers and don't want to duplicate the entire site for each one. I only
want to change pages that are customer specific.
To send me an email
nospamscotchy32000 yahoo com <--- remove nospam and insert a @ and . to
mail me.
 
G

Guest

Thanks for the information. I am still, however, looking for an answer to the problem below. I find it hard to believe no one has attempted this type of model before.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top