Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    MN
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing dropdown options affects update button in formview

    I am having a strange issue. I am using ASP.NET with C# inside a SharePoint webpart. My controls are on a formview and the third dropdown is dependent on the second dropdown so I am saving all the options in a javascript array and unloading and reloading options in the third dropdown depending on the choice of the second. From what I've been able to diagnose, it is when this routine runs to change the options in the dropdown that the update button of the formview does not work properly and cycles the page but with no update commands/parameters. Has anyone run into this and is there a way of fixing it?

    Some of my formview looks like this:
    <asp:FormView ID="fvSectorRoutingDetails" runat="server" DataSourceID="odsSectorRoutingDetails" OnDataBound="fvSectorRoutingDetails_DataBound"
    DataKeyNames="SectorUid" DefaultMode="Edit" OnItemUpdating="fvSectorRoutingDetails_Updating">
    <EditItemTemplate>
    <table style="width: 950px">
    <tr>
    <td style="width: 315px">
    Region<br />
    <aspropDownList ID="ddlRegion" runat="server" SelectedValue='<%# Bind("PsapRegion") %>' DataSourceID="odsRegionDropdown"
    DataTextField="Text" DataValueField="Text" AppendDataBoundItems="true" onchange="SwapPsapLocation(this.value)">
    <asp:ListItem Text="-- Choose --" Value="Unknown"></asp:ListItem>
    </aspropDownList>
    <asp:RequiredFieldValidator ID="Required_Region" runat="server" ErrorMessage="Region is required." Display="None"
    ControlToValidate="ddlRegion" InitialValue="Unknown" SetFocusOnError="true" ValidationGroup="SectorRoutingDetails" Enabled='<%# Eval("RoutingStatus") == "APPROVED" %>'>
    *</asp:RequiredFieldValidator>
    </td>
    <td style="width: 350px">
    PSAP Location<br />
    <aspropDownList ID="ddlPsapLocation_0" runat="server" DataSourceID="odsPsapLocationDropdown_0"
    DataTextField="Text" DataValueField="Text" AppendDataBoundItems="true" onchange="FillEsn(this.value);FillHidLocation(this.value)">
    <asp:ListItem Text="-- Choose --" Value="Unknown"></asp:ListItem>
    </aspropDownList>
    <aspropDownList ID="ddlPsapLocation_1" runat="server" DataSourceID="odsPsapLocationDropdown_1"
    DataTextField="Text" DataValueField="Text" AppendDataBoundItems="true" onchange="FillEsn(this.value);FillHidLocation(this.value)">
    <asp:ListItem Text="-- Choose --" Value="Unknown"></asp:ListItem>
    </aspropDownList>
    <asp:TextBox ID="txtPsapLocation" runat="server" Text='<%# Bind("PsapLocation") %>' style="display:none"></asp:TextBox>
    <asp:RequiredFieldValidator ID="Required_PsapLocation_0" runat="server" ErrorMessage="PSAP Location is required." Display="None"
    ControlToValidate="ddlPsapLocation_0" InitialValue="Unknown" SetFocusOnError="true" ValidationGroup="SectorRoutingDetails" Enabled="false">
    *</asp:RequiredFieldValidator>
    <asp:RequiredFieldValidator ID="Required_PsapLocation_1" runat="server" ErrorMessage="PSAP Location is required." Display="None"
    ControlToValidate="ddlPsapLocation_1" InitialValue="Unknown" SetFocusOnError="true" ValidationGroup="SectorRoutingDetails" Enabled="false">
    *</asp:RequiredFieldValidator>
    </td>
    <td style="width: 315px">
    Wireless ESN<br />
    <aspropDownList ID="ddlWirelessEsn" runat="server" onchange="FillHidEsn(this.value)">
    <asp:ListItem Text="-- Choose --" Value="Unknown"></asp:ListItem>
    </aspropDownList>
    <asp:TextBox ID="txtWirelessEsn" runat="server" Text='<%# Bind("PsapEsn") %>' style="display:none"></asp:TextBox>
    <asp:RequiredFieldValidator ID="Required_WirelessEsn" runat="server" ErrorMessage="Wireless ESN is required." Display="None"
    ControlToValidate="ddlWirelessEsn" InitialValue="Unknown" SetFocusOnError="true" ValidationGroup="SectorRoutingDetails" Enabled='<%# Eval("RoutingStatus") == "APPROVED" %>'>
    *</asp:RequiredFieldValidator>
    </td>
    </tr>

  • #2
    New Coder
    Join Date
    Oct 2002
    Location
    MN
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I may have solved my own problem. I noticed that the validator for Wireless Esn was set on the dropdown and not the textbox which is actually bound to "PsapEsn". When I changed this, the page seems to submit the update normally again.

    Now I just have to figure out why the DataObjectTypeName is giving me an error that it can't be found or that the signature doesn't match or something.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •