<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.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>ASP.NET AJAX Discussion and Suggestions</title><link>http://forums.asp.net/1007.aspx</link><description>This forum is the place for ASP.NET AJAX 'getting started' questions, general questions that don't fit in one of the other forums about AJAX </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1782617.aspx</link><pubDate>Mon, 02 Jul 2007 11:11:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1782617</guid><dc:creator>Jonathan Shen – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1782617.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1782617</wfw:commentRss><description>&lt;p&gt;hi offwhite,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&amp;nbsp; for your solution!&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1781076.aspx</link><pubDate>Sat, 30 Jun 2007 20:28:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1781076</guid><dc:creator>offwhite</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1781076.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1781076</wfw:commentRss><description>&lt;p&gt;I was able to create a working sample project using the RegisterScriptBlock method in the Page_Load. I have posted the sample project with a zip download here...&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.offwhite.net/AjaxSample/Default.aspx"&gt;http://www.offwhite.net/AjaxSample/Default.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1778393.aspx</link><pubDate>Thu, 28 Jun 2007 21:44:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1778393</guid><dc:creator>offwhite</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1778393.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1778393</wfw:commentRss><description>&lt;p&gt;I am not sure that will work but I can put together a test website tonight to try it out. I will post the page here.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1776858.aspx</link><pubDate>Thu, 28 Jun 2007 07:59:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1776858</guid><dc:creator>stmarti</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1776858.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1776858</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;For this problem maybe I would start with the followings:&lt;/p&gt;&lt;p&gt;- if only one usercontrol visible/used at the same time,&amp;nbsp; with&amp;nbsp; &lt;a href="http://ajax.asp.net/docs/mref/M_System_Web_UI_ScriptManager_RegisterStartupScript_5_d03cd23f.aspx"&gt;RegisterStartupScript(Control, Type, String, String, Boolean)&lt;/a&gt; set the shared control specific js variables when the control loaded, maybe that enough.&lt;/p&gt;&lt;p&gt;- if more than one usercontrol visible at the same time, convert the shared js variables to arrays, populate/expand the array with the control specific data when the control loaded. Of course modify all the shared js functions to detect automatically from which usercontrol are called (travelling the dom tree etc.)&lt;/p&gt;&lt;p&gt;- both solution should work with or without updatepanels&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What do you think?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1776253.aspx</link><pubDate>Wed, 27 Jun 2007 23:11:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1776253</guid><dc:creator>offwhite</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1776253.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1776253</wfw:commentRss><description>&lt;p&gt;I appreciate these responses but they just are not sufficient for the problem. I cannot get any Javascript from the second view to affect the page when it is activated within the UpdatePanel. You cannot register a script either. I have been doing that for the user controls for regular behavior and want a way to make it work within the UpdatePanel.&amp;nbsp;&lt;/p&gt;&lt;p&gt;And for placing data into an input field also presents a catch-22 scenario. I need to know the ID of the input field in order to get to it so that I can interpret the data. The way the UpdatePanel works there is really no way to determine which control is active or if I later use a databound control which may include many input fields. It does not seem there is a solid way to this in a standard ASP.NET way.&lt;/p&gt;&lt;p&gt;What I think I will have to do is get more aggressive with custom Javascript and create my own mechanisms to know what view is active and what is being updated and when. I just do not think there is a way to make it as fluid as it can be with the server-side code which is able to deal with the hierarchy of the controls. It seems that the UpdatePanel does not have any way of addressing nested controls.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1776040.aspx</link><pubDate>Wed, 27 Jun 2007 20:12:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1776040</guid><dc:creator>KaziManzurRashid</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1776040.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1776040</wfw:commentRss><description>&lt;p&gt;You should use the ScriptManager various methods for complex script injecting. Alternatively&amp;nbsp; for simple Control ID injection i think the following is more compact:&lt;/p&gt;
&lt;p&gt;var aButton = $get(&amp;#39;&amp;lt;% = btnA.ClientID %&amp;gt;&amp;#39;);&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1775975.aspx</link><pubDate>Wed, 27 Jun 2007 19:45:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1775975</guid><dc:creator>stmarti</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1775975.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1775975</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;Have you tried one of the RegisterXXXScriptYYY method of the&amp;nbsp;&lt;a href="http://ajax.asp.net/docs/mref/T_System_Web_UI_ScriptManager.aspx"&gt;
								ScriptManager Class&lt;/a&gt;?&lt;/p&gt;&lt;p&gt;&lt;a href="http://ajax.asp.net/docs/mref/M_System_Web_UI_ScriptManager_RegisterClientScriptBlock_5_d03cd23f.aspx"&gt;RegisterClientScriptBlock(Control, Type, String, String, Boolean)&lt;/a&gt; maybe? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1775943.aspx</link><pubDate>Wed, 27 Jun 2007 19:29:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1775943</guid><dc:creator>paul.vencill</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1775943.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1775943</wfw:commentRss><description>&lt;p&gt;One option is to not use inline javascript at all (a best practice anyway...).&lt;/p&gt;
&lt;p&gt;In the onLoaded event of the pagerequestmanager you can set up a function to run that will set up your variables for you, e.g.:&lt;/p&gt;
&lt;p&gt;var inputs = document.getElementsByTagName(&amp;#39;INPUT&amp;quot;);&lt;/p&gt;
&lt;p&gt;for (var i=0,i&amp;lt;inputs.length;i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(inputs[i].type == &amp;#39;TEXT&amp;#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; evaluateInput(inputs[i]);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;. . . &lt;/p&gt;
&lt;p&gt;function evaluateInput(input){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // perform logic to map your input to whatever variable you need them to map to.&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a dozen ways to skin this cat, lmk what you&amp;#39;re trying to do.&amp;nbsp; &lt;/p&gt;</description></item><item><title>Javascript in a UpdatePanel?</title><link>http://forums.asp.net/thread/1775570.aspx</link><pubDate>Wed, 27 Jun 2007 15:55:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1775570</guid><dc:creator>offwhite</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1775570.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1775570</wfw:commentRss><description>&lt;p&gt;I have a TabStrip and a MultiView which allows the user to move between two views. The views simply hold onto user controls. Both of these user controls use the UpdatePanel. The parent container holding the MultiView also wraps everything with an UpdatePanel to smooth the transition from one view to another.&lt;/p&gt;&lt;p&gt;Here is my problem. I am using a static Javascript source file that holds all of the custom functions both of the user controls use. But they need to have some variables defined which are set within the user controls. But when the page is first loaded it only shows the first view in the MultiView. As a result it only emits the Javascript for that user control. When the second view is shown it does not get the Javascript it needs which is a part of the user control.&lt;/p&gt;&lt;p&gt;What I would like to know is how to emit Javascript through an UpdatePanel. There has to be a way to get my data across. This bit of code is inline Javascript that takes values like TextBox1.ClientID which is set to a Javascript variable. That variable is used in the static source file. The static source file makes it much easier to debug. But I am trying to ensure the user controls work independently as well as within the MultiView and UpdatePanel structure.&lt;/p&gt;&lt;p&gt;What can I do to make sure the Javascript variables are set for the second view?&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>