asp.net does not support multiple runat=server forms on the same page, to solve this problem, you can place each form in a separate panel control so that users can simply switch between different panel through radio buttons.
The code is as follows:
2formexample.aspx
Namespace _3leaf_app
{
Using System;
Using System.Collections;
Using System.ComponentModel;
Using System.Data;
Using System.Drawing;
Using System.Web;
Using System.Web.SessionState;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.HtmlControls;
protected void Page_Init (object sender, EventArgs e)
{
//
Codegen:this the call are required by the asp+ Windows Form Designer.
//
InitializeComponent ();
}
<summary>
Required to Designer support-do not modify
The contents is with the Code Editor.
</summary>
private void InitializeComponent ()
{
Radiobutton1.checkedchanged + = new System.EventHandler (this. radiobutton1_checkedchanged);
Button1.Click + = new System.EventHandler (this. Button1_Click);
Radiobutton2.checkedchanged + = new System.EventHandler (this. radiobutton2_checkedchanged);
Button2.click + = new System.EventHandler (this. button2_click);
This. Load + = new System.EventHandler (this. Page_Load);
}
public void button2_click (object sender, System.EventArgs e)
{
Label1.Text = "You want to search on the last name";
}
public void button1_click (object sender, System.EventArgs e)
{
Label1.Text = "You want to search on the name of";
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.