任何人都可以帮助我吗?当我将 requiredfieldvalidator 放在我的创建事件的选项卡容器上时,我无法更新另一个选项卡上的表单视图 >>> 编辑事件的选项卡。我完全不知道会发生什么,当我反复试验时,我发现 requiredfieldvalidator 是导致我的 formview 停止更新到我的数据库中的那个。而且我这个 requiredfieldvalidator 在另一个选项卡上,那么它是如何影响的?!?!?请指定或显示,例如,因为我真的很新而且很糟糕!
这是创建选项卡的代码>>>
<asp:TextBox ID="tb_eventName" runat="server" ValidationGroup="vg"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="tb_eventName" ErrorMessage="Enter event"
ForeColor="Red" ValidationGroup="vg" SetFocusOnError="True" >* </asp:RequiredFieldValidator>
<asp:Button ID="bn_createEvent" runat="server"
Text="Create Event" onclick="bn_createEvent_Click" ValidationGroup="vg"/>`
这是编辑事件选项卡的代码>>>
<asp:FormView ID="FormView1" runat="server" CellPadding="4" DataKeyNames="eventID"
DataSourceID="SqlDataSource2"
OnItemDeleted="FormView1_ItemDeleted" OnItemInserted="FormView1_ItemInserted"
OnItemUpdated="FormView1_ItemUpdated" ForeColor="Black" BackColor="White"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
GridLines="Vertical" >
<EditItemTemplate>
ID:
<asp:Label ID="eventIDLabel1" runat="server" Text='<%# Eval("eventID") %>' />
<br />
<br />
Name:         
<asp:TextBox ID="eventNameTextBox" runat="server"
Text='<%# Bind("eventName") %>' />
  
<br />
<br />
Date:           
<asp:TextBox ID="eventDateTextBox" runat="server"
Text='<%# Bind("eventDate") %>' />
<br />
<br />
Start-Time: 
<asp:TextBox ID="eventStartTimeTextBox" runat="server"
Text='<%# Bind("eventStartTime") %>' />
<br />
<br />
End-Time:   
<asp:TextBox ID="eventEndTimeTextBox" runat="server"
Text='<%# Bind("eventEndTime") %>' />
<br />
<br />
Location:     
<asp:TextBox ID="eventLocationTextBox" runat="server"
Text='<%# Bind("eventLocation") %>' />
<br />
<br />
Email:          
<asp:TextBox ID="eventEmailTextBox" runat="server"
Text='<%# Bind("eventEmail") %>' />
<br />
<br />
Contact No: 
<asp:TextBox ID="eventContactNoTextBox" runat="server"
Text='<%# Bind("eventContactNo") %>' />
<br />
<br />
Description:
<asp:TextBox ID="eventDescriptionTextBox" runat="server"
Text='<%# Bind("eventDescription") %>' />
<br />
<br />
Image:        
<asp:TextBox ID="eventImageTextBox" runat="server"
Text='<%# Bind("eventImage") %>' />
<br />
<br />
<asp:LinkButton ID="UpdateButton" runat="server"
CommandName="Update" Text="Update" />
`
添加 requiredfieldvalidator 后,它不会将我的表单视图更新到数据库