Guest User

Untitled

a guest
May 27th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <table id="Table_01" width="790" height="23" border="0" cellpadding="0" cellspacing="0">
  2. <tr>
  3. <asp:Repeater ID="ImageButtonList" runat="server">
  4. <ItemTemplate>
  5. <td>
  6. <asp:ImageButton runat="server" id="lame" oncommand="btn_Command" CommandName='<%# Container.DataItem + ".aspx" %>'
  7. ImageUrl="<%# setButtonImageUrl((String) Container.DataItem,0) %>"
  8. onMouseOver="<%# setButtonImageUrl((String) Container.DataItem,1) %>"
  9. onMouseOut="<%# setButtonImageUrl((String) Container.DataItem,2) %>"
  10. />
  11. </td>
  12. <td>
  13. <img src="images/top_menu/top_menu_div.gif" width="2" height="23" alt="" />
  14. </td>
  15. </ItemTemplate>
  16. </asp:Repeater>
  17. </tr>
  18. </table>
  19.  
  20. protected string setButtonImageUrl(string page, int mouseAction)
  21. {
  22. string thispage = HttpContext.Current.Request.CurrentExecutionFilePath;
  23. thispage = System.IO.Path.GetFileName(thispage);
  24.  
  25. string folder = ContentFlowState.GetCurrentProgramFolder();
  26. if (!string.IsNullOrEmpty(folder))
  27. folder = "/" + folder;
  28.  
  29. string imagePath = "~/images" + folder + "/top_menu/";
  30.  
  31. if (thispage.Equals(page + ".aspx", StringComparison.InvariantCultureIgnoreCase))
  32. return imagePath + page + "_over.gif";
  33. else
  34. {
  35. if (mouseAction == 1)
  36. return "this.src='" + Page.ResolveUrl(imagePath + page + "_over.gif") + "';";
  37. else if (mouseAction == 2)
  38. return "this.src='" + Page.ResolveUrl(imagePath + page + ".gif") + "';";
  39. else
  40. return imagePath + page + ".gif";
  41. }
  42. }
Add Comment
Please, Sign In to add comment