0

I want to check if certain values exist in a table based on ID in the DetailView. For instance, i have 4 fields in the table:

ID Approved1 Approved2 Approved3

A)First i want to check if Approved1, Approved2, Approved3 are not null, meaning the values are either Yes or No for all the 3 fields. If anyone of them is null or blank then i want to quit the function

B)If all Approved(*) fields have a value of "YES" based on the selected ID in the DetailView then i want to call some function; C)If one of the Approved fields is "NO" then i want to call some other function.

I have so far the followings but not sure how to put it together. thanks here is my aspx file

 <asp:DetailsView ID="DV_Mgr_Appr" runat="server" Height="50px" Width="867px" AutoGenerateRows="False"
            BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
            CellPadding="3" DataKeyNames="ID" DataSourceID="DV_ManagerApp_DS" GridLines="Horizontal"
            DefaultMode="Edit">
            <AlternatingRowStyle BackColor="#CCCCFF" />
            <EditRowStyle BackColor="#FFFFE1" Font-Bold="True" ForeColor="#003366" />
            <Fields>
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" />
'''
'''
'''
'''
<asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:Button ID="Button1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Save Changes" />
                        &nbsp;<asp:Button ID="Button2" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Visible="false" Text="Cancel" />
                    </EditItemTemplate>
                    <ItemTemplate>
</asp:DetailsView>
moe
  • 5,149
  • 38
  • 130
  • 197
  • you want to check these when loading data into detailsView or when user clicks on the save button ? – mohsen dorparasti Oct 29 '12 at 19:41
  • i want to check it when the user clicks the save button. thanks – moe Oct 29 '12 at 19:42
  • by the way , I can't see any relation between your question title and the content of question . I think reviewing and editing it could grab more users to check the question – mohsen dorparasti Oct 29 '12 at 19:53
  • can anyone help please? thanks – moe Oct 29 '12 at 21:38
  • any help here.. i am really stuck on this issue and i know what else to do... – moe Oct 31 '12 at 00:41
  • your question is not clear , what are those lines of dots in the code ? when do you want to check if Approved1, Approved2, Approved3 are not null? what do you mean , If all Approved(*) fields have a value of "YES" based on the selected ID ? data for the fields are provided by user or are readonly and loaded from datatable ? user should enter the word 'yes' or he just should select a checkbox ?and most importantly what do you mean "Check if values exist in a table" ? you mean you want to check if values that user has provided has a match in the table ?what is the type of fields in table – mohsen dorparasti Oct 31 '12 at 04:54

0 Answers0