Моя кнопка управления asp по какой-то причине не затрагивает мой код.Любая идея, почему?
HTML:
<td class="auto-style2">
<asp:Button ID="btnEmailSelectedTotal"
runat="server"
Enabled="true"
Text="Email Selected Members"
OnClick="btnEmailSelectedTotal_Click"/>
</td>
Код:
protected void btnEmailSelectedTotal_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "myalert",
"alert('" + "Got here" + "');", true);
//build our cust GUID list based off each row that was checked by pulling
//the hidden data from HiddenField_CustGUID for the corresponding checked row
var lstCustGuid = new List<string>();
var isEmailAll = true;
PopulateCookieValues((int)Cookie.HeaderTotal);
//first get the check box list. If we find a list item that is
//un-checked, assume this is not an email all
foreach (GridViewRow rw in GridView_TotalCounts.Rows)
{
var chkBx = (CheckBox)rw.FindControl("EmailCheckbox");
if (chkBx != null && chkBx.Checked)
{
lstCustGuid.Add(((HiddenField)rw.FindControl("HiddenField_CustGUID")).Value);
}
else if (chkBx != null && !chkBx.Checked)
{
//this is not email all. we discovered an un-checked checkbox.
isEmailAll = false;
}
}
if (!string.IsNullOrEmpty(Cookies.Header.Total) &&
Cookies.Header.Total == "true" && isEmailAll)
{
//header is checked - this is email all
//populate it with the full email guid list from the hidden field:
lstCustGuid = HF_Total_FullEmailList.Value.Split(',').ToList();
}
NavigateToSendEmail(lstCustGuid);
}
Как вы можете видеть выше, мой первый элемент, который я нажимаю, - это окно сообщения.Даже это не вызывается.Есть идеи, почему onclick
полностью игнорирует мой код?Что я могу попробовать исправить?
Я пробовал это в 2 разных браузерах, а также очистил кеш;не помогло.
Большое спасибо за помощь!