Showing posts with label menu. Show all posts
Showing posts with label menu. Show all posts

Saturday, March 24, 2012

Need flyout menu/site map.

This is probably to an AJAX UI thread.

At www.msdn.com I saw a flyout menu. If you hover over "Microsoft" in the top-right corner - a DIV will flyout. On my web-site http://www.everythingXML.com I use treeView control for navigation. I think that the MSDN's flyout menu has 2 advantages over treeView:

1) User can see all options at once. One big picture of all the options. No additional clicks required to navigate to the item.

2) It takes as little precious page space as it can.

Does anyone can advise me where I can borrow this fly out site map/menu?

Cheers!

Try using theAJAX.net DropDown control. The example just shows very simple list but you can style it and put pretty much any content you want into it. For example, Idrop down a tag cloud on this page (click on Step 1).

Also, look at the HoverMenu control. It does pretty much the same thing.

To add some animation, use theAnimation tools in the AJAX toolkit.


Doesn't look like my tag cloud example link worked...In case you want to see it: http://nicic.org/Library

Wednesday, March 21, 2012

Need help getting javascript widget to work

I'm trying to get the following to work in my ASP .NET AJAX site:

dhtmlGoodies xpPane

I'd like to use it as a main menu for my site, so this is what my masterpage looks like:

<%@dotnet.itags.org. Master Language="C#" AutoEventWireup="true" CodeFile="Blah.master.cs" Inherits="Blah" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<link runat="server" type="text/css" rel="stylesheet" id="cssLink" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Scripts>
<asp:ScriptReference Path="/Blah/scripts/xpPane.js" />
</Scripts>
</asp:ScriptManager>
<div id="dhtmlgoodies_xpPane">
<div class="dhtmlgoodies_panel>">
<div>
<!-- Start content of pane --> Testing...<br />
Test 1<br />
Test 2<br />
Test 3
<!-- End content --> </div>
</div>
</div>
<script type="text/javascript">initDhtmlgoodies_xpPane(Array('Test Title'), Array(true), Array());</script>
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>

I've seperated the the javascript and css and put them in their own files. I've also put the required images into /Blah/scripts/images/. I added the following to the end of the javascript file:

if (typeof(Sys) !=='undefined'){
Sys.Application.notifyScriptLoaded();
alert("Howdy! I'm an external file.");
}

When I view the page all I see isthis

I do not get any script errors on the page. Also the javascript alert I put in is being shown, so the script is definately being loaded. Any help would be much appreciated! Smile

Hello, i am actually dont know what are you tryting to accomplish from your post. but if you are trying to do the menus. Then just use ASP .NET menu control.

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/navigation/default.aspx

and here is a great video about it:

http://asp.net/learn/videos/view.aspx?tabid=63&id=48


Is there no one here that can get this thing to work? Surely its possible...

Replace " <div class="dhtmlgoodies_panel>">"

with

<div class="dhtmlgoodies_panel">
!

You are so careless!!!!!


I must've read over that line 100 times without noticing the out-of-place angle bracket. Its not so much about carelessness - sometimes it just takes another pair of eyesWink


Thanks for pointing it out, I'll try it later and let you know if it works!!


I've tested it,and found that it worked very well:)

Do you have any question?


Yup it works fine now. Thanks for the help!Big Smile

Need help with hover menu on repeater rows..

Hi all! I am trying to use Hover Menu... on the rows generated by asp repeater.. and add EDIT and DELETE Link buttons in the menu... In on of the post in this forum I found that we need to initilize for every row.. I confused.. it wud be gr8 if any help me with some sample code...

<asp:Panel runat="server" ID="pnlcurroffer" GroupingText="<b>Current Offers Info</b>" Height="400px" Width="350" >
<asp:Button ID="btncurrprev" runat="server" CssClass="tbox" Text="<<" OnClick="currprev" />
<asp:Label ID="lblcurrpage" runat="server" />
<asp:Button ID="btncurrnxt" runat="server" CssClass="tbox" Text=">>" OnClick="currlnext" /
<table cellpadding="0" cellspacing="0" border="0" class="main" width="95%"
<tr>
<td colspan="4" class="top line"><img src="http://pics.10026.com/?src=~../images/spc.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td class="hed" style="height: 19px"><div class="mgn">ID</div></td>
<td class="hed" style="height: 19px"><div class="mgn">Name</div></td>
<td class="hed" style="height: 19px"><div class="mgn">PackInfo</div></td>
<td class="hed" style="height: 19px"><div class="mgn">Del</div></td>

