提交後什麼也沒有發生:在Windows Server 2008和Visual Studio 2010和Windows Vista與Visual Studio 2008很奇怪的問題:在測試的ASPX網頁
以下unusuall的問題已經顯現。
我有一個用戶控件和網站控制將顯示。 如果即時檢查控件的單選按鈕,並點擊提交,這也是在裏面ctrol沒有發生。沒有要求服務器,只是沉默。
一切看起來不錯,標準,但我無法找到問題。請幫忙,因爲它煩人!
usercontrol.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EmployeeCategorizationControl.ascx.cs"
Inherits="EmployeeCategorizationControl.EmployeeCategorizationControl" %>
<div id="categorizationOfEmployee">
<div>Categorization od Employee</div><br />
<div id="firstCategory">
<div style="float: left; width: 250px;">
Is not a permanent employee</div>
<div>
<asp:RadioButtonList ID="YesNoIsNotPermanentEmployee" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div id="secondCategory">
<div style="float: left; width: 250px;">
Is a fixed-term employee</div>
<div>
<asp:RadioButtonList ID="YesNoIsFixedTermEmployee" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div id="thirdCategory">
<div style="float: left; width: 250px;">
No external recruit</div>
<div>
<asp:RadioButtonList ID="YesNoExternalRecruit" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div id="btCreate" style="margin-left: 200px; margin-top: 10px;">
<asp:Button runat="server" Text="Create Checklist" ID="btCreateChecklist" />
</div>
</div>
usercontrol.ascx.cs:
protected void Page_Load(object sender, EventArgs e)
{
btCreateChecklist.Click += new EventHandler(btCreateChecklist_Click);
}
void btCreateChecklist_Click(object sender, EventArgs e)
{
ValueOfIsNotPermanentEmployee = YesNoIsNotPermanentEmployee.Text;
ValueOfIsFixedTermEmployee = YesNoIsFixedTermEmployee.Text;
ValueOfNoExternalRecruit = YesNoExternalRecruit.Text;
UserCategoryID = ValueOfIsNotPermanentEmployee + ValueOfIsFixedTermEmployee + ValueOfNoExternalRecruit;
}
的Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EmployeeCategorizationControl._Default" %>
<%@ Register TagPrefix="UserControl" TagName="EmployeeCategorizationControl" Src="~/EmployeeCategorizationControl.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<UserControl:EmployeeCategorizationControl runat="server" />
</div>
</form>
</body>
</html>
無法重現問題(VS2008,.NET3.5,ASP.NET開發服務器)。這是唯一的頁面/用戶控件無法回發? – mika 2011-06-10 10:55:51
你可以試試這個: –
2GDev
2011-06-10 11:02:41