I want to show image in the dropdown using asp.net c#, I got the following example working but it works on page which dont have a a master page.
http://www.aspdotnet-suresh.com/2011/12/jquery-bind-images-to-dropdownlist-in.html
I need the same drop down with images on a master page. right now it binds to the database and get the value but for some reason doesnt work on page which use masterpage
Partial code of master page
<%@ Page Title="Website Administration : Add New Page" Language="C#" MasterPageFile="SiteAdmin.master" AutoEventWireup="true" CodeFile="AddNewPage.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<link href="../dropdown/dd.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../dropdown/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="../dropdown/js/jquery.dd.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function (e) {
try {
$("#ddBanner").msDropDown();
} catch (e) {
alert(e.message);
}
});
</script>
<table><tr><td>
<asp:DropDownList ID="ddBanner" runat="server" Width="424px">
</asp:DropDownList>
</td></tr></table>
I cross check path and everything but does not work.. for some reason
You ddBanner list, is not called ddBanner, when in a contentPlaceHolder. The rendered page, will have the placeholder’s name, prefix the dropdown. If you goto your rendered page, and show the source, you will see this.
You need to insert its clientID instead, or type the full name, from the rendered page.
should be