.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

pull values from session TList

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
 
I have populated a gridview with the following code string WhereClause = query; string OrderBY = "PostedOn desc"; int PageIndex = gvJobPosting.PageIndex; int PageSize = gvJobPosting.PageSize; int Count;   TList<JustClick.BLL.JobPosting> JobPosting; JobPosting = JustClick.DAL.DataRepository.JobPostingProvider.GetPaged(WhereClause, OrderBY, PageIndex, PageSize, out Count); Session["JobPosting"] = JobPosting; if (JobPosting.Count == 0) { errorMessage.Text = "There is no jobs available"; } else { gvJobPosting.DataSource = JobPosting; gvJobPosting.DataBind(); lblCurrentJob.Text = Count.ToString(); lblPostingsFound.Text = "job postings found."; btnExport.Visible = true; } and have a select button set to SelectedIndexChanged to pull all the details out and display in a formview i'm using the following code so far   protected void gvJobPosting_SelectedIndexChanged(Object sender, EventArgs e) { TList <JustClick.BLL.JobPosting> JobID; JobID = (TList<JustClick.BLL.JobPosting>)Session["JobPostings"]; int PostID = JobID[0].JobPostingID; TList<JustClick.BLL.JobPosting> JobPostID; JobPostID = JustClick.DAL.DataRepository.JobPostingProvider.GetByJobPostingID(PostID); }   But on int PostID = JobID[0].JobPostingID; i'm getting the error NullReferenceException Object reference not set to an i


View Complete Post


More Related Resource Links

How to store and retrieve multiple values in a single session variable .

  

I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.


how to pull values to asp.net controls from publishing controls

  
HI, I'm using Sp2010 and working on a publishing page.In my page am using SharePointWebControls:InputFormTextBox as my Header for content area.Currently am hardcoding the text what i want to show.Now i have to provide  the option to end user to change the text.this is the code am using. <PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel" PageDisplayMode="Display">              <span>Message Details</span>                        </PublishingWebControls:EditModePanel>             <PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">                          <SharePointWebControls:InputFormTextBox ID="TitleTextBox" runat="server" Text="Message Details"   />            </PublishingWebControls:EditModePanel> Now i have to get the value dynamically like this for my SharePointWebControls:InputFormTextBox fi

Crossing values of Session variables

  

Hi all,

We are working in a web application using Session variables to store the clients ID to operate with them in all app (making orders, reports, etc....) but randomly users get the client ID of another user in any moment using the application.

I have tried to solve it in a first step adding to system.web section in the web.config file this:

<httpRuntime enableKernelOutputCache="false"/>


No changes after this. I have tried another possible solution, changing the SessionState to StateServer:

<sessionState timeout="30" mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424"></sessionState>


ASP.NET State Service is running in server normally, It began run just before this last change, but we have not solved the problem either with this solution.

The server is Windows Server 2003 Standard Edition SP2 32bits running IIS 6.0, and the application is made with Framework 2.0

Are we doing wrong or forget something?

Thanks


in an async task session values are not getting saved when using OutProc mode

  

Hi,

my problem is that during a page load i am starting an async task, it is a time consuming calculation. If the user requests for the task to be shown on click of a button i have to render the results or show that task is still processing. for that i am using a boolean variable which is set to true when the task starts and if on click of the button the value is still true i show processing symbol

When the async task completes i set the boolean value as false and store the calculated datatable in session. The problem is that in an inproc mode, this logic works absolutely fine. but the moment i move to state server for storing the session values, both the boolean value in session and the datatable show their initial state, i.e. the state they were in when the async task started . I checked my async task,(tried background thread and async callback delegate both methods) and they were updating the seesion values when the task was completed. But somehow the changes are not committed.

Am i missing some configueration? or is there any way i can commit the changes from async task to my session variables


Forms Values Stored in Session

  

I am using the following code to store some form values into Session and then retrieve them the next time the users uses the form to save them having to be re-entered.

            If Not (Session("workarea") Is Nothing) Then
                workarea.SelectedIndex = Session("workarea")
            End If

            If Not (Session("workplace") Is Nothing) Then
                workplace.SelectedIndex = Session("workplace")
            End If

            If Not (Session("postcode") Is Nothing) Then
                postcode.Text = Session("postcode").ToString()
            End If

            'insert form data into session variables for use again
            Session("workarea") = workarea.SelectedIndex
            Session("workplace") = workplace.SelectedIndex
            Session("postcode") = postcode.Text

But intermittently when re-visiting the form the values aren't being retrieved from session. Is there a reason and resolution for this? Could this be due to load balancing on the web server? Is there a resolution for this?


Get the values of session variable 'x' through javascript?

  

I need to query for a session variable called 'steps' every 10 seconds from my Webform in ASP.Net using javascript. This session variable holds an integer value.




redirect asp.net website having Sessions from localhost by passing the session values

  

hi friends

             I want to open a web site in code by giving the server url, but in that server page we are restricting if session is null. Is work the session passing from the localhost in server???

How to pass session from local host to server

 

Urgent


How to retrieve multiple values from session?

  

Hello ladies and gentlemens,

I want to pass multiple values to another page from my gridview.

For sending i got this codes : (writing same page selected values)

 For Each item As GridDataItem In RadGrid1.SelectedItems
                ' loop through each selected row
                ' get each cell value using ColumnUniqueName
                Dim name As String = item("ProductID").Text
                Label1.Text += (item("ProductID").Text + " ")

                Session("CheckedItems") = Label1.Text
                Response.Redirect("Cart.aspx")



Here is my question

How can i catch from another page this values?


Session-state values and session-level settings

  

what does it mean by Session-state values, stateless session and session-level settings mean??


Thanks


How to set Session time out values

  

I deployed ASP.Net 4.0  app on ISS, I wanted to set the session time out value to unlimited or any admisible maximum value. How to achieve that?


MS SQL Server: Disconnect Users From Database - Kill User Session

  
If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

jquery autocomplete multiple values

  

i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?

 


JQGrid Loading deleted values

  

Hi,

This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.


Here is the code:


function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {

How to cast integer values as an array of enum values?

  

Hello all!

I'm working with VS2010 Beta2, ASP.NET and Dynamic Data. I'm using VB but will certainly be happy to receive a C# example if necessary. Laughing

I used a few of Steve's examples (Writing Attributes and Extension Methods for Dynamic Data and Dynamic Data - Hiding Columns in selected PageTemplates) to create a custom property attribute to be applied to a dynamic data column and want it to accept an array of enum values (each value will represent a dynamic data page template where this column should not be displayed).  My new attribute works fine when I hardcode it like this, meaning the HideColumnIn attribute is properly populated with the array of enum values:

<HideColumnIn(PageTemplate.List, PageTemplate.Edit)> _
Public Property My_DD_Column As Object

 

However, I want to store the values to be used for the HideColumnIn in the DB as integer values that correspond to the

SQL Server Session state problem.

  

Hi to all,


I have some things that I want to know. I am right now using a free asp.net webhosting ("somee.com"). The problem is that when I am visiting a page, there's a tendency that values stored in my session variables are lost. Therefore, it causes an error when the requested page is loaded.

1. I am thinking of using sessionState mode="SqlServer". Will it solve my problem?

Actualy Im working on it but Im having problems when connecting to the sql database.

2.  Is that a problem in the webhost?

3. Do free webhosting sites provide allow session state in the sql server?. Because ive tried it locally into my computer and error say's i should intall the ASP.NET Session State SQL Server version 2.0 or above.




Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend