how to create a new mobilepage from a derived class

E

empires2

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

}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top