<?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>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/3552728.aspx</link><pubDate>Mon, 07 Dec 2009 21:11:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3552728</guid><dc:creator>NickLocke</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3552728.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=3552728</wfw:commentRss><description>&lt;p&gt;This looked like exactly what I wanted to do --- forcing the user to click rather than mouseover.&amp;nbsp; I have implemented the code exactly as suggested, but saw no difference in the rendering. &lt;/p&gt;
&lt;p&gt;With a bit of debugging, I got my hands on the HTML string in the Render method - and there lies my problem.&lt;/p&gt;
&lt;p&gt;I am using .NET4 and there is no &amp;quot;onmouseover&amp;quot; code&amp;nbsp;anywhere to be seen.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m guessing that it has been buried away in an ASD&amp;nbsp;resource somewhere.&lt;/p&gt;
&lt;p&gt;Any clues?&lt;/p&gt;
&lt;p&gt;Thanks&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/3371690.aspx</link><pubDate>Thu, 27 Aug 2009 06:19:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3371690</guid><dc:creator>nuwan_dammika</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3371690.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=3371690</wfw:commentRss><description>&lt;p&gt;Thanks alot.&amp;nbsp; It heleped me in big way&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2622607.aspx</link><pubDate>Mon, 15 Sep 2008 17:20:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2622607</guid><dc:creator>skkulla</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2622607.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2622607</wfw:commentRss><description>&lt;p&gt;I was trying to achieve the same thing by creating custom control and override the render but when i click my parent node menu on my menu control the page gets refreshed but submenu does not show up.&lt;/p&gt;
&lt;p&gt;Can you please let me know why its happening.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2603307.aspx</link><pubDate>Fri, 05 Sep 2008 16:05:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2603307</guid><dc:creator>Rodashar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2603307.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2603307</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I personally use the sitemap and sitemap datasource objects. You must first add and setup a sitemap object. see here (http://msdn.microsoft.com/en-us/library/yy2ykkab.aspx) for more information on the sitemap object. Once you have the site map setup just add a sitemap data source object to your .aspx page and set the menus DataSourceID property to the newly added sitemapdatasource.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2603256.aspx</link><pubDate>Fri, 05 Sep 2008 15:51:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2603256</guid><dc:creator>Mak1234</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2603256.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2603256</wfw:commentRss><description>&lt;p&gt;Hi &lt;strong&gt;Rodashar,&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&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; &lt;/strong&gt;This is really helpful for me.&amp;nbsp; Just one more thing can you send me the sample&amp;nbsp;code to render the actual menu and submenu dynamically from XML&amp;nbsp;file OR may be from&amp;nbsp;database. and How&amp;nbsp;I can render it in custom control&amp;nbsp;? I need to render menu and submenu in custom control to test whether onClick is working or not.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;
&lt;p&gt;MAK.&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2601274.aspx</link><pubDate>Thu, 04 Sep 2008 20:12:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2601274</guid><dc:creator>Rodashar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2601274.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2601274</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I would put the code in a single class file in your asp.NET project. In order to register the control with the page you want to use it on you need to add a Register tag to the top of you .aspx page. It would look like this.&lt;/p&gt;&lt;p&gt;&amp;lt;%@ Register NameSpace=&amp;quot;ControlNamespace&amp;quot; TagPrefix=&amp;quot;cc1&amp;quot; %&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I used a namespace in my control so I referenced it like this. Not sure how to do it without a namespace but adding a namespace is easy so it&amp;#39;s a non issue. then to add your control to the page you would open a tag and enter cc1: it would look kinda like this&lt;/p&gt;&lt;p&gt;&amp;lt;cc1:NameOfYourClass id=&amp;quot;CustomControl1&amp;quot; ...&amp;gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2600933.aspx</link><pubDate>Thu, 04 Sep 2008 17:39:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2600933</guid><dc:creator>Mak1234</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2600933.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2600933</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for reply, &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Upto this I was already had some code implemented but main thing is how to dynamically populate data and how to reference this class into a .aspx page ?&amp;nbsp; Should I create new project for custom control OR just add new class into existing web project ?&amp;nbsp; If I have add only a class file as you suggested then how to give reference of this new class into a .aspx page ?&lt;/p&gt;
&lt;p&gt;I am very much new in custom control so may be these are very basic question for you. But please answer me in detail.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;MAK&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;&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2600729.aspx</link><pubDate>Thu, 04 Sep 2008 16:02:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2600729</guid><dc:creator>Rodashar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2600729.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2600729</wfw:commentRss><description>&lt;p&gt;What you have to do is right click on your project file and select add new item. Select the class object and name it whatever you want and click Add. Visual Studio may tell you that it is a good idea to put classes in the App_Code folder. Just click yes and go on your marry way. You should now have a class that looks like the snippet below&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Public Class CustomWebMenu&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;End Class&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Typically I would add some import statements for System.Web.UI.Webcontrols. Now you have to add the Inherits statement to let the class use the existing menu controls features. so your class would look like this&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Imports System.Web.UI.WebControls&lt;br /&gt;&lt;br /&gt;Public Class Class1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits Menu&lt;/p&gt;&lt;p&gt;&lt;br /&gt;End Class&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Once you have added this you can add the render code in the previous post reference your new control and vola! I hope that helps. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2600651.aspx</link><pubDate>Thu, 04 Sep 2008 15:33:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2600651</guid><dc:creator>Mak1234</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2600651.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2600651</wfw:commentRss><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for your reply. Yes, I was trying to override in masterpage, I think that was my mistake. But I really dont have much experience about custom control. Can you please send some sample code for custom control which implement .Net menu class so that I can modify it for my purpose. OR can you please send me any Url where I can find abt how to implement menu in custom control using .Net 2.0 and c#. If this is dome then I can override render method in cstom control. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;MAK&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2597987.aspx</link><pubDate>Wed, 03 Sep 2008 16:00:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2597987</guid><dc:creator>Rodashar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2597987.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2597987</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;You have to make sure to create a custom control and inherit the asp.NET menu control. You have to override the render method in your new custom control and not the master page. Can you include your code so I can take a look at what your doing?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/2597702.aspx</link><pubDate>Wed, 03 Sep 2008 14:16:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2597702</guid><dc:creator>Mak1234</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2597702.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2597702</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; My requirement is also same. I need to display menu on Onclick event of mouse in my ASP.Net 2.0 application. But when I tried as you suggested it doesnt work for me. I have just render method into my masterpage wher actually menu is display but it is not showing mwnu on ONCLICK event.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;MAK.&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/1872103.aspx</link><pubDate>Wed, 22 Aug 2007 21:47:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1872103</guid><dc:creator>Rodashar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1872103.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1872103</wfw:commentRss><description>&lt;p&gt;Glad I could be of help :D&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/1872087.aspx</link><pubDate>Wed, 22 Aug 2007 21:37:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1872087</guid><dc:creator>larrydotnet</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1872087.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1872087</wfw:commentRss><description>&lt;p&gt;Thank you very much.&amp;nbsp; What i did was to create a class that inherits from Menu and overrided the Render metohd using your code.&amp;nbsp; that worked for me.&lt;/p&gt;</description></item><item><title>Re: Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/1826011.aspx</link><pubDate>Thu, 26 Jul 2007 21:23:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1826011</guid><dc:creator>Rodashar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1826011.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1826011</wfw:commentRss><description>&lt;p&gt;What you could do is create a custom user control and add a Menu control to it. Then in the code override the render method and replace the onmouseover with the onclick. (Example below). The only troble with this would be if you were using the SiteMap to fill your menu. If the SiteMapNodes have a NavigateUrl assigned then they may use the onclickevent. I&amp;#39;d have to look into this further. I&amp;#39;m not sure what you would do for closing the menu. I guess you could just leave the on mouseout and it would work. In theory you&amp;#39;d just call the same javascript function and it should work. Let me know if this helps.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;//Override the Render method to replace the onmouseover&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;override&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Render(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;HtmlTextWriter&lt;/font&gt;&lt;font size="2"&gt; writer) {&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;StringBuilder&lt;/font&gt;&lt;font size="2"&gt; stringBuilder = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;StringBuilder&lt;/font&gt;&lt;font size="2"&gt;();&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;StringWriter&lt;/font&gt;&lt;font size="2"&gt; stringWriter = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;StringWriter&lt;/font&gt;&lt;font size="2"&gt;(stringBuilder);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;HtmlTextWriter&lt;/font&gt;&lt;font size="2"&gt; htmlWriter = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;HtmlTextWriter&lt;/font&gt;&lt;font size="2"&gt;(stringWriter);&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;base&lt;/font&gt;&lt;font size="2"&gt;.Render(htmlWriter);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; html = stringBuilder.ToString();&lt;/p&gt;html = html.Replace(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;onmouseover=&amp;quot;Menu_HoverStatic(this)&amp;quot;&amp;quot;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;,&lt;font color="#a31515"&gt;&amp;quot;onclick=&amp;quot;Menu_HoverStatic(this)&amp;quot;&amp;quot;&amp;quot;&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;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;writer.Write(html); 
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Menu Control - Use OnClick instead of OnMouseOver</title><link>http://forums.asp.net/thread/1825862.aspx</link><pubDate>Thu, 26 Jul 2007 20:14:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1825862</guid><dc:creator>larrydotnet</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1825862.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1825862</wfw:commentRss><description>&lt;p&gt;Hi everyone,&lt;/p&gt;
&lt;p&gt;Is there a way to display submenues by just clicking the parent menu insted of the default behavior (mouse over it) in the Menu Control?&lt;/p&gt;
&lt;p&gt;I need to prevent&amp;nbsp;showing the menu structure when the user&amp;nbsp;moves over the menu, it is very confusing to have submenues displayed the the user just need to move the mouse to reach&amp;nbsp;another page option.&amp;nbsp;&amp;nbsp; Please is you know to to do that please let me know.&lt;/p&gt;
&lt;p&gt;The real click event needs to be just on the the leaf menu (last one of each structure).&lt;/p&gt;
&lt;p&gt;Please, give me some advise.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>