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 7005281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:19:53+00:00 2026-05-27T21:19:53+00:00

within an asp.net webform project I have a session variable that I am populating

  • 0

within an asp.net webform project I have a session variable that I am populating with data from my business object. This object contains Icollections which in turn are bound to gridviews.

   myBase.GetAssocMInvolvedPeople(); //call to Business object
   if (myBase.AssocMInvolvedPeople != null)
    {
     Session["sessBase"] = myBase; //sync session with object results 
     gv_Names.DataSource = myBase.AssocMInvolvedPeople; //bind Icollection to grid
     gv_Names.DataBind();
     gv_Names.Visible = true;
    }

Then within my row selection on the grid I retrieve the object id of the selected row

GridDataItem selectedItem = (GridDataItem)gv_Names.SelectedItems[0]; 
SecondaryID = selectedItem["ObjectId"].Text;

The goal is to take the object Id and query the session variable (sessBase) to retrieve the remaining values (that were not visible in the gird) of the collection and display them in the UI in a form/textfield format. I would think the best approach for this would be to use Linq to query the session variable but I am stuck here on how to go about this or accessing the nested collection (AssocMInvolvedPeople) .

I would assume that to set this up in the method I would reset my object back to the session variable as:

protected void GetAdditionalData()
{
 myBase = (BusinesObjectName)Session["sessBase"]; 

//here is where I am stuck how to query this object and select the records based upon the selected ID 
    ...
    }

I would appreciate any tips or suggestions on the best approach to retrieving this data

Thank you,

  • 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-27T21:19:53+00:00Added an answer on May 27, 2026 at 9:19 pm

    If you type-cast the Session object and put it in a closure, you should be able to use it or any collection property in the object in a standard LINQ query, i.e.:

    var results =
        from MyClass i in (Session["sessBase"] as MyBusinessObject).MyCollection
        where secondaryID = i.ID
        select i
    

    I realize I’ve made some arbitrary determinations about how you’ve structured the business object, but without knowing more, I think this should sufficiently demonstrate the concept.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Within an asp.net webform I have some jquery that controls the positioning of elements
I have an asp.net backend that creates Hierarchical Data based on IHierarchicalEnumerable. This was
I have an ASP.Net UpdatePanel that updates on a timer. Within the UpdatePanel and
The situation I have an ASP.NET Webform that contains some status information about a
I am having this really weird issue with downloading files from within ASP.Net MVC
I have used JQuery within my asp.net page. JQuery is working fine. I could
I have a form within an ASP.NET MVC application and I'm trying to submit
Is it possible to have multiple login pages for different folders within an asp.net
I have an ASP.NET site that uses JQuery and ASP.NET UpdatePanel and ScriptManager. On
Suppose I have javascript within ASP.NET UserControl: function setValue(DataItem) { var selectedDate = DataItem.getMember('DomainNameKey').get_object();

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.