ASP.NET Tutorial/Mobile/Capabilities — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
| |
Текущая версия на 11:58, 26 мая 2010
Show Capabilities
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="cs" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="System.Web.Mobile" %>
<script runat="server" language="c#">
protected void Page_Load(Object sender, EventArgs e) {
MobileCapabilities capabilities = (MobileCapabilities)Request.Browser;
Type t = typeof(MobileCapabilities);
PropertyInfo[] propertyInfos = t.GetProperties();
foreach(PropertyInfo pi in propertyInfos) {
System.Web.UI.MobileControls.Label lbl = new System.Web.UI.MobileControls.Label();
lbl.Text = pi.Name + " = " + capabilities[pi.Name];
form1.Controls.Add(lbl);
}
}
</script>
<mobile:Form id="form1" runat="server" Paginate="true" >
</mobile:Form>