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:
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.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
christoph_D
Member
4 Points
6 Posts
Filtering NULL Values by URL
Aug 08, 2011 08:08 AM|LINK
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]
<div></div> <div>Regards,</div> <div>Christoph </div>chandrasheka...
Star
10258 Points
1760 Posts
Re: Filtering NULL Values by URL
Aug 08, 2011 08:24 AM|LINK
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. }Please try the answer for the post and finally Don't forget to click “Mark as Answer” on the post that helped you.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: Filtering NULL Values by URL
Aug 08, 2011 08:38 AM|LINK
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.
Always seeking an elegant solution.