2
votes

I am playing around and trying to learn silverlight4. I have an existing asp.net page with and area of 600 * 400px available for my silverlight form.

My silverlight application has 2 usercontrols. The 1st usercontrol contains a listview of some data, when a user clicks on a list item I display the 2nd usercontrol.

Is it possible from the 2nd usercontrol to call a clientside function within the page so I can have a similar effect as a modal popup?

Any help would be great!!!!

2

2 Answers

1
votes

You should derive your second control from ChildWindow (and make a search on the web for examples of using ChildWindow). This control is designed to deliver this modal pattern you are after.

1
votes

You can create the modal effect by overlaying the page with a div. Here is a tutorial for creating the modal DIV in the HTML/Javascript:

http://raventools.com/blog/2911/create-a-modal-dialog-using-css-and-javascript

Once you it set up, whenever you wish to trigger it, simply use the DOM interaction from Silverlight to fire the overlay:

Html.Window.Invoke("overlay");