HighTechTalks DotNet Forums  

how to create a new mobilepage from a derived class

ASP.net Mobile microsoft.public.dotnet.framework.aspnet.mobile


Discuss how to create a new mobilepage from a derived class in the ASP.net Mobile forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
empires2
 
Posts: n/a

Default 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

}
}

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.