how to create a new mobilepage from a derived class

Discussion in 'ASP .Net Mobile' started by empires2, Jan 26, 2005.

  1. empires2

    empires2 Guest

    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

    }
    }
    empires2, Jan 26, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    383
    myork
    May 23, 2007
  2. Replies:
    1
    Views:
    371
    Victor Bazarov
    May 23, 2007
  3. MobilePage and Inheritance

    , Jan 4, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    334
  4. SoSimple
    Replies:
    1
    Views:
    109
    JuanDG
    Sep 21, 2004
  5. George Durzi

    MobilePage / Page Title

    George Durzi, Nov 17, 2004, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    120
    JuanDG
    Nov 19, 2004
Loading...

Share This Page