hi dave, here is a quick copy and paste from the docs ;P
To set a property of a user control in a Web Forms page
Select the user control file in Solution Explorer and drag it onto your
page. Note the ID of the user control displayed in the page.
Press F7 to switch from Design view to the code-behind file.
In the Declarations area, add a line to declare the user control. For
example, for a user control of type WebUserControl1 whose ID is myControl1:
' Visual Basic
Public Class MyPage
Inherits System.Web.UI.Page
Protected myControl1 As WebUserControl1
// C#
public class MyPage : System.Web.UI.Page
{
protected WebUserControl1 myControl1;
Note The ID in the code-behind declaration must exactly match the ID for
the user control in Design view.
Now that you have a code declaration for the user control, all of the public
properties, methods, and events of your user control are available, and will
appear in the IntelliSense statement completion dropdowns.
Write code to call methods or set properties of your user control. For
example:
' Visual Basic
myControl1.Visible = True
myControl1.DataBind()
// C#
myControl1.Visible = true;
myControl1.DataBind();
"David J Duryea" <> wrote in message
news:dUjRb.9975$ t...
> Please if anyone can help, it would be greatly appreciated
>
>
> I have a VB form on a page called create.aspx with some text fields and
> listboxes.
> I also have a control on the form
>
> <%@ Register TagPrefix="UserControl" TagName="Categories"
> Src="/Categories.ascx" %>
>
> The Control Categories.ascx contains 2 listboxes CatID and SubCatID
>
> The create.aspx page posts its values to a stored Proc. However I cannon
> obtain the vaules from the listboxes on Categories.ascx.
>
> I have tried
> Request.Form("CatID")
> CatID.SelectedItems.Value
>
> If anyone can help I would appreciate it.
>
> Thanks in advance.
>
> Dave
>
>
>
|