locked
Filtering NULL Values by URL RRS feed

  • Question

  • User-1087571539 posted

    Hello,

    I have a DD project including some custom pages like an entry page displaying different "statistics". One of this informations shows the number of users who are not assigned to a specific project. Due to my model, this are all users who have not set a Project ID (Foreign Key to Project Table). 

    I want to build a hyperlink that forwards to the List.aspx Page of the Users, only showing all not assigned Users. The link to show all Users assigned to a specific Project would be:

    http://somewebsite/Users/List.aspx?Project.ID=123

    But how to filter on Users who are not yet assigned to a project, like:

    http://somewebsite/Users/List.aspx?Project.ID=[null]

    Regards,
    Christoph 
    Monday, August 8, 2011 4:08 AM

Answers

  • User-1516073966 posted

    Do not pass anything to the list page then it would be requesting for all users. If you pass the project id then show the users for the project.

    If(Request.QueryString["ProductID"] == null)
    { 
        //List all users.
    }
    else
    {
       //Logic to display users specific to the project.
    }
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 8, 2011 4:24 AM
  • User-330204900 posted

    What ever you decide to do you must set the filter to the [Not Set] value in the DDL

    // Set the initial value if there is one
    string initialValue = DefaultValue;
    if (!String.IsNullOrEmpty(initialValue))
        DropDownList1.SelectedValue = initialValue;

    This code is where the value is set  you will need to test for your special value forst then set the selected value to NullValueString.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 8, 2011 4:38 AM

All replies

  • User-1516073966 posted

    Do not pass anything to the list page then it would be requesting for all users. If you pass the project id then show the users for the project.

    If(Request.QueryString["ProductID"] == null)
    { 
        //List all users.
    }
    else
    {
       //Logic to display users specific to the project.
    }
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 8, 2011 4:24 AM
  • User-330204900 posted

    What ever you decide to do you must set the filter to the [Not Set] value in the DDL

    // Set the initial value if there is one
    string initialValue = DefaultValue;
    if (!String.IsNullOrEmpty(initialValue))
        DropDownList1.SelectedValue = initialValue;

    This code is where the value is set  you will need to test for your special value forst then set the selected value to NullValueString.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 8, 2011 4:38 AM