none
Access Server Control via Silverlight

    Question

  • I have button in silverlight, and one Multiview control in aspx page. Is there any way to choose ActiveViewIndex when I click button in Silverlight ?Indifferent I think javascript is not my expected one.

    Thank in advanced!

    BestRgds

    BacNT

    Thursday, October 09, 2008 11:59 AM

Answers

  • One thing you need to be aware of is that by selecting a different view you basically do a post back to submit your current page. When you do this, you discard your current page which contains your Silverlight application. When the new View is back, it reload a new page (even with the same URL). So your Silverlight application will restart. Are you sure this is what you want?


    Thursday, October 09, 2008 10:53 PM

All replies

  • ASP Server control is running on the Server to render the HTML page that to be sent to the Client browser. Silverlight control is running at Client browser after the page is loaded in the browser. You can see there is no way for Silverlight code to access the ASP page's Server code because they don't even exist at the same time at the same machine.

    But most ASP server control render HTML controls or content to the page. If you want to access those HTML element that exist on the same page as the SilverLight application, you can do that. You can access any HTML element or call JavaScript functions by using object/functions in System.Windows.Browser name space.

    If your MultiView control output ActiveViewIndex to the page, you can get it to Silverlight. Or you can have your Server code to write out a InitParameter for the Silverlight Control tag to pass that Index to Silverlight app. 

     

     

     

     

    Thursday, October 09, 2008 2:14 PM
  • Okey, If there is no solution for server side, I choose Javascript way. But I mean when I click button in "Silverlight" Multiview is select ActiveViewIndex, not sending a ActiveViewIndex to "Silverlight", it's hard to do that :(

    Thursday, October 09, 2008 7:50 PM
  • One thing you need to be aware of is that by selecting a different view you basically do a post back to submit your current page. When you do this, you discard your current page which contains your Silverlight application. When the new View is back, it reload a new page (even with the same URL). So your Silverlight application will restart. Are you sure this is what you want?


    Thursday, October 09, 2008 10:53 PM
  • Yes, that what I want. I've tried javascript postback function and it's running ok. Thank for your replies! Best Regards :x! Stick out tongue

    Friday, October 10, 2008 4:02 AM