User Control Event trapping

N

nashak

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,
 
G

Guest

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/communitie...&p=1&mid=53964a0d-1e9f-4a47-8d4d-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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top