您好我在asp.net中运行移动表单页面时收到此异常。它的脚本是:
<mobile:Label id="lblCriteriaA" runat="server">Hi all</mobile:Label>
<mobile:Label id="lblCriteriaB" runat="server"></mobile:Label>
<mobile:SelectionList id="slstMovies" runat="server"></mobile:SelectionList>
<mobile:Command id="bttnSubmit" runat="server" OnClick="showData">Show Times</mobile:Command>
<mobile:TextView ID="TextView1" Runat="server">TextView</mobile:TextView>
<mobile:Label id="lblCriteriaA" runat="server">Hi all</mobile:Label>
<mobile:Label id="lblCriteriaB" runat="server"></mobile:Label>
<mobile:SelectionList id="slstMovies" runat="server"></mobile:SelectionList>
<mobile:Command id="bttnSubmit" runat="server" OnClick="showData">Show Times</mobile:Command>
<mobile:TextView ID="TextView1" Runat="server">TextView</mobile:TextView>
这个设计脚本有什么问题吗?如果我想在服务器端编写代码呢?
答案 0 :(得分:1)
您的服务器控件似乎不在标记内。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication_ASPMobile.WebForm1" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" %>
<mobile:Form id=Form1 runat="server">
<mobile:Label id="lblCriteriaA" runat="server">Hi all</mobile:Label>
<mobile:Label id="lblCriteriaB" runat="server"></mobile:Label>
<mobile:SelectionList id="slstMovies" runat="server"></mobile:SelectionList>
<mobile:Command id="bttnSubmit" runat="server" OnClick="showData">Show Times</mobile:Command>
<mobile:TextView ID="TextView1" Runat="server">TextView</mobile:TextView>
</mobile:form>