; <span style="color: darkolivegreen">这是View3!</span></asp:View>
</asp:MultiView></fieldset>
</div>
</form>
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MultiView1.ActiveViewIndex = 0;
}
}
protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
{
switch (MultiView1.ActiveViewIndex)
{
case 0:
btnView1.BorderStyle = BorderStyle.Inset;
btnView2.BorderStyle = BorderStyle.NotSet;
btnView3.BorderStyle = BorderStyle.NotSet;
break;
case 1:
btnView2.BorderStyle = BorderStyle.Inset;
btnView1.BorderStyle = BorderStyle.NotSet;
btnView3.BorderStyle = BorderStyle.NotSet;
break;
case 2:
btnView3.BorderStyle = BorderStyle.Inset;
btnView1.BorderStyle = BorderStyle.NotSet;
btnView2.BorderStyle = BorderStyle.NotSet;
break;
}
}
protected void btnView1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
  |