Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C#
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Terick
    wrote on last edited by
    #1

    [Message Deleted]

    V 1 Reply Last reply
    0
    • T Terick

      [Message Deleted]

      V Offline
      V Offline
      vaghelabhavesh
      wrote on last edited by
      #2

      I see you are storing the selected values in Session, so you can use that value from the second page. e.g.

      Summary.aspx
      protected void Page_Load(object sender,EventArgs e)
      {
      if(!Page.IsPostBack)
      {
      Pool pool = Session["POOL"] as Pool;
      if(pool!=null)
      {
      string selectedYear = pool.Pool_Year;
      string selectedCategory = pool.Pool_Category;

        //Now you can pass the selected year and category values to the underlaying database later or query.
      

      }
      }
      }

      I hope I have not misunerstool your question. Second thing you can also pass this parameters as querystring, if there is no security concerns.

      Response.Redirect("Summary.aspx?year" +ddlYear.SelectedValue + "&category=" + dlCategory.SelectedValue);

      T 1 Reply Last reply
      0
      • V vaghelabhavesh

        I see you are storing the selected values in Session, so you can use that value from the second page. e.g.

        Summary.aspx
        protected void Page_Load(object sender,EventArgs e)
        {
        if(!Page.IsPostBack)
        {
        Pool pool = Session["POOL"] as Pool;
        if(pool!=null)
        {
        string selectedYear = pool.Pool_Year;
        string selectedCategory = pool.Pool_Category;

          //Now you can pass the selected year and category values to the underlaying database later or query.
        

        }
        }
        }

        I hope I have not misunerstool your question. Second thing you can also pass this parameters as querystring, if there is no security concerns.

        Response.Redirect("Summary.aspx?year" +ddlYear.SelectedValue + "&category=" + dlCategory.SelectedValue);

        T Offline
        T Offline
        Terick
        wrote on last edited by
        #3

        Thank you, that is what I was looking for. However, I'm not sure how to pass the value into the query because the gridview that I am using is a user control that is already populated with all of the data. I need to restrict this to just show the data that meets the criteria of the user selection, so I need to change the datasource. Any ideas on how to do this would be greatly appreciated! Thanks

        V 1 Reply Last reply
        0
        • T Terick

          Thank you, that is what I was looking for. However, I'm not sure how to pass the value into the query because the gridview that I am using is a user control that is already populated with all of the data. I need to restrict this to just show the data that meets the criteria of the user selection, so I need to change the datasource. Any ideas on how to do this would be greatly appreciated! Thanks

          V Offline
          V Offline
          vaghelabhavesh
          wrote on last edited by
          #4

          Terick wrote:

          I am using is a user control that is already populated with all of the data.

          Why are you prepopulating the gridview. I think you should populate it when you have the user selection criteria. When you get the user selection criteria, in page load bind the gridview with selection criteria. OR Can't you rebind the gridview again when you get the user selection criteria? [Edit] By rebinding I mean clear the current datasource and set the new datasource. I hope I make it clear. :-) [/Edit]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups