Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: how do I pass a string to a webcontrol ?

Reply
Thread Tools

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

 
 
Steve C. Orr, MCSD
Guest
Posts: n/a
 
      08-20-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
THY
Guest
Posts: n/a
 
      08-20-2003
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" <(E-Mail Removed)> wrote in message
news:OqWt%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
 
Steve C. Orr, MCSD
Guest
Posts: n/a
 
      08-20-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:OqWt%(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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
> > >
> > >

> >
> >

>
>



 
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
Custom webcontrol that references another webcontrol Fabricio ASP .Net Building Controls 0 09-21-2005 02:55 AM
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM
Re: how do I pass a string to a webcontrol ? Kevin Spencer ASP .Net 2 08-20-2003 09:11 PM



Advertisments