5
Reply

multiple Datalists data showing only on datalist

Phaneendra Chakravaram

Phaneendra Chakravaram

Dec 23 2016 1:32 AM
204
Hi here iam using 3 datalists  to showing data but i need instead of using 3 datalists i need to use one datalist bcz i need to sort data .if its is one  datalist i can sort data.but here three datalists. but query is same in three datalists select command. but here i need to show youtube video and normal local player video and pdf file so i used 3 datalists here i copied my code please give solution.(content type i need to write condition this is only aspx page no c# code in this page so any solution for this)
 
 
<asp:AccessDataSource ID="AccessDataSource6" runat="server" DataFile="/fpdb/SVBS1.accdb"
SelectCommand="SELECT lm.Title, lm.URL, lm.Description from Content as lm where lm.CourseSection=? and lm.ContentType='VideoSVBS'"> //here contenttype videos in svbs(means local video)
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="ID" QueryStringField="SectionId"
Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
<asp:DataList ID="DataList1" runat="server" class="bulletlist" DataSourceID="AccessDataSource6"
CellPadding="0">
<ItemTemplate>
<li style="margin-left: 9px"><%# Eval("Title")%></li>
<p style="margin-left: 9px" ><%# Eval("Description")%></p>
<div style="margin-left:10px">
<div id="mediaplayer<%# Eval("URL")%>" style="text-align:center; vertical-align:top; width:100%; margin:10px; padding:10px;padding-left:27px">
<script type="text/javascript">
jwplayer("mediaplayer<%# Eval("URL")%>").setup({
flashplayer: "player.swf",
file: "/h264/<%# Eval("URL")%>.mp4",
height: 113,
width: 200,
});
</script>
</div>
</div>
</ItemTemplate>
</asp:DataList>
<asp:DataList ID="DataList3" runat="server" class="bulletlist" DataSourceID="AccessDataSource1"
CellPadding="0">
<ItemTemplate>
<li style="margin-left: 9px"><%# Eval("Title")%></a></li>
<p style="margin-left: 9px"><%# Eval("Description")%></p>
<iframe width="200" style="margin-left:10px" height="113" src="https://www.youtube.com/embed/<%# Eval("URL")%>" frameborder="0" allowfullscreen></iframe>
</ItemTemplate>
</asp:DataList>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="/fpdb/SVBS1.accdb"
SelectCommand="SELECT lm.Title, lm.URL, lm.Description from Content as lm where lm.CourseSection=? and lm.ContentType='VideoYouTube'"> //here content type is (video youtube)
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="CourseSection" QueryStringField="SectionId"
Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
<asp:DataList ID="DataList5" runat="server" class="bulletlist" DataSourceID="AccessDataSource2"
CellPadding="0">
<ItemTemplate>
<li style="margin-left: 9px"><a href="<%# Eval("URL")%>" target="_blank" class="PinkLink"><%# Eval("Title")%></a></li>
<p style="margin-left: 9px"><%# Eval("Description")%></p>
</ItemTemplate>
</asp:DataList>
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="/fpdb/SVBS1.accdb"
SelectCommand="SELECT lm.Title, lm.URL, lm.Description from Content as lm where lm.CourseSection=? and lm.ContentType<>'VideoYouTube' and lm.ContentType<>'VideoSVBS'and lm.hide <> true">//(here content type both)
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="CourseSection" QueryStringField="SectionId"
Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
 

Answers (5)