<?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: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/3286860.aspx</link><pubDate>Fri, 10 Jul 2009 21:46:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3286860</guid><dc:creator>yvhirens</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3286860.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=3286860</wfw:commentRss><description>&lt;p&gt;Hi Alan,&lt;/p&gt;&lt;p&gt;I had same issue with tree node. But did not knew how to extend tree view control to add HTMLAnchor next to each node.&lt;/p&gt;&lt;p&gt;Your code helped me lot to achieve this.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks for posting your code.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;Hiren&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2248567.aspx</link><pubDate>Sat, 22 Mar 2008 15:00:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2248567</guid><dc:creator>alan@gangleri.net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2248567.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2248567</wfw:commentRss><description>&lt;p&gt;I was able to solve this by making the custom control that contains the tree control implement IPostBackEventHandler. Inside my tree node I used the following code to get a handle on the current page and then the containing control:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;Page page = HttpContext.Current.CurrentHandler &lt;span class="kwd"&gt;as&lt;/span&gt; Page;
ClientScriptManager csm = page.ClientScript;
Control mainContent = page.Master.FindControl( &lt;span class="st"&gt;&amp;quot;MainContents&amp;quot;&lt;/span&gt; );
&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;I was then able to register the button click as follows which will cause a post back that is processed server side. &amp;nbsp;&lt;br /&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;writer.AddAttribute( HtmlTextWriterAttribute.Onclick, csm.GetPostBackEventReference( mainContent.FindControl( &lt;span class="st"&gt;&amp;quot;MyTreeView&amp;quot;&lt;/span&gt; ), &lt;span class="st"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt; ) );
writer.RenderBeginTag( HtmlTextWriterTag.Button );
writer.Write( &lt;span class="st"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt; );
writer.RenderEndTag();&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Possibly not the tidiest but it works.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2229754.aspx</link><pubDate>Thu, 13 Mar 2008 05:16:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2229754</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2229754.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2229754</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry.&amp;nbsp; There is seemsly cannot&amp;nbsp;raise the event&amp;nbsp;&amp;nbsp;posted to the server. Because&amp;nbsp;it only can be post to server by inheriting the WebControl class, but the treenode doesnot inherit the webcontrol. The treeview inherits the webcontrol.&lt;/p&gt;
&lt;p&gt;But you can call the client function:&lt;/p&gt;
&lt;p&gt;writer.AddAttribute(HtmlTextWriterAttribute.Onclick, &amp;quot;alert(&amp;#39;Hello&amp;#39;);&amp;quot;);&lt;br /&gt;writer.RenderBeginTag(HtmlTextWriterTag.Button);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2229206.aspx</link><pubDate>Wed, 12 Mar 2008 21:09:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2229206</guid><dc:creator>alan@gangleri.net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2229206.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2229206</wfw:commentRss><description>&lt;p&gt;Thanks again Amanda, I think I&amp;#39;m really making progress with this now just one more question (hopefully). In you sample code you have the line:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Amanda Wang - MSFT:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;writer.AddAttribute(HtmlTextWriterAttribute.Onclick, Page.GetPostBackEventReference(this, &amp;quot;Previous&amp;quot;));&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is inside the TreeNode which does not extend System.Web.UI.WebControls.Control, as far as I&amp;#39;m aware therefore how can you pass &amp;#39;&lt;i&gt;this&lt;/i&gt;&amp;#39; as an argument to GetPostBackEventReference?&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;nbsp; have included my class for you to help advice me.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI;&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web;&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI.WebControls;&lt;br /&gt;&lt;b id="4"&gt;4    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI.HtmlControls;&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;
&lt;b id="6"&gt;6    &lt;/b&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt; MyNamespace&lt;br /&gt;&lt;b id="7"&gt;7    &lt;/b&gt;{&lt;br /&gt;&lt;b id="8"&gt;8    &lt;/b&gt;    &lt;span class="kwd"&gt;public class&lt;/span&gt; MyTreeNode: TreeNode, IPostBackEventHandler&lt;br /&gt;&lt;b id="9"&gt;9    &lt;/b&gt;    {&lt;br /&gt;&lt;b id="10"&gt;10   &lt;/b&gt;
&lt;b id="11"&gt;11   &lt;/b&gt;        &lt;span class="kwd"&gt;#region&lt;/span&gt;&lt;span class="kwdt"&gt; Constructors&lt;/span&gt;
&lt;b id="12"&gt;12   &lt;/b&gt;
&lt;b id="13"&gt;13   &lt;/b&gt;        &lt;span class="kwd"&gt;public&lt;/span&gt; MyTreeNode()&lt;br /&gt;&lt;b id="14"&gt;14   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="15"&gt;15   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="16"&gt;16   &lt;/b&gt;
&lt;b id="17"&gt;17   &lt;/b&gt;        &lt;span class="kwd"&gt;public&lt;/span&gt; MyTreeNode( &lt;span class="kwd"&gt;string&lt;/span&gt; text ) : &lt;span class="kwd"&gt;base&lt;/span&gt;( text )&lt;br /&gt;&lt;b id="18"&gt;18   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="19"&gt;19   &lt;/b&gt;            &lt;span class="kwd"&gt;this&lt;/span&gt;.SelectAction = TreeNodeSelectAction.Select;&lt;br /&gt;&lt;b id="20"&gt;20   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="21"&gt;21   &lt;/b&gt;
&lt;b id="22"&gt;22   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;br /&gt;&lt;b id="23"&gt;23   &lt;/b&gt;
&lt;b id="24"&gt;24   &lt;/b&gt;        #region&lt;/span&gt;&lt;span class="kwdt"&gt; Protected methods&lt;/span&gt;
&lt;b id="25"&gt;25   &lt;/b&gt;
&lt;b id="26"&gt;26   &lt;/b&gt;        &lt;span class="kwd"&gt;protected override void&lt;/span&gt; RenderPostText( HtmlTextWriter writer )&lt;br /&gt;&lt;b id="27"&gt;27   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="28"&gt;28   &lt;/b&gt;            Page page = HttpContext.Current.Handler &lt;span class="kwd"&gt;as&lt;/span&gt; Page;&lt;br /&gt;&lt;b id="29"&gt;29   &lt;/b&gt;            ClientScriptManager csm = page.ClientScript;&lt;br /&gt;&lt;b id="30"&gt;30   &lt;/b&gt;
&lt;b id="31"&gt;31   &lt;/b&gt;            writer.AddAttribute( HtmlTextWriterAttribute.Onclick, csm.GetPostBackEventReference( &lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;, &lt;span class="st"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt; ) );&lt;br /&gt;&lt;b id="32"&gt;32   &lt;/b&gt;            writer.RenderBeginTag( HtmlTextWriterTag.Button );&lt;br /&gt;&lt;b id="33"&gt;33   &lt;/b&gt;            writer.Write( &lt;span class="st"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt; );&lt;br /&gt;&lt;b id="34"&gt;34   &lt;/b&gt;            writer.RenderEndTag();&lt;br /&gt;&lt;b id="35"&gt;35   &lt;/b&gt;
&lt;b id="36"&gt;36   &lt;/b&gt;            writer.AddAttribute( HtmlTextWriterAttribute.Onclick, csm.GetPostBackEventReference( &lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;, &lt;span class="st"&gt;&amp;quot;Next&amp;quot;&lt;/span&gt; ) );&lt;br /&gt;&lt;b id="37"&gt;37   &lt;/b&gt;            writer.RenderBeginTag( HtmlTextWriterTag.Button );&lt;br /&gt;&lt;b id="38"&gt;38   &lt;/b&gt;            writer.Write( &lt;span class="st"&gt;&amp;quot;Next&amp;quot;&lt;/span&gt; );&lt;br /&gt;&lt;b id="39"&gt;39   &lt;/b&gt;            writer.RenderEndTag();&lt;br /&gt;&lt;b id="40"&gt;40   &lt;/b&gt;
&lt;b id="41"&gt;41   &lt;/b&gt;            &lt;span class="kwd"&gt;base&lt;/span&gt;.RenderPostText( writer );&lt;br /&gt;&lt;b id="42"&gt;42   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="43"&gt;43   &lt;/b&gt;
&lt;b id="44"&gt;44   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;br /&gt;&lt;b id="45"&gt;45   &lt;/b&gt;
&lt;b id="46"&gt;46   &lt;/b&gt;        #region&lt;/span&gt;&lt;span class="kwdt"&gt; event handlers&lt;/span&gt;
&lt;b id="47"&gt;47   &lt;/b&gt;
&lt;b id="48"&gt;48   &lt;/b&gt;        &lt;span class="kwd"&gt;public void&lt;/span&gt; RaisePostBackEvent( &lt;span class="kwd"&gt;string&lt;/span&gt; eventArgument )&lt;br /&gt;&lt;b id="49"&gt;49   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="50"&gt;50   &lt;/b&gt;            &lt;span class="kwd"&gt;if&lt;/span&gt; ( &lt;span class="st"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt; == eventArgument )&lt;br /&gt;&lt;b id="51"&gt;51   &lt;/b&gt;            {&lt;br /&gt;&lt;b id="52"&gt;52   &lt;/b&gt;                OnClickDelete( EventArgs.Empty );&lt;br /&gt;&lt;b id="53"&gt;53   &lt;/b&gt;            }&lt;br /&gt;&lt;b id="54"&gt;54   &lt;/b&gt;            &lt;span class="kwd"&gt;else if&lt;/span&gt; ( &lt;span class="st"&gt;&amp;quot;Next&amp;quot;&lt;/span&gt; == eventArgument )&lt;br /&gt;&lt;b id="55"&gt;55   &lt;/b&gt;            {&lt;br /&gt;&lt;b id="56"&gt;56   &lt;/b&gt;               OnClickNext( EventArgs.Empty );&lt;br /&gt;&lt;b id="57"&gt;57   &lt;/b&gt;            }&lt;br /&gt;&lt;b id="58"&gt;58   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="59"&gt;59   &lt;/b&gt;
&lt;b id="60"&gt;60   &lt;/b&gt;
&lt;b id="61"&gt;61   &lt;/b&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; OnClickDelete( EventArgs e )&lt;br /&gt;&lt;b id="62"&gt;62   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="63"&gt;63   &lt;/b&gt;            &lt;span class="kwd"&gt;throw new&lt;/span&gt; NotImplementedException();&lt;br /&gt;&lt;b id="64"&gt;64   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="65"&gt;65   &lt;/b&gt;
&lt;b id="66"&gt;66   &lt;/b&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; OnClickNext( EventArgs e )&lt;br /&gt;&lt;b id="67"&gt;67   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="68"&gt;68   &lt;/b&gt;            &lt;span class="kwd"&gt;throw new&lt;/span&gt; NotImplementedException();&lt;br /&gt;&lt;b id="69"&gt;69   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="70"&gt;70   &lt;/b&gt;
&lt;b id="71"&gt;71   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;/span&gt;
&lt;b id="72"&gt;72   &lt;/b&gt;
&lt;b id="73"&gt;73   &lt;/b&gt;    }&lt;br /&gt;&lt;b id="74"&gt;74   &lt;/b&gt;}&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks again, your help is really appreciated.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2227426.aspx</link><pubDate>Wed, 12 Mar 2008 08:18:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2227426</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2227426.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2227426</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can&amp;nbsp;use&amp;nbsp;in &lt;strong&gt;RaisePostBackEvent&lt;/strong&gt;, by which you can identify the fired button according to the param&lt;/p&gt;
&lt;p&gt;For example, you add two button in the treenode:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.AddAttribute(HtmlTextWriterAttribute.Onclick, Page.GetPostBackEventReference(this, &amp;quot;Previous&amp;quot;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.RenderBeginTag(HtmlTextWriterTag.Button);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.Write(this.PreviousText);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.RenderEndTag();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.AddAttribute(HtmlTextWriterAttribute.Onclick, Page.GetPostBackEventReference(this, &amp;quot;Next&amp;quot;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.RenderBeginTag(HtmlTextWriterTag.Button);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.Write(this.NextText);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.RenderEndTag(); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Then you can&amp;nbsp;judge which button be fired:&lt;/p&gt;
&lt;p&gt;void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (eventArgument == &amp;quot;Previous&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnClickPrevious(EventArgs.Empty);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (eventArgument == &amp;quot;Next&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnClickNext(EventArgs.Empty);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2226713.aspx</link><pubDate>Tue, 11 Mar 2008 21:39:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2226713</guid><dc:creator>alan@gangleri.net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2226713.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2226713</wfw:commentRss><description>&lt;p&gt;Thnaks Amanda,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is a great help, just one question though, if I had two buttons rendered in each TreeNode how could I determine which button had caused the &lt;font color="#008080"&gt;TreeNodeSelectAction&lt;/font&gt;&lt;font size="2"&gt;.Select action to fire?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks again for your help&lt;/p&gt;</description></item><item><title>Re: Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2224429.aspx</link><pubDate>Tue, 11 Mar 2008 04:21:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2224429</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2224429.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2224429</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can try to&amp;nbsp;add a &lt;font color="#008080" size="2"&gt;TreeNodeSelectAction&lt;/font&gt;&lt;font size="2"&gt;.Select for each custom TreeNode.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;You also can refer this thread:&amp;nbsp; &lt;a href="http://forums.asp.net/t/1035578.aspx"&gt;http://forums.asp.net/t/1035578.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: Customize TreeNode</title><link>http://forums.asp.net/thread/2223923.aspx</link><pubDate>Mon, 10 Mar 2008 21:09:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2223923</guid><dc:creator>alan@gangleri.net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2223923.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2223923</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve looked into this a bit further. What I&amp;#39;ve done is add an HTML button on &lt;font size="2"&gt;RenderPostText. This button has a client side click event that display an alert box and this all works fine. The buttons are displayed beside the TreeNode and the client click event works as expected. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Is it possible that the problem could be down to ViewState? I think what could be happening is the details of ImageButton&amp;#39;s event handlers are lost on the post back, I have looked at saving the state of the buttons to the ViewState but as the ImageButton class is not serializable this fails.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Has anyone could any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Customize TreeNode</title><link>http://forums.asp.net/thread/2223182.aspx</link><pubDate>Mon, 10 Mar 2008 15:49:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2223182</guid><dc:creator>alan@gangleri.net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2223182.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2223182</wfw:commentRss><description>&lt;p&gt;Thanks AJ, &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve already tried adding &lt;font color="blue"&gt;&amp;quot;base&lt;/font&gt;&lt;font color="black"&gt;.RenderPostText&lt;/font&gt;(writer);&amp;quot; and had no luck &lt;img src="http://forums.asp.net/emoticons/emotion-6.gif" alt="Sad" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The problem I have is that the event handler for the button is never fired.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;All the best&lt;br /&gt;Alan.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Customize TreeNode</title><link>http://forums.asp.net/thread/2223041.aspx</link><pubDate>Mon, 10 Mar 2008 14:35:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2223041</guid><dc:creator>akjoshi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2223041.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2223041</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;alan@gangleri.net:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="6"&gt;&lt;/b&gt;&lt;span class="kwdt"&gt;&lt;/span&gt;&lt;br /&gt;&lt;b id="44"&gt;43   &lt;/b&gt;        &lt;span class="kwd"&gt;protected override void&lt;/span&gt; RenderPostText( HtmlTextWriter writer )&lt;br /&gt;&lt;b id="45"&gt;44   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="46"&gt;45   &lt;/b&gt;            delete_.RenderControl( writer );&lt;br /&gt;&lt;b id="47"&gt;46   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="49"&gt;&lt;/b&gt;&lt;span class="kwd"&gt;&lt;b id="50"&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I haven&amp;#39;t used these events but i think you need to call &lt;font color="blue"&gt;base&lt;/font&gt;&lt;font color="black"&gt;.RenderPostText &lt;/font&gt;after you render your custom data. i.e &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="44"&gt;43   &lt;/b&gt;        &lt;span class="kwd"&gt;protected override void&lt;/span&gt; RenderPostText( HtmlTextWriter writer )&lt;br /&gt;&lt;b id="45"&gt;44   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="46"&gt;45   &lt;/b&gt;            delete_.RenderControl( writer ); &lt;br /&gt;&lt;b id="47"&gt;46   &lt;/b&gt;        	 &lt;font color="blue"&gt;base&lt;/font&gt;&lt;font color="black"&gt;.RenderPostText&lt;/font&gt;(writer);&lt;br /&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;47 	     }&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&amp;nbsp;There is a very good blog post on this which will be really helpful - &lt;a href="http://weblogs.asp.net/dannychen/archive/2006/01/25/436454.aspx" title="http://weblogs.asp.net/dannychen/archive/2006/01/25/436454.aspx"&gt;http://weblogs.asp.net/dannychen/archive/2006/01/25/436454.aspx&lt;/a&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&amp;nbsp;&lt;/pre&gt;</description></item><item><title>Add buttons to a TreeNode</title><link>http://forums.asp.net/thread/2221600.aspx</link><pubDate>Sun, 09 Mar 2008 20:00:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2221600</guid><dc:creator>alan@gangleri.net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2221600.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=2221600</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;m trying to extend the default TreeNode so that there are additional ASP.Net buttons displayed beside the node. So far I have extended the TreeNode class and overriden the RenderPostText method so that the buttons are displayed. However when the page is rendered to the client the event handlers don&amp;#39;t fire, I&amp;#39;ve included my TreeNode class and would be very grateful for any advice.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI;&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI.WebControls;&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; MyApp.Storage;&lt;br /&gt;&lt;b id="4"&gt;4    &lt;/b&gt;&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt; SampleApp&lt;br /&gt;&lt;b id="6"&gt;6    &lt;/b&gt;{&lt;br /&gt;&lt;b id="7"&gt;7    &lt;/b&gt;    &lt;span class="kwd"&gt;public class&lt;/span&gt; CustomTreeNode : TreeNode&lt;br /&gt;&lt;b id="8"&gt;8    &lt;/b&gt;    {&lt;br /&gt;&lt;b id="9"&gt;9    &lt;/b&gt;        &lt;span class="kwd"&gt;#region&lt;/span&gt;&lt;span class="kwdt"&gt; Fields&lt;/span&gt;&lt;br /&gt;&lt;b id="10"&gt;10   &lt;/b&gt;&lt;br /&gt;&lt;b id="11"&gt;11   &lt;/b&gt;        &lt;span class="kwd"&gt;private&lt;/span&gt; ImageButton delete_;&lt;br /&gt;&lt;b id="12"&gt;12   &lt;/b&gt;&lt;br /&gt;&lt;b id="13"&gt;13   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;br /&gt;&lt;b id="14"&gt;14   &lt;/b&gt;&lt;br /&gt;&lt;b id="15"&gt;15   &lt;/b&gt;        #region&lt;/span&gt;&lt;span class="kwdt"&gt; Properties&lt;/span&gt;&lt;br /&gt;&lt;b id="16"&gt;16   &lt;/b&gt;&lt;br /&gt;&lt;b id="17"&gt;17   &lt;/b&gt;        &lt;span class="kwd"&gt;public&lt;/span&gt; ImageButton DeletePlayer&lt;br /&gt;&lt;b id="18"&gt;18   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="19"&gt;19   &lt;/b&gt;            &lt;span class="kwd"&gt;get&lt;/span&gt;&lt;br /&gt;&lt;b id="20"&gt;20   &lt;/b&gt;            {&lt;br /&gt;&lt;b id="21"&gt;21   &lt;/b&gt;                &lt;span class="kwd"&gt;return&lt;/span&gt; deletePlayer_;&lt;br /&gt;&lt;b id="22"&gt;22   &lt;/b&gt;            }&lt;br /&gt;&lt;b id="23"&gt;23   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="24"&gt;24   &lt;/b&gt;&lt;br /&gt;&lt;b id="25"&gt;25   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;br /&gt;&lt;b id="26"&gt;26   &lt;/b&gt;&lt;br /&gt;&lt;b id="27"&gt;27   &lt;/b&gt;        #region&lt;/span&gt;&lt;span class="kwdt"&gt; Constructors&lt;/span&gt;&lt;br /&gt;&lt;b id="28"&gt;28   &lt;/b&gt;&lt;br /&gt;&lt;b id="29"&gt;29   &lt;/b&gt;        &lt;span class="kwd"&gt;public&lt;/span&gt; CustomTreeNode ( &lt;span class="kwd"&gt;string&lt;/span&gt; text ) : &lt;span class="kwd"&gt;base&lt;/span&gt;( text )&lt;br /&gt;&lt;b id="31"&gt;30   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="32"&gt;31   &lt;/b&gt;            delete_ = &lt;span class="kwd"&gt;new&lt;/span&gt; ImageButton();&lt;br /&gt;&lt;b id="33"&gt;32   &lt;/b&gt;&lt;br /&gt;&lt;b id="34"&gt;33   &lt;/b&gt;            delete_.ID = &lt;span class="st"&gt;&amp;quot;btnDelete&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;b id="35"&gt;34   &lt;/b&gt;&lt;br /&gt;&lt;b id="36"&gt;35   &lt;/b&gt;            delete_.Click += &lt;span class="kwd"&gt;new&lt;/span&gt; ImageClickEventHandler( delete__Click );&lt;br /&gt;&lt;b id="37"&gt;36   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="38"&gt;37   &lt;/b&gt;&lt;br /&gt;&lt;b id="39"&gt;38   &lt;/b&gt;        &lt;br /&gt;&lt;b id="40"&gt;39   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;br /&gt;&lt;b id="41"&gt;40   &lt;/b&gt;&lt;br /&gt;&lt;b id="42"&gt;41   &lt;/b&gt;        #region&lt;/span&gt;&lt;span class="kwdt"&gt; Protected methods&lt;/span&gt;&lt;br /&gt;&lt;b id="43"&gt;42   &lt;/b&gt;&lt;br /&gt;&lt;b id="44"&gt;43   &lt;/b&gt;        &lt;span class="kwd"&gt;protected override void&lt;/span&gt; RenderPostText( HtmlTextWriter writer )&lt;br /&gt;&lt;b id="45"&gt;44   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="46"&gt;45   &lt;/b&gt;            delete_.RenderControl( writer );&lt;br /&gt;&lt;b id="47"&gt;46   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="48"&gt;47   &lt;/b&gt;&lt;br /&gt;&lt;b id="49"&gt;48   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;br /&gt;&lt;b id="50"&gt;49   &lt;/b&gt;&lt;br /&gt;&lt;b id="51"&gt;50   &lt;/b&gt;        #region&lt;/span&gt;&lt;span class="kwdt"&gt; event handlers&lt;/span&gt;&lt;br /&gt;&lt;b id="52"&gt;51   &lt;/b&gt;        &lt;br /&gt;&lt;b id="53"&gt;52   &lt;/b&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; delete__Click( &lt;span class="kwd"&gt;object&lt;/span&gt; sender, ImageClickEventArgs e )&lt;br /&gt;&lt;b id="54"&gt;53   &lt;/b&gt;        {&lt;br /&gt;&lt;b id="55"&gt;54   &lt;/b&gt;            &lt;span class="kwd"&gt;throw new&lt;/span&gt; System.NotImplementedException();&lt;br /&gt;&lt;b id="56"&gt;55   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="57"&gt;56   &lt;/b&gt;&lt;br /&gt;&lt;b id="58"&gt;57   &lt;/b&gt;        &lt;span class="kwd"&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;b id="59"&gt;58   &lt;/b&gt;&lt;br /&gt;&lt;b id="60"&gt;59   &lt;/b&gt;    }&lt;br /&gt;&lt;b id="61"&gt;60   &lt;/b&gt;}&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&amp;nbsp;</description></item></channel></rss>