Re: how do I pass a string to a webcontrol ?

Discussion in 'ASP .Net' started by Steve C. Orr, MCSD, Aug 20, 2003.

  1. Just put a public Text property in the code behind of your user control.
    Then set the property from your page, like this:
    MyControl.Text="whatever"

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    --------------------------------
    Hire top notch developers to get your projects done right:
    http://www.able-consulting.com
    --------------------------------


    "THY" <> wrote in message
    news:...
    > Hi,
    >
    > I have a page with few webcontrol, but how do I put a string into the
    > webcontrol ?
    >
    > does webcontrol support features like file.ascx?string1=data&string2=data

    ?
    >
    > thanks
    >
    >
     
    Steve C. Orr, MCSD, Aug 20, 2003
    #1
    1. Advertising

  2. Steve C. Orr, MCSD

    THY Guest

    arggg ... I still don't get it ...

    I mean ...
    in default.aspx

    I dim abc as string
    abc = "testing"


    in my webcontrol1.ascx

    how do I get the abc="string" ?


    or can I do this ?
    my webcontrol1 got a label - label1
    in the aspx, can I type webcontrol1.label1.text = "testing" ?


    thanks

    please help me out, I am a real newbie ...



    "Steve C. Orr, MCSD" <> wrote in message
    news:OqWt%...
    > Just put a public Text property in the code behind of your user control.
    > Then set the property from your page, like this:
    > MyControl.Text="whatever"
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > http://Steve.Orr.net
    > --------------------------------
    > Hire top notch developers to get your projects done right:
    > http://www.able-consulting.com
    > --------------------------------
    >
    >
    > "THY" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I have a page with few webcontrol, but how do I put a string into the
    > > webcontrol ?
    > >
    > > does webcontrol support features like

    file.ascx?string1=data&string2=data
    > ?
    > >
    > > thanks
    > >
    > >

    >
    >
     
    THY, Aug 20, 2003
    #2
    1. Advertising

  3. As a simple example, you could put something like this in your user
    control's code behind:

    Public Sub MySub (s as string)
    'do something with the string value
    End Sub

    Then in your page's code behind put this:
    MyControl.MySub("some text")

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    --------------------------------
    Hire top notch developers to get your projects done right:
    http://www.able-consulting.com
    --------------------------------



    "THY" <> wrote in message
    news:...
    > arggg ... I still don't get it ...
    >
    > I mean ...
    > in default.aspx
    >
    > I dim abc as string
    > abc = "testing"
    >
    >
    > in my webcontrol1.ascx
    >
    > how do I get the abc="string" ?
    >
    >
    > or can I do this ?
    > my webcontrol1 got a label - label1
    > in the aspx, can I type webcontrol1.label1.text = "testing" ?
    >
    >
    > thanks
    >
    > please help me out, I am a real newbie ...
    >
    >
    >
    > "Steve C. Orr, MCSD" <> wrote in message
    > news:OqWt%...
    > > Just put a public Text property in the code behind of your user control.
    > > Then set the property from your page, like this:
    > > MyControl.Text="whatever"
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > http://Steve.Orr.net
    > > --------------------------------
    > > Hire top notch developers to get your projects done right:
    > > http://www.able-consulting.com
    > > --------------------------------
    > >
    > >
    > > "THY" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > I have a page with few webcontrol, but how do I put a string into the
    > > > webcontrol ?
    > > >
    > > > does webcontrol support features like

    > file.ascx?string1=data&string2=data
    > > ?
    > > >
    > > > thanks
    > > >
    > > >

    > >
    > >

    >
    >
     
    Steve C. Orr, MCSD, Aug 20, 2003
    #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. Kevin Spencer

    Re: how do I pass a string to a webcontrol ?

    Kevin Spencer, Aug 20, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    383
    Kevin Spencer
    Aug 20, 2003
  2. Guest
    Replies:
    2
    Views:
    756
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    220
    Luis Ramírez
    Jul 6, 2004
  4. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    214
    Kasabaarde Sumta
    Dec 13, 2004
  5. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    204
    Fabricio
    Sep 21, 2005
Loading...

Share This Page