</tr>
<tr>
<asp:Repeater ID="Repcurroffers" runat="server" OnItemDataBound="bindcurroffers" >
<ItemTemplate>
<tr class="white" onmouseover="this.className='high';" onmouseout="this.className='white';">
<td class="row"><div class="mgn"><%#Eval("spid")%></div></td>
<td class="row"><div class="mgn"><asp:Literal ID="lblcurroffname" runat="server" /></div></td>
<td class="row"><div class="mgn"><asp:Literal ID="lblcurrLead" runat="server" /></div></td>
<td class="row"><div class="mgn"><asp:LinkButton ID="lnkdel" runat="server" Text="Delete" CommandArgument='<%#Eval("Spid")%>' OnCommand="lnkDelOffer" /></div></td>
</tr>
</ItemTemplate>

</asp:Repeater>
</tr>
</table>
</asp:Panel>

Thanx guys

Hi,

Please change your code to:

<asp:Panel runat="server" ID="pnlcurroffer" GroupingText="<b>Current Offers Info</b>"
Height="400px" Width="350">
<asp:Button ID="btncurrprev" runat="server" CssClass="tbox" Text="<<" OnClick="currprev" />
<asp:Label ID="lblcurrpage" runat="server" />
<asp:Button ID="btncurrnxt" runat="server" CssClass="tbox" Text=">>" OnClick="currlnext" />
<table cellpadding="0" cellspacing="0" border="0" class="main" width="95%">
<tr>
<td colspan="4" class="top line">
<img src="http://pics.10026.com/?src=~../images/spc.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td class="hed" style="height: 19px">
<div class="mgn">
ID</div>
</td>
<td class="hed" style="height: 19px">
<div class="mgn">
Name</div>
</td>
<td class="hed" style="height: 19px">
<div class="mgn">
PackInfo</div>
</td>
<td class="hed" style="height: 19px">
<div class="mgn">
Del</div>
</td>
</tr>
<asp:Repeater ID="Repcurroffers" runat="server" OnItemDataBound="bindcurroffers">
<ItemTemplate>
<tr>
<td colspan="4">
<asp:Panel ID="Panel1" runat="server">

<table>
<tr class="white" onmouseover="this.className='high';" onmouseout="this.className='white';">
<td class="row">
<div class="mgn">
<%#Eval("spid")%>
</div>
</td>
<td class="row">
<div class="mgn">
<asp:Literal ID="lblcurroffname" runat="server" /></div>
</td>
<td class="row">
<div class="mgn">
<asp:Literal ID="lblcurrLead" runat="server" /></div>
</td>
<td class="row">
<div class="mgn">
<asp:LinkButton ID="lnkdel" runat="server" Text="Delete" CommandArgument='<%#Eval("Spid")%>'
OnCommand="lnkDelOffer" /></div>
</td>
</tr>
</table>
</asp:Panel>
<ajaxToolkit:HoverMenuExtender ID="hme1" runat="Server" TargetControlID="Panel1"
PopupControlID="PopupMenu" HoverCssClass="popupHover" PopupPosition="Right" />
<asp:Panel ID="PopupMenu" runat="server" CssClass="popupMenu">
<div style="border: 1px outset white">
<asp:LinkButton ID="LinkButton1" runat="server" />
<br />
<asp:LinkButton ID="LinkButton2" runat="server" />
</div>
</asp:Panel>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>

</table>
</asp:Panel>

Best Regards,


Thank you so much!!!

NEED HELP! CollapsiblePanelExtender after callback still open?

Hello Community, I use since short AJAX. My menu/navigation I designed with CollapsiblePanelExtender, also all this dynamically. I get myself on the left of and headings from the data base and provide myself then the panels, left and images of everything dynamically. Everything marvelously and super. Now know it surely everything our customers --> "why that again opened unfold? It closed a while ago!". Therefore I must store the status somehow, expended or collapsed. I have one blog found where it am in such a way made:

