HELP - Using UIP App. Block for .aspx Pages that Contain .ascx User Controls

P

Peter Jackson

I'm using v2 of the UIP App. Block. I've created all my .aspx pages, all of which contain .ascx user controls. The .ascx user controls provide the standard server controls (i.e., LinkButtons, etc.) for the user to navigate the site and perform their tasks. None of the site's actual functionality is contained in the .aspx pages--they're just kinda containers for all the .ascx user controls.

So, I'm to the point in the UIP App. Block where I need to make each ..aspx page inherit from Microsoft.ApplicationBlocks.UIProcess.WebFormView. This is easy enough. However, as I mentioned above, my controls to actually do the task(s) are in the .ascx user controls. Thus, my .ascx user controls cannot access the controller.

How can I solve this problem?

..aspx pages, by default inherit from System.Web.UI.Page, and this is easily replaced. However, .ascx user controls inherit from System.Web.UI.UserControl. Can I simply replace System.Web.UI.UserControl with Microsoft.ApplicationBlocks.UIProcess.WebFormView for my .ascx user controls similar to how the .aspx pages are handled?

Or, is there another solution to this problem?

Thanks.
 
H

Holger (David) Wagner

Hi Peter,

Peter said:
I'm using v2 of the UIP App. Block. I've created all my .aspx pages,
all of which contain .ascx user controls. The .ascx user controls
provide the standard server controls (i.e., LinkButtons, etc.) for the
user to navigate the site and perform their tasks. None of the site's
actual functionality is contained in the .aspx pages--they're just kinda
containers for all the .ascx user controls.

So, I'm to the point in the UIP App. Block where I need to make each
.aspx page inherit from
Microsoft.ApplicationBlocks.UIProcess.WebFormView. This is easy
enough. However, as I mentioned above, my controls to actually do the
task(s) are in the .ascx user controls. Thus, my .ascx user controls
cannot access the controller.

How can I solve this problem?

I've just started evaluating UIP2.0, but maybe I still have a good
solution: look into the source code of the UIP and find out how
WebFormView is implemented. I'm pretty sure that you can make your own
WebUserControlView or something like that, and use that for your
controls... while WebFormView inherits from Page, your new class would
inherit from UserControl, and there you go (I'm not in the code right
now, but it may be that this is the only change you'll have to make).

kind regards,
david
 
H

Holger (David) Wagner

Re-hi Peter,
I've just started evaluating UIP2.0, but maybe I still have a good
solution: look into the source code of the UIP and find out how
WebFormView is implemented. I'm pretty sure that you can make your own
WebUserControlView or something like that, and use that for your
controls... while WebFormView inherits from Page, your new class would
inherit from UserControl, and there you go (I'm not in the code right
now, but it may be that this is the only change you'll have to make).

Oh, another solution (maybe simpler): you can access the Page
(parentpage or something like that) from your ascx-controls, cast them
to WebFormView and there you go... I guess the "WebUserControlView"
solution is more elegant, though...

kinda regards,
david
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top