UserControl Property Setting

Discussion in 'ASP .Net' started by MS News \(MS ILM\), Jul 4, 2004.

  1. hello all,


    I place a usercontrol on my web page, then in code behind I add one
    attribute

    employee.Attributes.Add("empId", "123")
    My usercontrol is not getting this value at all

    But:
    If I add the attribute directly into my aspx page everything works
    <uc1:emp id="employee" runat="server" empid="123" ></uc1:emp>

    No errors.

    I must be missing something here.

    How do I pass or set the values of my usercontrol

    Do I need to add the UserControl Dynamically and set its properties..etc..

    Thanks for any help

    SA
    MS News \(MS ILM\), Jul 4, 2004
    #1
    1. Advertising

  2. "MS News (MS ILM)" <> wrote in message
    news:...
    > hello all,
    >
    >
    > I place a usercontrol on my web page, then in code behind I add one
    > attribute
    >
    > employee.Attributes.Add("empId", "123")
    > My usercontrol is not getting this value at all
    >
    > But:
    > If I add the attribute directly into my aspx page everything works
    > <uc1:emp id="employee" runat="server" empid="123" ></uc1:emp>
    >
    > No errors.
    >
    > I must be missing something here.
    >
    > How do I pass or set the values of my usercontrol


    employee.empid = 123
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jul 4, 2004
    #2
    1. Advertising

  3. No, for some reason I can not see my employee.empid
    I have empid as public in my UserControl but still is not visible from my
    aspx page
    why??

    Thanks

    "John Saunders" <> wrote in message
    news:...
    > "MS News (MS ILM)" <> wrote in message
    > news:...
    > > hello all,
    > >
    > >
    > > I place a usercontrol on my web page, then in code behind I add one
    > > attribute
    > >
    > > employee.Attributes.Add("empId", "123")
    > > My usercontrol is not getting this value at all
    > >
    > > But:
    > > If I add the attribute directly into my aspx page everything works
    > > <uc1:emp id="employee" runat="server" empid="123" ></uc1:emp>
    > >
    > > No errors.
    > >
    > > I must be missing something here.
    > >
    > > How do I pass or set the values of my usercontrol

    >
    > employee.empid = 123
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
    MS News \(MS ILM\), Jul 4, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fabiano
    Replies:
    2
    Views:
    597
    =?Utf-8?B?c3Jpbmk=?=
    Jun 3, 2005
  2. kferron
    Replies:
    1
    Views:
    296
    kferron
    Nov 15, 2006
  3. kevin  cline
    Replies:
    2
    Views:
    2,396
    Gilbert Rebhan
    Jul 26, 2008
  4. Nathan Sokalski
    Replies:
    25
    Views:
    1,426
    Nathan Sokalski
    Mar 4, 2010
  5. Alex Maghen

    Design-Time UserControl Property Setting

    Alex Maghen, Jun 5, 2006, in forum: ASP .Net Web Controls
    Replies:
    9
    Views:
    215
    Steven Cheng[MSFT]
    Jun 10, 2006
Loading...

Share This Page