Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Interaction between user controls?

Reply
Thread Tools

Interaction between user controls?

 
 
Jonas
Guest
Posts: n/a
 
      05-06-2004
Hi,

I have a couple of search criteria’s in one web user control (.ascx) and I want to post them do the server and view the result in another web user control on the same .aspx page. Depending on the criteria I will return an arraylist of results. (=I will bind a datagrid.

How can I call a function in another web user control
I don’t want to but the search criteria’s in the cache
I have seen the delegate example on 4guys, but I wonder if there is another way

 
Reply With Quote
 
 
 
 
Michael Tkachev
Guest
Posts: n/a
 
      05-07-2004
Hi,

this sample will show how you can get event from the usercontrol in the
form.

---------- *.ascx -------------
public event EventHandler OnClick; // Public event. It allows you catch
this event on the form.

// This event for a button in the usercontrol.
protected void myClick(object sender, EventArgs e)
{
if(OnClick != null)
OnClick(ItemID, new EventArgs());
}
---------- end *.aspx.cs -------------
---------- *.aspx.cs -------------
protected Controls.Tree Tree1; // It's my usercontrol.

// This methd works when you click buton in the user control
protected void Click_Control(object sender, EventArgs e)
{
// Here must be your code
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.Tree1.OnClick += new System.EventHandler(this.Click_Control);
}
---------- end *.aspx.cs -------------

If you will change this code you will be able to get your solution.

Bye

Michael


"Jonas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a couple of search criteria's in one web user control (.ascx) and I

want to post them do the server and view the result in another web user
control on the same .aspx page. Depending on the criteria I will return an
arraylist of results. (=I will bind a datagrid.)
>
> How can I call a function in another web user control?
> I don't want to but the search criteria's in the cache.
> I have seen the delegate example on 4guys, but I wonder if there is

another way?
>



 
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
Interaction between user controls Lukas Kurka ASP .Net 0 11-23-2006 08:19 PM
interaction between aspx & html page =?Utf-8?B?UHJpeWE=?= ASP .Net 1 10-18-2004 01:08 PM
Interaction between User Controls goalizx Goalizx ASP .Net 1 09-03-2004 05:07 PM
Interaction between 2 different web browsers john ASP .Net 2 12-11-2003 07:43 PM
Interaction between 2 webforms Anita C ASP .Net 1 12-05-2003 12:53 PM



Advertisments