我在asp.net代码中添加了按钮。但它显示为禁用。即使在asp.net中启用按钮也会显示禁用
这是我的代码。
TableCell cell15 = new TableCell();
cell15.Width = 100;
cell15.HorizontalAlign = HorizontalAlign.Left;
Button Apply = new Button();
Apply.ID = "Apply_Button";
Apply.Text = "Apply";
Apply.Width = 50;
Apply.Height = 20;
Apply.Visible = true;
Apply.ViewStateMode = System.Web.UI.ViewStateMode.Inherit;
Apply.UseSubmitBehavior = true;
Apply.CausesValidation = true;
Apply.ClientIDMode = System.Web.UI.ClientIDMode.Inherit;
Apply.EnableTheming = true;
Apply.CausesValidation = true;
Apply.Enabled = true;
Apply.OnClientClick = Apply_Click(sender, e);
cell15.Controls.Add(Apply);
row8.Cells.Add(cell15);
生成的HTML是:
<input type="submit" name="ctl00$MainContent$Apply_Button" value="Apply"
disabled="disabled" id="MainContent_Apply_Button" style="height:20px;width:50px;">
什么HTML是它产生的?请使用“检查元素”并将其粘贴到此处。 – Shaharyar
–
你有没有'javascript'用于'enable'或'disable'按钮? – Shaharyar