протестировано на: Windows Server 2008 с Visual Studio 2010 и Windows Vista с Visual Studio 2008.
появилась следующая необычная проблема.
У меня есть пользовательский контроль и веб-сайт, на котором будет показан элемент управления,если я проверяю переключатели управления и нажимаю на кнопку отправки, которая также находится внутри 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>