Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table id="Table_01" width="790" height="23" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <asp:Repeater ID="ImageButtonList" runat="server">
- <ItemTemplate>
- <td>
- <asp:ImageButton runat="server" id="lame" oncommand="btn_Command" CommandName='<%# Container.DataItem + ".aspx" %>'
- ImageUrl="<%# setButtonImageUrl((String) Container.DataItem,0) %>"
- onMouseOver="<%# setButtonImageUrl((String) Container.DataItem,1) %>"
- onMouseOut="<%# setButtonImageUrl((String) Container.DataItem,2) %>"
- />
- </td>
- <td>
- <img src="images/top_menu/top_menu_div.gif" width="2" height="23" alt="" />
- </td>
- </ItemTemplate>
- </asp:Repeater>
- </tr>
- </table>
- protected string setButtonImageUrl(string page, int mouseAction)
- {
- string thispage = HttpContext.Current.Request.CurrentExecutionFilePath;
- thispage = System.IO.Path.GetFileName(thispage);
- string folder = ContentFlowState.GetCurrentProgramFolder();
- if (!string.IsNullOrEmpty(folder))
- folder = "/" + folder;
- string imagePath = "~/images" + folder + "/top_menu/";
- if (thispage.Equals(page + ".aspx", StringComparison.InvariantCultureIgnoreCase))
- return imagePath + page + "_over.gif";
- else
- {
- if (mouseAction == 1)
- return "this.src='" + Page.ResolveUrl(imagePath + page + "_over.gif") + "';";
- else if (mouseAction == 2)
- return "this.src='" + Page.ResolveUrl(imagePath + page + ".gif") + "';";
- else
- return imagePath + page + ".gif";
- }
- }
Add Comment
Please, Sign In to add comment