Cannot return Args for FormView in OnItemUpdating when using TabPanel

Last post 10-31-2007 1:17 PM by XDI. 0 replies.

Sort Posts:

  • Cannot return Args for FormView in OnItemUpdating when using TabPanel

    10-31-2007, 1:17 PM
    • Member
      point Member
    • XDI
    • Member since 10-31-2007, 12:58 PM
    • Posts 1

    I have a FormView and I have a TabPanel in the EditTemplate portion of the FormView. The Form comes up fine, but when the OnItemUpdating is triggered Ithe Args.NewValues returns an empty value. Additionally I cant save the data to my Stored Procedure becuase Null values are returned from the form although all fields are entered.

    If I take the Panel out everything works fine

    Sub Validate_Runs_Update(ByVal Src As Object, ByVal Args As FormViewUpdateEventArgs)
    Dim ErrorMSGLabel As Label
    Dim PanelContainer_tmp As TabContainer
    Dim TabPanel_tmp As TabPanel

    PanelContainer_tmp = FormView_Runs.FindControl("TabContainer_Run")
    TabPanel_tmp = PanelContainer_tmp.FindControl("TabPanel_RunInfo")
    ErrorMSGLabel = TabPanel_tmp.FindControl("lbl_ErrorMSGLabel")


    ErrorMSGLabel.Text = ""
    If Not IsDate(Args.NewValues("Rec_date")) Then
        Args.Cancel = True
        ErrorMSGLabel.Text = "-- Rec Date cannot be empty and Must be a date ex: mm/dd/yyyy"
    ElseIf Args.NewValues("case_no") = "" Then
        Args.Cancel = True
        ErrorMSGLabel.Text = "-- Case No cannot be empty"
    End If

    If Args.Cancel = True Then
     ErrorMSGLabel.Text = "INPUT ERROR:<br>" & ErrorMSGLabel.Text
    End If

    End Sub

     

     

    <asp:FormView ID="FormView_Runs" runat="server" DataSourceID="SqlDataSource_Runs"

    DefaultMode="edit"

     

    OnItemUpdating="Validate_Runs_Update"

    DataKeyNames="rec_id">

    <EditItemTemplate>

     

    <table class="FormBlackText" border="1" width="670px" style="border-color: Navy;

    background-color: #AFEEEE;">

    <tr>

    <td align="center">

    <asp:Label ID="Rec_title" runat="server" CssClass="FormTitle" Text="Rec "></asp:Label>

    </td>

    </tr>

    </table>

     

    <cc1:TabContainer Width="670px" ID="TabContainer_Run" runat="server" ActiveTabIndex="0"

    CssClass="ajax__custom" BorderWidth="0">

    <cc1:TabPanel ID="TabPanel_RunInfo" runat="server" HeaderText="Run Information">

    <ContentTemplate>

    <table class="FormBlackText" border="1" width="650px" style="border-color: Navy;

    background-color: #AFEEEE;">

    <tr>

    <td align="center" colspan="2">

    <table class="FormBlackText" border="0" width="100%">

    <tr>

    <td align="left">

    <asp:Label ID="lbl_ErrorMSGLabel" runat="server" Text="" CssClass="FormRedError"></asp:Label>

    </td>

    </tr>

    </table>

    </td>

    </tr>

    <tr>

    <td align="left" colspan="2">

    <table class="FormBlackLabel" style="border-color: Navy; background-color: #AFEEEE;">

    <tr>

    <td align="left">

    Rec ID:

    </td>

    <td align="left">

    <asp:Label CssClass="FormBlackText" ID="lbl_rec_id" runat="server" Text='<%# Bind("rec_id") %>'></asp:Label>

    </td>

    </tr>

    </table>

    <table class="FormBlackText" style="border-color: Navy; background-color: #AFEEEE;">

    <tr>

    <td align="left">

    Date

    </td>

    <td align="left">

    <asp:TextBox ID="rec_date" runat="server" Text='<%# Bind("rec_date", "{0:d}") %>'

    CssClass="FormBlackText" Width="75px" MaxLength="10"></asp:TextBox>

    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="Date" TargetControlID="rec_date"

    Mask="99/99/9999">

    </cc1:MaskedEditExtender>

    </td>

    <td align="left">

    Case No

    </td>

    <td align="left">

    <asp:TextBox ID="case_no" runat="server" Text='<%# Bind("case_no") %>' CssClass="FormBlackText"

    Width="120px" MaxLength="20"></asp:TextBox>

    </td>

Page 1 of 1 (1 items)