Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3948540
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:23:13+00:00 2026-05-20T01:23:13+00:00

I have a dropdown list on my form which should filter out or display

  • 0

I have a dropdown list on my form which should filter out or display my tag cloud for an entire project or for a specific iteration. It’s strange though, because I get different results when I select certain iterations from the list. Sometimes the ascx control doesn’t display at all, sometimes it displays a tag cloud, but it’s incorrect, and sometimes it displays the right one. I have no idea why this is happening… Thanks in advance for your help!

displaycloud.aspx:

<asp:DropDownList ID="filteroptions" runat="server" onselectedindexchanged="filteroptions_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>   

<asp:UpdatePanel ID="UpdateIteration" runat="server">
<ContentTemplate>                         
   <TagCloud:TagCloudControl ID="TagCloudControl1" runat="server" />  
</ContentTemplate>                 
<Triggers>                     
   <asp:AsyncPostBackTrigger ControlID="filteroptions" />                
</Triggers>  
</asp:UpdatePanel> 

displaycloud.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
{
    proj_name = Request.QueryString["project"].ToString();
    proj_id = Request.QueryString["id"].ToString();

    SqlConnection conn = new SqlConnection(GetConnectionString());
    conn.Open();

    cmd = new SqlCommand("Select CONVERT(VARCHAR(10), StartDate, 103) + ' - ' + CONVERT(VARCHAR(10), EndDate, 103) AS Iteration, ProjectIterationID FROM Iterations WHERE ProjectID = '" + proj_id + "'", conn);

    cmd.CommandType = CommandType.Text;

    SqlDataAdapter da = new SqlDataAdapter(cmd);

    DataSet ds = new DataSet();

    da.Fill(ds);;

    conn.Close();

    if (!Page.IsPostBack)
    {
        filteroptions.DataSource = ds;
        filteroptions.DataTextField = "Iteration";
        filteroptions.DataValueField = "ProjectIterationID";
        filteroptions.DataBind();

        filteroptions.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Entire Project", "0"));

    }
}


protected void filteroptions_SelectedIndexChanged(object sender, EventArgs e)
{

    string selected_iteration = filteroptions.SelectedValue;
    Session["iteration"] = selected_iteration;

}

ASCX CS FILE:

protected void Page_Load(object sender, EventArgs e)
{
    proj_name = Request.QueryString["project"].ToString();
    proj_id = Request.QueryString["id"].ToString();


    if (String.IsNullOrEmpty((string)Session["iteration"]))
    {
        iteration = "0";
    }
    else
    {
        iteration = (string)Session["iteration"];
    }

    BindTagCloud();


}