1static string _topPanelCollapsed_ClientState;23protected void Page_Load(object sender, EventArgs e)4{5if (IsPostBack)6 _topPanelCollapsed_ClientState =7 CollapsiblePanelExtender1.ClientState ;8else9 CollapsiblePanelExtender1.ClientState =10 _topPanelCollapsed_ClientState;

For a panel that could be able be done, but as I get now so dynamically that it functions with my n-Panlels? Unfortunately there is none however with panels "onClick" Event and on the Event of the CollapsiblePanelExtender cannot one not access. I am grateful over all solutions.

PLEASE HELP ME!

i'm to despair!!!

thx for your answers!

Please post some code, maybe then we can help you more easily.

(Use the top-right button to insert code when you reply, thanks!)

Wim


69void PreparedMenu()70 {71 XmlDocument doc =new XmlDocument();72 doc.LoadXml(xmlText);7374 XmlElement root = doc.DocumentElement;7576 XmlNodeList XmlMainNode = doc.GetElementsByTagName("MainMenu");7778// MainMenuPanel erstellen79for (int i = 0; i < XmlMainNode.Count; i++)80 {81 XmlAttributeCollection xmlattribute = XmlMainNode[i].Attributes;82string titel = xmlattribute.GetNamedItem("Titel").Value;83string link = xmlattribute.GetNamedItem("Link").Value;84string pic ="";85if (xmlattribute.GetNamedItem("Pic") !=null)86 pic = xmlattribute.GetNamedItem("Pic").Value;87 Panel subMenuPanel =null;88string currentSubPanel ="";8990 pnlMenu.Controls.Add(getNewMainPanel(titel, link, pic));9192foreach (XmlNode subnodein root.ChildNodes.Item(i).ChildNodes)93 {94 XmlAttributeCollection xmlSubAttribute = subnode.Attributes;95string subtitel = xmlSubAttribute.GetNamedItem("SubTitel").Value;96string sublink = xmlSubAttribute.GetNamedItem("SubLink").Value;97 HtmlGenericControl htmblBreak =new HtmlGenericControl("br");9899// Prüft ob ein Subpanel für diesen Menüpunkt existiert.100if (subMenuPanel ==null)101 {102 subMenuPanel =new Panel();103104// Eigenschaften des Panels setzen105 subMenuPanel.ID ="Sub" + titel;106107// aktueller Subpanel108 currentSubPanel = subMenuPanel.ID;109 subMenuPanel.CssClass ="collapsePanel";110 subMenuPanel.Controls.Add(getNewLink(subtitel, sublink));111 subMenuPanel.Controls.Add(htmblBreak);112 }113else114 {115 subMenuPanel.Controls.Add(getNewLink(subtitel, sublink));116 subMenuPanel.Controls.Add(htmblBreak);117 }118 }119// Prüft ob ein dummy Panel erstellt werden muss.120if (currentSubPanel =="")121 {122 Panel emptyPanel =new Panel();123 emptyPanel.ID = titel +"Empty";124 currentSubPanel = emptyPanel.ID;125 emptyPanel.Height = 0;126127 pnlMenu.Controls.Add(emptyPanel);128 }129130// Prüft ob es ein SubMenuPanel hat.131if (subMenuPanel !=null)132 {133 pnlMenu.Controls.Add(subMenuPanel);134 subMenuPanel =null;135 }136137 pnlMenu.Controls.Add(getNewAjaxcollapsPanel(titel, currentSubPanel, link));138 }139 }140141protected CollapsiblePanelExtender getNewAjaxcollapsPanel(string mainpanel,string subpanel,string link)142 {143//Ajax Controll erstellen für jeden MainMenu Eintrag144 collapsPanel =new CollapsiblePanelExtender();145 collapsPanel.ID ="pnlEx" + mainpanel;146 collapsPanel.TargetControlID = subpanel;147 collapsPanel.ExpandControlID = mainpanel;148 collapsPanel.CollapseControlID = mainpanel;149 collapsPanel.Collapsed =true;150 collapsPanel.SuppressPostBack =false;151 collapsPanel.EnableViewState =true;152153return collapsPanel;154 }155156protected Panel getNewMainPanel(string titel,string link,string picture)157 {158// Tempor?res Panel erstellen159 Panel mainMenuPanel =new Panel();160161// Eigenschaften des Panels setzen162 mainMenuPanel.ID = titel;163 mainMenuPanel.CssClass ="collapsePanelHeader";164 mainMenuPanel.EnableViewState =true;165166 HyperLink mainLink = getNewLink(titel, link);167 mainLink.CssClass ="headerMenu";168169// Image erstellen170if (picture !="")171 {172 Image mainImage =new Image();173 mainImage.ImageUrl = picture;174 mainImage.Height = 24;175 mainImage.Width = 24;176 mainMenuPanel.Controls.Add(mainImage);177 }178179// Controls dem Panel hinzufügen180 mainMenuPanel.Controls.Add(mainLink);181182return mainMenuPanel;183 }184185protected HyperLink getNewLink(string name,string url)186 {187 PostBackOptions test =new PostBackOptions(this);188 test.ActionUrl = url;189190// Menülink erstellen191 HyperLink aMenuLink =new HyperLink();192 aMenuLink.Text = name;193 aMenuLink.NavigateUrl = url;194195return aMenuLink;196 }197}

Well thats my code.

example menu
--------
- home
- menupoint1
- menupoint2
- menupoint3

click on menupoint1 --> the content of menupoint1 load to the contentplaceholder

after the click the menu looks like (after callback)

- home
- menupoint1
- menupoint2
- menupoint3

but I would like so (the panels that i clicked remain open)

- home
- menupoint1
submenupoint1
submenupoint2
- menupoint2
- menupoint3


i hope it know which I mean ;)

thx for help!