ASP.NET Web Controls >> Panel Server Control...

by spai » Wed, 27 Aug 2003 05:22:32 GMT

Hello there,

I have a Panel and I have created checkboxes dynamically and added it
to the panel.

The code is as below:

foreach (...)
{
My_Roles = new CheckBox();
My_Roles.ID = my_role.Name;
My_Roles.Text = my_role.Name;
My_Roles.AutoPostBack = true;
Panel1.Controls.Add(My_Roles);
}

The Checkboxes get added one after another, I would like the controls
to be added one below another.

Is there any property of the Panel which needs to be set for the same.

Any suggestions please.

Kind Regards,
Srikanth Pai

ASP.NET Web Controls >> Panel Server Control...

by Ken Cox [Microsoft MVP] » Wed, 27 Aug 2003 10:31:51 GMT


How about inserting a literal control after each checkbox with the literal
control's text value as "<br>"?

--
Microsoft MVPs have a question for *you*: Are you patched against the Worm?
http://www.microsoft.com/security/security_bulletins/ms03-026.asp





Hello there,

I have a Panel and I have created checkboxes dynamically and added it
to the panel.

The code is as below:

foreach (...)
{
My_Roles = new CheckBox();
My_Roles.ID = my_role.Name;
My_Roles.Text = my_role.Name;
My_Roles.AutoPostBack = true;
Panel1.Controls.Add(My_Roles);
}

The Checkboxes get added one after another, I would like the controls
to be added one below another.

Is there any property of the Panel which needs to be set for the same.

Any suggestions please.

Kind Regards,
Srikanth Pai

ASP.NET Web Controls >> Panel Server Control...

by spai » Thu, 28 Aug 2003 06:37:43 GMT


thanks it did work.

Kind Regards,
Srikanth

Similar Threads

1. Panel Controls inside a custom server control in ASP.NET - Asp.Net

2. add shadow to panel control, panel control opacity

Hello,

1. Is there anyway to add shadow to panel control like On Windows Vista, 
each
frame window has a cool shadow  ?

2. Is there anyway to change panel control with background image Opacity?

3. how do i rotate label in 90 degrees  ?

Thanks

3. Runtime adding server controls into Panel - ASP.NET Web Controls

4. server side validation in form using panel controls

Hi

I have a long form - around 80 fields - which i have decided to break up
into
more manageable sections using the <asp:Panel> control.

Basically i have three panels (stages) containing various form elements
which i show
and as the user progresses through the form.

I need to use server side validation (client side is not an option) on some
of the fields in the form
dive used an <asp:RequiredFieldValidator> as an example here.

I cant seem to get the validation to take effect - you'll see the
<asp:RequiredFieldValidator> in <asp:Panel Id="stage1">
as an example - if the user doesn't enter a value of some kind then i'd like
the same stage returned
not allowing the user to bypass it.

Thanks in advance...

Simon Ames

Here's the code.......

<script language="vb" runat="server">
 Sub Page_load
  fnHideAllPanels
  If not IsPostback then
   ' show stage 1 on loading page for first time
   stage1.Visible = True
  End If
 End Sub

 Sub Button_Click (sender As System.Object, e As
system.Web.UI.WebControls.CommandEventArgs)
  If e.CommandName = "move_to_stage_2" Then
   If page.isvalid then
    ' if user has entered a value
    stage2.Visible = True
   Else
    ' if field is empty
    stage1.Visible = True
   End If
  ElseIf e.CommandName = "move_to_stage_3" Then
   stage3.Visible = True
  ElseIf e.CommandName = "move_to_stage_1" Then
   stage1.Visible = True
  End If
 End Sub

 Function fnHideAllPanels
  stage1.Visible = False
  stage2.Visible = False
  stage3.Visible = False
 End Function
</script>

<form runat="server">
 <asp:Panel Id="stage1" RunAt="server" Wrap="">
  <h2>Stage One</h2>
  <asp:RequiredFieldValidator Id="val_username" RunAt="server"
ControlToValidate="username" EnableClientScript="false" Text="enter a
username" />
  <asp:textbox id="username" runat="server"/> * required
  <asp:Button Id="move_to_stage_2" CommandName="move_to_stage_2"
OnCommand="button_click" RunAt="server" Text="next"/>
 </asp:Panel>

 <asp:Panel Id="stage2" RunAt="server" Wrap="">
  <h2>Stage Two</h2>
  <asp:Button Id="move_to_stage_3" CommandName="move_to_stage_3"
OnCommand="button_click" RunAt="server" Text="next"/>
 </asp:Panel>

 <asp:Panel Id="stage3" RunAt="server" Wrap="">
  <h2>Stage Three</h2>
  <asp:Button Id="move_to_stage_1" CommandName="move_to_stage_1"
OnCommand="button_click" RunAt="server" Text="next"/>
 </asp:Panel>
</form>


5. Locking the size of a panel in the Panel Control

6. Composite Control - Panel scrollbars for "absolute" positioned child controls

Hi,

I am developing a composite control in asp.net 2.0 framework. The controls 
(all types like HtmlInputButton, HtmlInputText, HtmlInputTextArea) I place 
or add to the controls collection of my composite control, all have the 
position style as "absolute". (My requirement is such that those child 
controls have to be absolutely positioned.)

But when I place this composite control in one of the containers like Panel 
control, which will add the scrollbars automatically to my absolutely 
positioned and rendered HTML controls on the composite control. When I do 
this, I find all the controls with "absolute position" have been rendered 
outside of the container Panel control on the aspx page. I guess this is 
because my child controls are absolutely positioned. Am I correct?

I want to scroll through in the absolutely positioned controls in a page, 
what container control should I be using to achieve this? Or how should I 
make use of Panel control to achieve this scrolling visual behaviour?

Regards,
Parag. 


7. How: Place child controls on the Panel control? - ASP.NET Web Controls

8. placing controls within panel control

How do you set the position of controls that you drag into a panel control?
Anything that I drag in there locks to the upper left corner.  I can't set
x/y coords any way that I can find.

Thanks.