<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Re: Interaction between Silverlight controls</title><link>http://forums.silverlight.net/forums/thread/54345.aspx</link><pubDate>Tue, 20 May 2008 15:26:38 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:54345</guid><dc:creator>ladito9482</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/54345.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=54345</wfw:commentRss><description>&lt;p&gt;Thanks Jabb, &lt;/p&gt;
&lt;p&gt;Due to your excelent response&amp;nbsp;I&amp;#39;m reading &lt;strong&gt;Walkthrough: Calling Managed Code from Client Script&lt;/strong&gt; now &lt;img src="http://silverlight.net/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;
&lt;p&gt;Thanks !!&lt;/p&gt;</description></item><item><title>Re: Interaction between Silverlight controls</title><link>http://forums.silverlight.net/forums/thread/54340.aspx</link><pubDate>Tue, 20 May 2008 15:05:08 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:54340</guid><dc:creator>Jabb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/54340.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=54340</wfw:commentRss><description>&lt;p&gt;If you want to get the text from the textbox and then add it to the grid, you have to add scriptable functions in the Silverlight code to do so and then call those methods from JavaScript.&lt;/p&gt;&lt;p&gt;Unless you *reaaaally* have a requirement for this kind of architecture, I would advise against it. You decrease your performance and at the same time increase your code and architecture complexity by running components in separate plugins and hooking them together with JavaScript when they should all be running under the same plugin - this is analogous to making a Windows program with a Textbox, another with a Grid, a third with a Button, and making them talk to each other via DCOM. Yes, you can do it, but I pity the fool who has to maintain it down the road &lt;img src="http://silverlight.net/emoticons/emotion-5.gif" alt="Wink" /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Interaction between Silverlight controls</title><link>http://forums.silverlight.net/forums/thread/54337.aspx</link><pubDate>Tue, 20 May 2008 14:49:17 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:54337</guid><dc:creator>ladito9482</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/54337.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=54337</wfw:commentRss><description>&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;Hi all,&lt;/font&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;My idea&amp;nbsp;is to use Silverlight controls in&amp;nbsp;my aspx. Perhaps this&amp;nbsp;is not the way Silverlight should be&amp;nbsp;used but I think It could be&amp;nbsp;an interesting feature for ASP.NET.&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;I`ve an&amp;nbsp;ASP.NET Web Page&amp;nbsp;which have&amp;nbsp;three&lt;/font&gt;&amp;nbsp;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;asp&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Silverlight&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; controls. One have&amp;nbsp;a textbox,&amp;nbsp;the other is a&amp;nbsp;grid and the tirdth is a button.&amp;nbsp;I use the same .xap&amp;nbsp;an I pass the type of the control I want to load in the InitParameters. Then in the &lt;font size="2"&gt;Application_Startup&lt;/font&gt;&amp;nbsp;I create the control depending on the parameters (This way was expained in&amp;nbsp;some post in this forum)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Now I would like to add an item to the grid when the button is clicked. The text of this item comes from the textbox :) &lt;/p&gt;&lt;font size="2"&gt;When the button is clicked I excecute javascript code using:&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt; 
&lt;p&gt;[&lt;/font&gt;&lt;font size="2"&gt;ScriptableMember&lt;/font&gt;&lt;font size="2"&gt;]&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;event&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;EventHandler&lt;/font&gt;&lt;font size="2"&gt; ButtonClicked;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; Boton()&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;InitializeComponent();&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;HtmlPage&lt;/font&gt;&lt;font size="2"&gt;.RegisterScriptableObject(&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;ScriptablePageObject&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;private&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; btn_Click(&lt;/font&gt;&lt;font size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font size="2"&gt;RoutedEventArgs&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (ButtonClicked != &lt;/font&gt;&lt;font size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;ButtonClicked(sender, e);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;and &lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;function&lt;/font&gt;&lt;font size="2"&gt; pluginLoaded(sender,args) {&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; slCtl = document.getElementById(&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;Xaml3&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;); &lt;/p&gt;slCtl.Content.ScriptablePageObject.addEventListener(&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;ButtonClicked&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, jsEventHandler);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;function&lt;/font&gt;&lt;font size="2"&gt; jsEventHandler(sender, args) {&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;alert(&amp;quot;Se pulso el boton&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;The problem I`m facing now is that I`m not able to interact between controls from javascript. For example, get the text from textbox or add values to the grid. &lt;/p&gt;
&lt;p&gt;Is there any solution?&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>