Last post Oct 22, 2007 10:07 AM by xyz789
Oct 16, 2007 04:51 PM|xyz789|LINK
I created some code that will open a new window from a custom control, but the custom control I created will not go under the <asp:menuItem>.
Here is an example:
<asp:MenuItem Text="Home" NavigateUrl="Default.aspx" />
<asp:MenuItem Text="Services" >
<asp:MenuItem Text="About the Servives Team" NavigateUrl="About.aspx" />
Here is my custom control that will call the new window:
Text="About the Service Team"
Now I can I call the custom control from the menu control? Is this possible?
"client side postback"
Oct 17, 2007 11:20 PM|Nai-Dong Jin - MSFT|LINK
I’m not sure what you really want. You mentioned that you’ve created a custom control which will open a new window, and you put the control under the Menu control.
What does the “under” mean? Do you mean put your control inside the menu control? If so, the custom control should inherit the MenuItem class. Or what you mean is declare you control after you declare the Menu control? If so, I don’t think it will affect
your controls behavior.
If I’ve misunderstood your words, please show all of your codes and reply.
Oct 18, 2007 07:49 PM|xyz789|LINK
Thank you for responding back, and yes I created a custom control that will open a new window.
What I meant by under is putting the control inside the menu, I wanted to hover over the parent link and click the child link to bring up the new window.
Just for an example, I have a parent link called 'Service' that when the pointer hovers over 'Service' the child link 'About the Service Team ' would be clicked to open the new window.
Services > About the Service Team
> Business Hours
Is this a little more clear now, or do you need more information?
Oct 18, 2007 10:29 PM|Nai-Dong Jin - MSFT|LINK
You don't need to create a custom control to achieve your goal. Just add a inline attribute called "Target" in your MenuItem control, See the following code snippet:
<asp:Menu ID="Menu1" runat="server">
<asp:MenuItem Text="a" Value="a">
<asp:MenuItem NavigateUrl="http://www.abc.com" Text="1" Value="1"
<asp:MenuItem Text="b" Value="b"></asp:MenuItem>
Oct 19, 2007 08:24 AM|xyz789|LINK
Yes, but I would like to have a little more control over the new window, what I mean is if you use Target="_blank" I cannot control the width and height of the new window.
If I can use Target="_blank" and if I am able to control the width, height and the postion of the new window, I would much rather go with the Target="_blank", but I don't know if you can do that?
I would like for the new window to be small more like a pop-up, do you know of a better way to achieve this?
Oct 21, 2007 10:06 PM|Nai-Dong Jin - MSFT|LINK
Hope that helps.
Oct 22, 2007 10:07 AM|xyz789|LINK
Thank you for responding back to me, but I guess I have to go back to the orginal question.
If you use java script in which I am aware of the "onclick="window.open('about.aspx', 'sizechart','width=585,height=413,scrollbars=no,status=yes,left=300,top=160')"
How do you implement this in a menu control?
I would like to be able to hover over the parent link and click onto the child link to open a new window that is customed in size, without reformatting or jeopardizing the use of my menu control.
I would like to keep the menu control and not have to code all my links in the server side just to open a new window.
Does this make more sense?
Please let me know if this can be done. I appreciate your help.