I have a datalist, and by clicking it, the whole database records pop up. What I want to do is, which ever record is clicked ONLY that record should pop up.
This is my code for the data list and the pop up of all records.
.MY_POPUP_INNER_SMALL {
background: none repeat scroll 0 0 #FFFFFF;
border: 4px solid #ccc;
border-radius: 3px 3px 3px 3px;
display:none;
left: 50%;
margin-left: -302px;
position: fixed;
top: 5%;
width: 500px;
z-index: 1002;height:500px; overflow:auto;
}
.cursor {
cursor:pointer;
}
.MY_POPUP_BG
{width: 100%;
height: 100%;
border-top: solid 1px #ccc;
border-left: solid 1px #ccc;
border-right: outset 1px #ccc;
border-bottom: outset 1px #ccc;
text-align: center;
vertical-align: middle;
padding-top: 30px;
padding-bottom:30px;
top: 0px;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
display:none;
}
</style>
<script>
function func(x) {
document.getElementById('pmInnerfeedback').style.display = 'block';
document.getElementById('pmOuterfeedback').style.display = 'block';
document.getElementById('ctl00_hdnfeedback').value = '1';
return false;
}
</script>
This is the Data List
<ul id="promobox">
<li>
<a href="Events.aspx"><h3>Events</h3></a>
<ul>
<asp:DataList ID="DataList4" runat="server" ClientIDMode="Static" DataSourceID="SqlDataSource4" style="margin-left: 0%" Width="271px">
<ItemTemplate>
<a onclick="func()" class="cursor" style="background-color:none; text-align:left;"><asp:Label ID="Label4" runat="server" Text='<%# Eval("EventName") %>'></asp:Label></a>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource
id="SqlDataSource4"
runat="server"
DataSourceMode="DataReader"
ConnectionString="<%$ ConnectionStrings:SEConn%>"
SelectCommand=" SELECT TOP 5 EventName FROM Event;">
</asp:SqlDataSource>
</ul>
I've tried doing a lot of stuff, like i tried to get the ID from the record clicked like this: var m = $(this).parent().prev().text(); To check that I tried an alert(m); but it didn't work. The alert wasn't popping. Then I tried putting the actual ID of the table and keeping it hidden but accessing the value but I still failed. Can someone please guide me. If you cannot understand the problem, I'll try to explain more.