<?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>Master Pages, Themes and Navigation Controls</title><link>http://forums.asp.net/139.aspx</link><description>Discussions of MasterPages, Themes, and other page-related features. &lt;A href="http://aspadvice.com/SignUp/list.aspx?l=164&amp;amp;c=30" target=_blank&gt;Email List&lt;/A&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Showing the newly added node in asp.net treeview without the need for scrolling</title><link>http://forums.asp.net/thread/2014042.aspx</link><pubDate>Mon, 19 Nov 2007 10:20:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2014042</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2014042.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2014042</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;About how to get the selectednode from the client side, you can try to refer this article: &lt;a class="" href="http://www.codeproject.com/aspnet/ClientSideTreeView.asp"&gt;ASP.NET TreeView Control &amp;amp; the Client&amp;#39;s Browser&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Showing the newly added node in asp.net treeview without the need for scrolling</title><link>http://forums.asp.net/thread/2011436.aspx</link><pubDate>Fri, 16 Nov 2007 18:57:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2011436</guid><dc:creator>Sam964</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2011436.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2011436</wfw:commentRss><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;Thanks for your pointers. I did get how to invoke the script, but for some reason the script doesn&amp;#39;t work..&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;--For some reason elem.value in the below code is&amp;nbsp;empty string..&amp;nbsp;I am using AJAX in this app. Whenever a treenode is selected and it&amp;#39;s value set (by calling node.select() and assigning node.value=somevalue in the server side), why can&amp;#39;t I access that elem by value using&amp;nbsp;javascript after&amp;nbsp;the values are set?&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;font size="2"&gt; treePanel = document.getElementById(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;#39;&amp;lt;%= treePanel.ClientID %&amp;gt;&amp;#39;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; selectedNode = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;#39;&amp;lt;%=XXXXTV.ClientID %&amp;gt;&amp;#39;&lt;/font&gt;&lt;font size="2"&gt; + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;#39;_SelectedNode&amp;#39;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; elem = document.getElementById(selectedNode);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt;(elem != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&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;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;--Below line gives&amp;nbsp;a null value..&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; node = document.getElementById(elem.value); &lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt;(node != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&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;node.scrollIntoView(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;treePanel.scrollLeft = 0;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Thanks a lot!!&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Showing the newly added node in asp.net treeview without the need for scrolling</title><link>http://forums.asp.net/thread/2004890.aspx</link><pubDate>Wed, 14 Nov 2007 03:42:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2004890</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2004890.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2004890</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can call the javascript function after your code runs.&lt;/p&gt;
&lt;p&gt;About how to call JavaScript function from the codebehind, you can check this thread: &lt;a href="http://forums.asp.net/t/1177991.aspx"&gt;http://forums.asp.net/t/1177991.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description></item><item><title>Re: Showing the newly added node in asp.net treeview without the need for scrolling</title><link>http://forums.asp.net/thread/2001798.aspx</link><pubDate>Mon, 12 Nov 2007 15:26:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2001798</guid><dc:creator>Sam964</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2001798.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2001798</wfw:commentRss><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;Thanks for your suggestion. I tried these steps but I am having a few issues.&lt;/p&gt;
&lt;p&gt;I register the script using Page.RegisterStartupScript. But how can I invoke that function? I have to first make sure that the new node is inserted into the db table, which I do on a button click event. Then I pull the nodes once again from the db so that I can select the newly added node. If I add an attribute to onclick of the button, am I guaranteed that first the button click event occurs (and server side code executes)&amp;nbsp;and then finally, the javascript function is invoked?. &lt;/p&gt;
&lt;p&gt;I meant to say, how can I ensure that the javascript function is invoked last?&lt;/p&gt;
&lt;p&gt;Also for some reason, I don&amp;#39;t see the script in the page source. I have&amp;nbsp;user controls on the page and the treeview is in one user control and adding a node functionality is in another user control.&lt;/p&gt;
&lt;p&gt;Can you please get back to me?&lt;/p&gt;
&lt;p&gt;Thanks a lot!!&lt;/p&gt;</description></item><item><title>Re: Showing the newly added node in asp.net treeview without the need for scrolling</title><link>http://forums.asp.net/thread/2000979.aspx</link><pubDate>Mon, 12 Nov 2007 06:22:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2000979</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2000979.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2000979</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can invoke the javascript code after&amp;nbsp;the new nodes added,&amp;nbsp;you can use the Page.RegisterStartupScript Method to call the javascript function. This method allows ASP.NET server controls to emit client-side script blocks in the page.&lt;/p&gt;
&lt;p&gt;The more you can read more in this MSDN article:&amp;nbsp; &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.page.registerstartupscript(VS.71).aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.web.ui.page.registerstartupscript(VS.71).aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description></item><item><title>Showing the newly added node in asp.net treeview without the need for scrolling</title><link>http://forums.asp.net/thread/1998361.aspx</link><pubDate>Fri, 09 Nov 2007 14:55:35 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1998361</guid><dc:creator>Sam964</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1998361.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=1998361</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a treeview in a panel which has a scrollbars&amp;nbsp;property. I allow the user to add new nodes to the tree which adds a new&amp;nbsp;row to the db table. I am able to select the newly added node in the table. But if the newly added node is not in the view area of the user, the user has to scroll down to see the newly added node. Is there a way I can implement it so that the user doesn&amp;#39;t need to scroll to find the node. I want to show the newly added node and pre-scroll it for the user.&lt;/p&gt;
&lt;p&gt;I have&amp;nbsp;got this code..&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; treePanel = document.getElementById(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;#39;&amp;lt;%= treePanel.ClientID %&amp;gt;&amp;#39;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; selectedNode = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;#39;&amp;lt;%=XXXXTV.ClientID %&amp;gt;&amp;#39;&lt;/font&gt;&lt;font size="2"&gt; + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;#39;_SelectedNode&amp;#39;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; elem = document.getElementById(selectedNode);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt;(elem != &lt;/font&gt;&lt;font color="#0000ff" 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;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;font size="2"&gt; node = document.getElementById(elem.value); &lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt;(node != &lt;/font&gt;&lt;font color="#0000ff" 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;alert(node);&lt;/p&gt;node.scrollIntoView(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;treePanel.scrollLeft = 0;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;First of all, I am not sure this code works. If it works,&amp;nbsp;I am not sure where and when should I invoke this code. Can somebody please help?&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>