private void BindTagCloud()
{

    int pro_id = Convert.ToInt32(proj_id);
    int iteration_id = Convert.ToInt32(iteration);

    var tagSummaryNegative = from af in db.AgileFactors
                     join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                     join s in db.Stories on psf.StoryID equals s.StoryID
                     join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                     join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                     join pro in db.Projects on it.ProjectID equals pro.ProjectID
                     where pro.ProjectID == pro_id &&
                           pro.ProjectID == it.ProjectID &&
                           it.ProjectIterationID == pim.ProjectIterationID &&
                           pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 1 &&
                           s.StoryID == psf.StoryID &&
                           psf.AgileFactorID == af.AgileFactorID
                     group af by af.Name into tagGroup

                     select new
                     {

                         Tag = tagGroup.Key,
                         tagCount = tagGroup.Count()

                     };

    var tagSummaryNegativeIteration = from af in db.AgileFactors
                             join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                             join s in db.Stories on psf.StoryID equals s.StoryID
                             join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                             join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                             join pro in db.Projects on it.ProjectID equals pro.ProjectID
                             where pro.ProjectID == pro_id &&
                                   pro.ProjectID == it.ProjectID &&
                                   it.ProjectIterationID == iteration_id &&
                                   it.ProjectIterationID == pim.ProjectIterationID &&
                                   pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 1 &&
                                   s.StoryID == psf.StoryID &&
                                   psf.AgileFactorID == af.AgileFactorID
                             group af by af.Name into tagGroup

                             select new
                             {

                                 Tag = tagGroup.Key,
                                 tagCount = tagGroup.Count()

                             };

    var tagSummaryPositive = from af in db.AgileFactors
                             join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                             join s in db.Stories on psf.StoryID equals s.StoryID
                             join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                             join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                             join pro in db.Projects on it.ProjectID equals pro.ProjectID
                             where pro.ProjectID == pro_id &&
                                   pro.ProjectID == it.ProjectID &&
                                   it.ProjectIterationID == pim.ProjectIterationID &&
                                   pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 0 &&
                                   s.StoryID == psf.StoryID &&
                                   psf.AgileFactorID == af.AgileFactorID
                             group af by af.Name into tagGroup

                             select new
                             {

                                 Tag = tagGroup.Key,
                                 tagCount = tagGroup.Count()

                             };

    var tagSummaryPositiveIteration = from af in db.AgileFactors
                             join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                             join s in db.Stories on psf.StoryID equals s.StoryID
                             join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                             join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                             join pro in db.Projects on it.ProjectID equals pro.ProjectID
                             where pro.ProjectID == pro_id &&
                                   pro.ProjectID == it.ProjectID &&
                                   it.ProjectIterationID == iteration_id &&
                                   it.ProjectIterationID == pim.ProjectIterationID &&
                                   pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 0 &&
                                   s.StoryID == psf.StoryID &&
                                   psf.AgileFactorID == af.AgileFactorID
                             group af by af.Name into tagGroup

                             select new
                             {

                                 Tag = tagGroup.Key,
                                 tagCount = tagGroup.Count()

                             };


    int maxTagFrequencyNegative = (from t in tagSummaryNegative select (int?)t.tagCount).Max() ?? 0;
    int maxTagFrequencyPositive = (from t in tagSummaryPositive select (int?)t.tagCount).Max() ?? 0;

    int maxTagFrequencyNegativeIteration = (from t in tagSummaryNegativeIteration select (int?)t.tagCount).Max() ?? 0;
    int maxTagFrequencyPositiveIteration = (from t in tagSummaryPositiveIteration select (int?)t.tagCount).Max() ?? 0;


    var tagCloudNegative = from af in db.AgileFactors
                   join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                   join s in db.Stories on psf.StoryID equals s.StoryID
                   join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                   join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                   join pro in db.Projects on it.ProjectID equals pro.ProjectID
                   where pro.ProjectID == pro_id &&
                         pro.ProjectID == it.ProjectID &&
                         it.ProjectIterationID == pim.ProjectIterationID &&
                         pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 1 &&
                         s.StoryID == psf.StoryID &&
                         psf.AgileFactorID == af.AgileFactorID
                   group af by af.Name into tagGroup
                   select new
                   {

                       Tag = tagGroup.Key,
                       weight = (double)tagGroup.Count() / maxTagFrequencyNegative * 100
                   };

    var tagCloudNegativeIteration = from af in db.AgileFactors
                           join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                           join s in db.Stories on psf.StoryID equals s.StoryID
                           join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                           join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                           join pro in db.Projects on it.ProjectID equals pro.ProjectID
                           where pro.ProjectID == pro_id &&
                                 pro.ProjectID == it.ProjectID &&
                                 it.ProjectIterationID == iteration_id &&
                                 it.ProjectIterationID == pim.ProjectIterationID &&
                                 pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 1 &&
                                 s.StoryID == psf.StoryID &&
                                 psf.AgileFactorID == af.AgileFactorID
                           group af by af.Name into tagGroup
                           select new
                           {

                               Tag = tagGroup.Key,
                               weight = (double)tagGroup.Count() / maxTagFrequencyNegative * 100
                           };

    var tagCloudPositive = from af in db.AgileFactors
                           join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                           join s in db.Stories on psf.StoryID equals s.StoryID
                           join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                           join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                           join pro in db.Projects on it.ProjectID equals pro.ProjectID
                           where pro.ProjectID == pro_id &&
                                 pro.ProjectID == it.ProjectID &&
                                 it.ProjectIterationID == pim.ProjectIterationID &&
                                 pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 0 &&
                                 s.StoryID == psf.StoryID &&
                                 psf.AgileFactorID == af.AgileFactorID
                           group af by af.Name into tagGroup
                           select new
                           {

                               Tag = tagGroup.Key,
                               weight = (double)tagGroup.Count() / maxTagFrequencyNegative * 100
                           };

    var tagCloudPositiveIteration = from af in db.AgileFactors
                                    join psf in db.ProjectStoryFactors on af.AgileFactorID equals psf.AgileFactorID
                                    join s in db.Stories on psf.StoryID equals s.StoryID
                                    join pim in db.ProjectIterationMembers on s.ProjectIterationMemberID equals pim.ProjectIterationMemberID
                                    join it in db.Iterations on pim.ProjectIterationID equals it.ProjectIterationID
                                    join pro in db.Projects on it.ProjectID equals pro.ProjectID
                                    where pro.ProjectID == pro_id &&
                                          pro.ProjectID == it.ProjectID &&
                                          it.ProjectIterationID == iteration_id &&
                                          it.ProjectIterationID == pim.ProjectIterationID &&
                                          pim.ProjectIterationMemberID == s.ProjectIterationMemberID && s.StoryCategoryID == 0 &&
                                          s.StoryID == psf.StoryID &&
                                          psf.AgileFactorID == af.AgileFactorID
                                    group af by af.Name into tagGroup
                                    select new
                                    {

                                        Tag = tagGroup.Key,
                                        weight = (double)tagGroup.Count() / maxTagFrequencyNegative * 100
                                    };

    if (iteration_id != 0)
    {
        ListView1.DataSource = tagCloudNegativeIteration;
        ListView1.DataBind();

        ListView2.DataSource = tagCloudPositiveIteration;
        ListView2.DataBind();

    }
    else
    {
        ListView1.DataSource = tagCloudNegative;
        ListView1.DataBind();

        ListView2.DataSource = tagCloudPositive;
        ListView2.DataBind();


    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:23:14+00:00Added an answer on May 20, 2026 at 1:23 am

    As I understood you use filteroptions_SelectedIndexChanged method to put selected iteration into session. And then use value from session on tag cloud control to bind correct data. However event handlers are executed after page’s and control’s load events. I suggest you binding tag cloud at some later point of time (Page_PreRender for instance).

    Edit:
    I think you should replace your Page_Load method in the ASCX.CS file with following snippet:

        protected void Page_Load(object sender, EventArgs e)
        {
            proj_name = Request.QueryString["project"].ToString();
            proj_id = Request.QueryString["id"].ToString();
        }
    
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty((string)Session["iteration"]))
            {
                iteration = "0";
            }
            else
            {
                iteration = (string)Session["iteration"];
            }
    
            BindTagCloud();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have dropdown list control in one of my application and when I add
I have a dropdown list that stores name/value pairs. The dropdown appears in each
So, I have an autocomplete dropdown with a list of townships. Initially I just
I am using Spring Web MVC for my application. I have 1 dropdown list
I am working on a jquery code that has a form country dropdown list
I have a drop-down list with known values. What I'm trying to do is
Suppose I have a drop-down list like: <select id='list'> <option value='1'>Option A</option> <option value='2'>Option
Does anyone know how many options a drop down list can have? Is it
I'd like to add a drop-down list to a Windows application. It will have
I have a dropdownlist in a page. The values of all the list items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.