469,926 Members | 1,745 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

User Control Event trapping

Hello,

Following is my scenario:

When I click a button on my aspx page, the panel containing a use
control becomes visible. This user control has a data grid in it. The
user enters some data and clicks OK button on user control. This should
make the panel disappear and a button "Save" to appear on the main
page. i.e Click event on user control to produce 2 things on main page
- make panel.visible=false and button.visible=true

What are the ways to handle this?

Thanks,

Aug 27 '06 #1
1 1018

Hi,

There are several ways 2 handle this.

The best solution is to use Events and Delegates

Use delegates and events to transfer the control from the usercontrol to the
main page. Here is the link for the sample code.
http://www.microsoft.com/communities...d-2ad40ac8085a

or you can do it on the client side using Javascript.

Invoke a javascript function on the OK click event of the User Control
(using okbuttonid.attributes.add("onclick", "OKClicked()").

function OKClicked()
{
document.all("panelid").style.display = 'none';
document.all("savebuttonid").style.display = 'block';
}
Thanks,
Sazid.

"na****@hotmail.com" wrote:
Hello,

Following is my scenario:

When I click a button on my aspx page, the panel containing a use
control becomes visible. This user control has a data grid in it. The
user enters some data and clicks OK button on user control. This should
make the panel disappear and a button "Save" to appear on the main
page. i.e Click event on user control to produce 2 things on main page
- make panel.visible=false and button.visible=true

What are the ways to handle this?

Thanks,

Aug 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by fragget | last post: by
1 post views Thread by Chirag Malvi | last post: by
2 posts views Thread by Stephen Lambie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.