how to create a new mobilepage from a derived class -
01-25-2005
, 10:59 PM
hi
I create a mobile page(named as "index.asp" and "index.aspx.cs") from a
derived class( named as "stdPage.cs"), but the mobile page can not display in
the VS.NET IDE at design time. How can this page be displayed in IDE at
design time.By the way, the appliation work well when I test it with
emulator.
Thanks
the code as follow
file: stdPage.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using System.IO;
namespace WAPApp.Component
{
public class stdPage:System.Web.UI.MobileControls.MobilePage
{
public stdPage()
{
//
// TODO: 在*处添*构*函数逻辑
//
}
//my code at here
}
}
file : index.asp
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="index.aspx.cs" Inherits="WAPApp.index"
AutoEventWireup="false" %>
<HEAD>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="http://schemas.microsoft.com/Mobile/Page"
name="vs_targetSchema">
</HEAD>
<body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
<mobile:form id="IndexForm" runat="server">
<mobile:Label id="Label1" runat="server" Alignment="Center"
StyleReference="title">welcome</mobile:Label>
</mobile:form>
</body>
file: index.asp.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using WAPApp.Component;
namespace WAPApp.
{
public class index : stdPage
{
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.Form IndexForm;
private void Page_Load(object sender, System.EventArgs e)
{
#region Web 窗体设计器生成的代*
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代*编辑器修改
/// *方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
} |