• C#入门经典第4版 19章web编程基础 19.1~19.5代码(2)——ResultPage.aspx ResultPage.aspx.cs RegistrationInformation.cs


    //ResultPage.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ResultsPage.aspx.cs" Inherits="ResultsPage" %> <%@ PreviousPageType VirtualPath ="~/Default.aspx" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> </div> <asp:Label ID="labelResult" runat="server" Text="Label"></asp:Label> <asp:Button ID="Button1" runat="server" PostBackUrl="~/Default.aspx" Text="Button" /> </form> </body> </html>
    //ResultPage.aspx.cs
    using
    System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class ResultsPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { RegistrationInformation ri = PreviousPage.RegistrationInformation; labelResult.Text = string.Format("{0} {1} selected the event {2}", ri.firstName, ri.lastName, ri.selectedEvent); } catch { labelResult.Text = "The originating page must contain " + "textFirstname, textLastname, textEmail controls"; } } }

    //RegistrationInformation.cs
    using System;
    using System.Data;
    using System.Configuration;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    
    /// <summary>
    /// Summary description for RegistrationInformation
    /// </summary>
    public struct RegistrationInformation
    {
            public string firstName { get; set; }
            public string lastName { get; set; }
            public string email { get; set; }
            public string selectedEvent { get; set; }
    }
    
    
    
     
  • 相关阅读:
    模拟实现atoi函数
    C语言中的字符串函数的实现,strcpy,strlen,strcat,strcmp
    使用repeater实现gridview的功能
    使用NPOI随意创建Excel(含下拉列表)
    使用存储过程来动态调用数据(SELECT)
    判断sql执行效率以及针对临时表的使用
    C#读取Excel显示到repeater中
    ASP.NET使用后台更改前台Style
    js格式化日期
    查询某张表的表结构
  • 原文地址:https://www.cnblogs.com/sinozhang1988/p/ontheRoad1.html
Copyright © 2020-2023  润新知