本文共 1257 字,大约阅读时间需要 4 分钟。
搞了两个晚上搞定。。。太弱了。。。button的事件触发一开始没做出来,后来发现是触发函数是要VS自动生成的才行,自己写的没用。。。
前台的aspx代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ControlsORema.Default" %>后台的CS代码:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace ControlsORema{ public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Write("Hello. Here's what you typed into the text box: "); Response.Write(this.TextBox1.Text); Response.Write(""); Response.Write("And the selected item is: "); Response.Write(this.DropDownList1.SelectedItem.Text); } }}
转载地址:http://gnbqb.baihongyu.com/