-1
我想用下面的代碼添加驗證到我的頁面。但它給了一個錯誤:頁面驗證
CS1525:無效的表達術語「}」
我檢查了所有括號他們都需要。有人可以幫幫我嗎。
private Boolean pageValidate()
{
try
{
if (TextBox4.Text == "")
{
alert("Please Semester and year of 1st class attended at OU* ");
return (false);
}
else if (DropDownList1.SelectedValue.Substring(0, 2) == "--")
{
alert("Please select your current major.");
return (false);
}
else if (UpdatedClass1.SelectedValue.Substring(0, 2) == "--")
{
alert("Please select one action.");
return (false);
}
else if (UpdateClassRadioButton1.SelectedValue.Substring(0, 2) == "--")
{
alert("Please select Major/Minor.");
return (false);
}
else if (DropdownListMajorMinor.SelectedValue.Substring(0, 2) == "--")
{
alert("Please select the change of major/Minor you are requesting..");
return (false);
}
else
return (true);
}
catch (Exception e)
{
return (false);
}
}
protected void btnSubmit1_Click(object sender, System.EventArgs e)
{
if (pageValidate())
// Internweb.DBManipulator dbMangler = new DBManipulator();
// dbMangler.InsertValuesIntoDB(TextBox4.Text, CheckBox1.Checked, CheckBox2.Checked, DropDownList1.Items, DropdownListMajorMinor.Items,);
}
錯誤消息:CS1525:無效的表達術語 '}'
感謝您的回覆。有效 :) – amc