在Defalut.aspx.cs中给处理程序添加代码如下:
public partial class_Default:System.Web.UI.Page
{
protected void buttonSubmit_Click(object sender,EventArgs e)
{
string selectedEvent = dropDownListEvents.SelectedValue;
string firstname = textFirstname.Text;
string lastname = textLastname.text;
string email = textEmail.Text;
labelResult.Text = firstname + "" + lastname + "selected the event " + selectedEvent ;
}
}
public partial class_Default:System.Web.UI.Page
{
protected void buttonSubmit_Click(object sender,EventArgs e)
{
string selectedEvent = dropDownListEvents.SelectedValue;
string firstname = textFirstname.Text;
string lastname = textLastname.text;
string email = textEmail.Text;
labelResult.Text = firstname + "" + lastname + "selected the event " + selectedEvent ;
}
}
本文介绍了一个简单的ASP.NET应用程序示例,在此示例中,当用户点击按钮后,将从下拉列表中获取选中的事件,并结合输入框中的名字和邮箱来显示一条确认消息。
1万+

被折叠的 条评论
为什么被折叠?



