aspnet-ej1-demos/ListBox/DataBinding-XMLData.aspx

40 строки
1.7 KiB
Plaintext

<%@ Page Title="ListBox-XML Data-ASP.NET-SYNCFUSION" MetaDescription="This example demonstrates how to bind an XML database key value mapping in the Syncfusion ASP.NET Web Forms ListBox component." Language="C#" AutoEventWireup="true" MasterPageFile="~/Samplebrowser.Master" CodeBehind="DataBinding-XMLData.aspx.cs" Inherits="WebSampleBrowser.ListBox.DataBinding_XMLData" %>
<asp:Content ID="Content5" ContentPlaceHolderID="ControlsSection" runat="server">
<div class="control listbox" style="display:none">
<div class="frame">
<div class="ctrllabel">Select a holiday destination</div>
<ej:ListBox ID="DrpDwnxml" DataMember="RootItem" DataTextField="Text" DataValueField="Text" runat="server" DataSourceID="XmlDataSource1" ClientSideOnCreate="OnCreated">
</ej:ListBox>
</div>
</div>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/ListBoxXml.xml"></asp:XmlDataSource>
<script type="text/javascript">
function OnCreated() {
if (document.body.firstElementChild.className = "htmljssamplebrowser material"){
setTimeout(function () {
var obj = $("#<%=DrpDwnxml.ClientID%>").ejListBox("instance");
obj._refreshScroller();
}, 800);
}
setTimeout(function () {
$(".listbox").css("display", "block");
}, 300);
}
</script>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="StyleSection" runat="server">
<style type="text/css">
.e-ddl-popup {
margin: 0 auto;
}
.ctrllabel {
font-weight: 600;
padding-bottom: 12px;
}
</style>
</asp:Content>