Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > C'tor of WebUserControl

Reply
Thread Tools

C'tor of WebUserControl

 
 
=?Utf-8?B?T3Jlbg==?=
Guest
Posts: n/a
 
      10-16-2005
Hello everyone...

I have a simple WebUserControl with Button and TextBox on it. Webform1.aspx
contains this WebUserControl.
How can I create my own C'tor for this WebUserControl - I mean when I run
Webform1.aspx I want to send data to the UserControl (fill Textbox1.Text).

any samples ?

thanx,
Oren
 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      10-16-2005
Oren:
Check out http://openmymind.net/index.aspx?documentId=9

you can't use anything like a constructor because controls aren't
instantiated like normal classes. If you want to set values, you create
properties in the user control and read them in Page_Load of the user
control.

Karl

--
-->
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
"Oren" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello everyone...
>
> I have a simple WebUserControl with Button and TextBox on it.
> Webform1.aspx
> contains this WebUserControl.
> How can I create my own C'tor for this WebUserControl - I mean when I run
> Webform1.aspx I want to send data to the UserControl (fill Textbox1.Text).
>
> any samples ?
>
> thanx,
> Oren



 
Reply With Quote
 
 
 
 
=?Utf-8?B?T3Jlbg==?=
Guest
Posts: n/a
 
      10-17-2005
Karl,

How can I call to a Function/Property and send data dynamically to the
UserControl ? I mean Instead (look at CurrentPage):
<Result:Header id="rh" CurrentPage="1" RecordsPerPage="2" runat="server" />
To do:
<Result:Header id="rh" CurrentPage="GetText()" RecordsPerPage="2"
runat="server" />

GetText() -> on the Webform...

(code was taken from your link below...)
http://openmymind.net/index.aspx?documentId=9

thanx,
Oren
"Karl Seguin" wrote:

> Oren:
> Check out http://openmymind.net/index.aspx?documentId=9
>
> you can't use anything like a constructor because controls aren't
> instantiated like normal classes. If you want to set values, you create
> properties in the user control and read them in Page_Load of the user
> control.
>
> Karl
>
> --
> -->
> MY ASP.Net tutorials
> http://www.openmymind.net/
> http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
> "Oren" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello everyone...
> >
> > I have a simple WebUserControl with Button and TextBox on it.
> > Webform1.aspx
> > contains this WebUserControl.
> > How can I create my own C'tor for this WebUserControl - I mean when I run
> > Webform1.aspx I want to send data to the UserControl (fill Textbox1.Text).
> >
> > any samples ?
> >
> > thanx,
> > Oren

>
>
>

 
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
HowTo clear all ViewState from a WebUserControl without doing a PostBack ? Andreas Klemt ASP .Net 3 08-28-2003 05:23 AM
Re: can NOT change the position of a WebUserControl on page Rick Spiewak ASP .Net 1 07-24-2003 10:16 PM
can NOT change the position of a WebUserControl on page (GridLayout is set) Christian ASP .Net 0 07-21-2003 08:51 AM
Viewstate of WebUserControl does NOT work Christian ASP .Net 2 07-15-2003 03:48 PM
Re: click event does not occur in webusercontrol Simon Storr ASP .Net 0 07-14-2003 09:52 AM



Advertisments