Visual Studio 2022中ASP.NET设计模式Wizard控件渲染错误求助
ASP.NET设计模式中Wizard控件渲染错误问题
我正在学习ASP.NET课程,使用Visual Studio 2022版本。目前在设计模式下遇到异常:每次使用Wizard工具时,都会提示“Error Rendering Control(控件渲染错误)”。
代码本身无问题,浏览器中运行正常,传给同学使用也能正常工作。我试过重装、修复甚至降级Visual Studio,偶尔重装后能恢复,但关闭再打开后问题又会重现。
ASP代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Panel ID="Panel1" runat="server"> <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" OnFinishedButtonClick="Wizard1_FinishButtonClick1" Width="500px" FinishCompleteButtonText="Finish" FinishPreviousButtonText="Back" StartNextButtonText="Next" StepNextButtonText="Next"> <WizardSteps> <asp:WizardStep ID="WizardStep1" runat="server" Title="About you"> <asp:Label ID="Label1" runat="server" Text="Name:"></asp:Label> <asp:TextBox ID="name" runat="server"></asp:TextBox> </asp:WizardStep> <asp:WizardStep ID="WizardStep2" runat="server" StepType="Finish" Title="Favorite Language"> <asp:DropDownList ID="FavoriteLanguage" runat="server"> <asp:ListItem>C#</asp:ListItem> <asp:ListItem>Visual Basic</asp:ListItem> <asp:ListItem>CSS</asp:ListItem> </asp:DropDownList> </asp:WizardStep> <asp:WizardStep runat="server" StepType="Finish" Title="Ready"> <asp:Label ID="resualt" runat="server" Text="Label"></asp:Label> <br /> </asp:WizardStep> </WizardSteps> </asp:Wizard> </asp:Panel> </div> </form> </body> </html>
C#代码
namespace WebApplication3 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { resualt.Text = "Your Name:" + name.Text; resualt.Text += "<br />Your Favorite Language:" + FavoriteLanguage.SelectedValue; } } }
内容的提问来源于stack exchange,提问作者lepoki5379
相关产品推荐
相关产品推荐

