Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > WebPart and WebPartZones Usage

Reply
Thread Tools

WebPart and WebPartZones Usage

 
 
karthick
Guest
Posts: n/a
 
      03-22-2006
I am using the following layout for my pages.

<asp:content>
<asp:Wizard>
</asp:Wizard>
<HeaderTemplate>
<asp:WebPartZone>
<ZoneTemplate>
<asp:gridview />
</ZoneTemplate>
</asp:WebPartZone>

</HeaderTemplate>

<WizardSteps>
<%-- Method1 -->
<asp:WizardStep>
<asp:WebPartZone>
<ZoneTemplate>
<UC:usercontrol />
</ZoneTemplate>
</asp:WebPartZone>
</asp:WizardStep>

<%-- Method2 -->
<asp:WizardStep>
<asp:WebPartZone>
<ZoneTemplate>
<aspanel>
-- All the controls in the user control go here directly
</aspanel>
</ZoneTemplate>
</asp:WebPartZone>
</asp:WizardStep>
</WizardSteps>
</asp:content>

I have the above design in one of my pages.
I need to get/set values, properties for my controls inside the
webpartzone.

Problem1: accessing the controls inside the webpartzones is pain in the
neck.

problem2: if i try to use a generic findcontrol and pass the
wizard.controlscollection, webpartzone does not have the same behaviour
for HasControls property. so i have to go into the zone.webparts
collection and iterate under each webpart to get to my control.
this will be a killer as far as performance is concerned.

I am trying to make full use of web parts. Is there a easier way to
"find" controls in wizard and in webpartZones? (both method1 and
method2). Can webPartZones be used this way?

any comments and suggestions for this approach are welcome. thanks!

 
Reply With Quote
 
 
 
 
DWS
Guest
Posts: n/a
 
      03-26-2006
karthick,
Override the wizzard find control method.
Public Overrides Function FindControl(ByVal id As String) As
System.Web.UI.Control
If id = "DWSwz" Then
Return zone
Else
Return MyBase.FindControl(id)
End If
End Function

Good Luck
DWS


"karthick" wrote:

> I am using the following layout for my pages.
>
> <asp:content>
> <asp:Wizard>
> </asp:Wizard>
> <HeaderTemplate>
> <asp:WebPartZone>
> <ZoneTemplate>
> <asp:gridview />
> </ZoneTemplate>
> </asp:WebPartZone>
>
> </HeaderTemplate>
>
> <WizardSteps>
> <%-- Method1 -->
> <asp:WizardStep>
> <asp:WebPartZone>
> <ZoneTemplate>
> <UC:usercontrol />
> </ZoneTemplate>
> </asp:WebPartZone>
> </asp:WizardStep>
>
> <%-- Method2 -->
> <asp:WizardStep>
> <asp:WebPartZone>
> <ZoneTemplate>
> <aspanel>
> -- All the controls in the user control go here directly
> </aspanel>
> </ZoneTemplate>
> </asp:WebPartZone>
> </asp:WizardStep>
> </WizardSteps>
> </asp:content>
>
> I have the above design in one of my pages.
> I need to get/set values, properties for my controls inside the
> webpartzone.
>
> Problem1: accessing the controls inside the webpartzones is pain in the
> neck.
>
> problem2: if i try to use a generic findcontrol and pass the
> wizard.controlscollection, webpartzone does not have the same behaviour
> for HasControls property. so i have to go into the zone.webparts
> collection and iterate under each webpart to get to my control.
> this will be a killer as far as performance is concerned.
>
> I am trying to make full use of web parts. Is there a easier way to
> "find" controls in wizard and in webpartZones? (both method1 and
> method2). Can webPartZones be used this way?
>
> any comments and suggestions for this approach are welcome. thanks!
>
>

 
Reply With Quote
 
 
 
 
karthick
Guest
Posts: n/a
 
      04-06-2006
thanks for the reply. i will try that for sure. one thing that nagging
my mind is that using any form of recursion or looping to find a
control is gonna hit performance. just a thought.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
moving webpartzones barry ASP General 0 02-25-2008 03:39 PM
How to constrain webpart movement across WebpartZones? yashgt@gmail.com ASP .Net 0 08-05-2007 02:37 PM
.NET 1.1 WebPart to .NET 2.0 WebPart anars ASP .Net 0 01-07-2007 07:31 PM
How do I restrict webpart usage to a single instance on a page? AHarwood ASP .Net Web Controls 0 09-27-2006 06:11 PM
Create WebPartZones Programmatically tmeynink@gmail.com ASP .Net 0 06-13-2006 08:33 AM



Advertisments