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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

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

Posted By:      Posted Date: October 23, 2010    Points: 0   Category :ASP.Net


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

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.

Accessing a row's dropdownlist values AFTER the gridview control is in Edit mode

Hello, I have a gridview control. When it goes into Edit mode, there are 3 dropdownlists in one cell that are populated by separate stored procedures during the RowDataBound event. The 1st dropdownlist's value is used as a parameter to determine what the 2nd dropdownlist is populated with. The 2nd dropdownlist's value is used as a parameter to determine what the 3rd dropdownlist is populated with. Everything works fine when the row is first put into Edit mode. While I'm in Edit mode and I change the selection in the 1st dropdownlist, how do I access the control so I can feed this new parameter to the 2nd dropdownlist? I have the first 2 dropdownlists set for AutoPostBack so that the Page_Load event is fired when the user changes a value. I know how to get access to these controls via the FindControl method when the row is being databound but how do I find the control during the Page_Load event? Thanks for any help!!!   Penny  

Hosted Designer fails to load workflow xaml that has InArguments with default values (xaml saved by

I have hosted the designer in our app. Using the hosted designer, workflows are saved as xaml to a database. When an end user wishes to edit a workflow the xaml is downloaded to a file and loaded into the designer via the .xaml file. The user can also associate assemblies with the workflow and there is a mechanism which makes sure that these assemblies are loaded into the appdomain and available. The problem we are hitting occurs when the top level activity (Sequence) has InArgument with default value. I create a simple Sequence, add InArguments (type of Int32 and String)  and set some default values. I save the workflow xaml to the database and close down the designer. When I wish to edit the workflow and try to load I get the following errors Could not find member '{clr-namespace:}_e905.argument3'. Could not find member '{clr-namespace:}_e905.argument1'. suggesting that some assembly/namespace missing. Here is the xaml I try to load: <Activity mc:Ignorable="sap" x:Class="{x:Null}" this:_e905.argument3="99" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorl

How to get values from a multi row set in case of Execute SQL task?

Hi All, I'm testing the Execute SQL task, when I set the ResultSet to Full row set an try to retrieve those set into a variable, the package runs well but I' m not able to extract what is inside the record. If I try to debug the package to explore the data. All that I recieve is _ComObject as type, System._ComObject as value, I know (if I'm not wrong) that this _ComObject is the box that contains the rows though the values the question is how to extract those variables. For example, I can say how to enumerate the results sets using a ForEach container? Thank you The complexity resides in the simplicity

pull values from session TList

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

Populate a Data Flow Task's variables with values from a .dtsConfig file?

I have an SSIS Project to import exchange rates from an XML file into SQL. The project works when I have certain values hard-coded into variables, such as the URL of the XML File, proxy username and passwords etc. I decided to put in a .dtsConfig file, and have it update the values of the variables in the data flow task. So, one of my SSIS Packages in this solution is called ECBDailyRates.dtsx. It contains one control flow, which is a data flow task. The data flow task is a script task which does some XPATH on an XML file, and then provides outputs to an OLE DB Destination, which in turn puts the data into a table in SQL. That much worked before I put in the dtsConfig file. There are a few variables declared inside the data flow task, such as; PricesXMLUriDaily, String ProxyAddress, String ProxyAddressPort, Int32 etc. etc. These are now being updated from the dtsConfig, which is below. It was my understanding that SSIS would run through the config, and update any of the variables as required, and then run my data tasks. However when SSIS runs my script task, none of the variables have been populated, and so it falls over... as it were :) <?xml version="1.0"?> <DTSConfiguration> <DTSConfigurationHeading> <DTSConfigurationFileInfo GeneratedBy="...." GeneratedFromPackageName="dim_Institution" GeneratedFromPackageID="

Sharing the session variables between two .net applications using SQL Server Mode?

Hi, I have two different IIS applications within the same domain(let us say www.mydomain.com) , both of these applications use the same database instance(same connectionstring), now what I want is that both of applications can see each sessions variables , can SQL Server session state mode helps in this case? Did someone try that before? Is there any other way to share the session variables? Please help.  

How to override the style values in a sharepoint workflow task form


I've created a aspx task form, and it's working as planned.  However, the window that is popping up when the task form fires is too small, and I would like to set the initial height/width to my own values.  How do I override the standard sharepoint css/style values so that I can control the size of the task window?


Rocky Sanders

Custom Task poeprties values persistance issue?



This is the case: I wrote a simple task that has one property Display text, it displays text once the package if fired. This built in task has an interface. The user should normally enter the display text property value and click OK then that value is persisted. If the user interface is closed then reopened then this value should be held as normally.

Should I write custom code to cache this value and then write a code to persist it or this is done through a provided way by the SSIS, I asked this question before and CosyRock oriented me to some code samples which I followed with a great intention but until now I couldn't figure out how to persist properties values.

In this case I use the IDtsTaskUI interface to tie the task to its interface and you know there isn't an Edit method such is IDtsComponent interface so I can imlement it to commit or rollback values?

 Thank you

The complexity resides in the simplicity

AJAX AsyncFileUpload and session mode="stateserver"


hi, I need tu upload files to a webserver from an asp.net web application, I considered to choises asp:uploadfile or  AJAX AsyncFileUpload.


asp:uploadfile needs a fullpostback to work, I cant do a fullpostback on my page.

AJAX AsyncFileUpload, in this case the problem is that i'm using sessionstate mode="stateserver" and teh httppostedfile can't nor bee serialized.


is there any solution to this contradiction?, is there a free third-party componet to upload files?

Please I need your help.





How to assign values to workflow task person or group custom field?

Using visual studio 2008, in createTask_MethodInvoking, I have the following code. RequestFields has the values from the InfoPath form. ApprovingPersons is a person or group field, added to the task list by my custom task content type. I checked the task list associated with the workflow and I see the custom field.

SPUser user;
SPFieldUserValueCollection fuvc = new SPFieldUserValueCollection();
foreach (Contact person in RequestFields.Persons)
      user = workflowProperties.Web.EnsureUser(person.LoginName);
      fuvc.Add(new SPFieldUserValue(workflowProperties.Web, user.ID, user.Name));

// this is the line causing problem, I believe
PreApprovalTask_TaskProperties.ExtendedProperties["ApprovingPersons"] = fuvc;

I got the following error message:

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argument



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="></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?


Setting Task Field Values in Custom .aspx Edit Form and accessing through ExtendedProperties


Since we're using WSS 3.0 and not MOSS 2007, we have to create and use ASP forms for any custom Workflow Task Edit pages instead of being able to use InfoPath forms (which would be nice...maybe some day we'll step up to MOSS). The custom Workflow Edit Pages are used for custom Task Content Types that we create so that our Workflow Tasks can have additional fields beyond the standard Workflow Task fields. Once you've collected the values for the Task fields from the user on the ASP Workflow Task Edit form, the typical procedure is to create a hashtable and fill the hashtable with key/value pairs that represent the names of your Task fields and their associated values, as such:

// This function is called when the user clicks the Save/Submit button
// on the Custom Task Edit ASP form
public void btnSubmit_Click(object sender, EventArgs e)
  // Create a hashtable that will be used to update the values of task fields
  Hashtable taskHash = new Hashtable();
  // For each field, create two values in the hashtable. If the field name 
  // matches a field in the Task content type, the field name will not be 
  // searchable as a key within the ExtendedProperties hashtable. So 
  // create a second field that is a duplicate of the first but having a 
  // name that doesn't exactly match an existing field in the Task 
  // content type. That way it will be a searchable ke

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



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

Here is my question

How can i catch from another page this values?

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