ASP.NET uses multiple runat = Server Forms

xiaoxiao2021-03-06  85

Author: Unknown ASP.NET on the same page does not support multiple runat = server forms, to solve this problem, you can put each on a separate form of panel controls, so users can simply by radio buttons in different PANEL swap.

Code is as follows: 2FormExample.aspx <% @ Page language = "c #" Codebehind = "2FormExample.cs" AutoEventWireup = "false" Inherits = "_ 3leaf_app.C2FormExample"%>

Lookup by

First Name: last name: <

asp: RequiredFieldValidator id = RequiredFieldValidator2 runat = "server" ErrorMessage = "*" ControlToValidate = "TextBox2">

< /html>2FormExample.csnamespace _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; ///

/// Summary description for C2FormExample /// public class C2FormExample: System.Web.UI.Page. {protected System.Web.UI.WebControls.Button Button2; protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2; protected System.Web.UI.WebControls.TextBox TextBox2; protected Syste m.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.Label Label1; protected System. Web.UI.WebControls.Panel Panel2; protected System.Web.UI.WebControls.Panel Panel1; protected System.Web.UI.WebControls.RadioButton radioButton2; protected System.Web.UI.WebControls.RadioButton RadioButton1; public C2FormExample () { Page.init = New System.EventHandler (Page_init);

转载请注明原文地址:https://www.9cbs.com/read-98517.html

New Post(0)