State Management :: Datatable/Shoppingcart Isn't Working

Nov 25, 2010

I have copied this shopping cart from the net and incorporated it into my SearchResult.aspx. I understand the code and it seems simple enough but for some reason I am getting an error when trying to run it. Can someone tell me what is wrong below? The generated error stop at the following point: For Each objDR In objDT.Rows. I was thinking that object was not creative during the page load. So I added an

If IsDBNull(objDT) Then
makeCart()
objDT = Session("Cart")
End If

to check if that object exist or not then try to create it. But that didn't work either. :(

This is the error message:

Object reference not set to an instance of an object.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

[Code]....

This is the code to the page. It take the data from a select button on a gridview1. That doesn't seem to be the problem so I didn't added onto here for you guys to see.

[Code]....

View 2 Replies


Similar Messages:

State Management :: Shoppingcart Instance, Items Crossing In Sessions

Jan 21, 2011

I built an intranet application using code from this project (link and more details below):

Everything seemed to work during testing, but when multiple people are using the shopping cart, items show up across sessions.

For instance, if two orders are created at the same time, an item in Order 1 will show up in Order 2 by hitting the shopping cart refresh button.

Order 1 and Order 2 are two separate computers and being used by two different logins. Cookies are enabled in the browsers.

when an item is added like this: ShoppingCart.Instance.AddItem(arryProductId(i))

Should it not add that to a unique instance of the cart and nobody else be able to see these items?

We are getting ready to deploy this and this is a major issue. Any help would be greatly appreciated.

-=-=-=-=-

http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=423

An instance of the shopping cart is created like this:

If HttpContext.Current.Session("ASPNETShoppingCart") Is Nothing Then
Instance = New ShoppingCart()
Instance.Items = New List(Of CartItem)
HttpContext.Current.Session("ASPNETShoppingCart") = Instance
Else
Instance = CType(HttpContext.Current.Session("ASPNETShoppingCart"), ShoppingCart)
End If

When I insert items, they are added like so:

ShoppingCart.Instance.AddItem(arryProductId(i))

View 1 Replies

State Management :: Holding Datatable Value Using Session?

Aug 20, 2010

iam insert record using datable in gridivew,iam using session to hold the record, there is any other way to hold the record in datable.

[Code]....

View 1 Replies

State Management :: Storing Datatable In Session Variable?

Oct 28, 2010

I am storing Datatable in Session variable in my project. Is it good practise to do so? The datatable has 20 fields and can run into 1000+ records. Will it hamper my application performance?

View 11 Replies

State Management :: Out Of Process Session State Not Working?

Mar 7, 2011

I'm working in a web application that uses InProc sesssion to store data then we decided to decided to work with out of process session state. But now I tried to Implement that but it is not working

Note: I use visual studio web development server.

Here is what I did in the web.config fil:

<sessionState mode="StateServer" cookieName="ASP.NET_SessionId" stateConnectionString="tcpip=127.0.0.1:42424"
cookieless="UseCookies" timeout="10"/>

And to enable session state in all pages:

<pages theme="Blue" enableSessionState="true">

Then I started the aspnet_state service on my pc.

And I made a test to see if the session is working but unfortunately it is not working

View 9 Replies

State Management :: Keep Data In Static Datatable And Bind Dropdownlist

Mar 25, 2011

Which one is faster? For a dropdownlist binding it the first time and using ViewSate or Turning of viewstate, keeping the data in a static datatable and binding the dropdownlist each time on a postback

View 7 Replies

State Management :: Session State / Not Working

Oct 31, 2010

I have 2 cols. StartTime and EndTime. If user's total time is greater then 30 mins then I am locking user. Here, I used Session and I want keep my session for 30 mins. I did almost everything (I think ?) . Change the setting from IIS, Wrote <sessionState timeout="30"> but it is not working... Till 28 - 29 mins it saves the time, but not above..... After that I changed the session's timeout for 9 hours ex: <sessionstate timeout="5400">..... But still not working.... I don't understant what to do?

View 2 Replies

State Management :: Sqlcachedependency Is Not Working

Jul 21, 2010

My Asp.Net app caches some lookup DataTables to avoid hitting DB for seldomly changed data. When the data does change, however, I would like to use the sqlCacheDependency to get SQL Server to send a notification to my application, which should then reload the table into the cache.

In my application, the callback is not being executed, and the cache is not updated when data is changed in SQL Server.

I am using SQL 2005. This is my code:

***************************

[Code]....

View 6 Replies

State Management :: Session_Start Is Not Working?

Jul 18, 2010

I'm using BlogEngine and i'm changing it a little bit. I tried to show the online visitors number. I added some code in global.asax. My approach is like:

I defined the count of visitors in App start like Application["OnlineVisitors"] = 0

then i increased the count with 1 in the session start and decreased it in session end but it's not working. I downloaded the website to debug in my computer but i never comes to the breakpoint in the session start function. Also sessionstate mode is inprog cookieless= false and timeout = 20

[Code]....

View 3 Replies

State Management :: Cookies Are Not Working?

Oct 17, 2010

[Code]....

[Code]....

View 2 Replies

State Management :: SqlCacheDependency Is Not Working With StoredProcedure

Jun 29, 2010

how can i use the SqlCacheDependency with StoredProcedure.

I wrote like this, but it is not working.

SqlConnection conn = new SqlConnection("Data Source=SHIVAKUMAR\SQLEXPRESS;Initial Catalog=PracticeDb;Integrated Security=True");

View 2 Replies

State Management :: ControlAdapter/PageAdapter Not Working?

Sep 27, 2010

I have a ViewState persistence module that works perfectly on my local machine, but when I move it to our Dev environment, it does not. There are no errors, but the ViewState gets rendered in the page output as if the module did not exist at all.I have checked everything I can think of including the correct code on the server, the SQL connection string where the ViewState is being stored (yes, the code & server has access to the database as we are using the exact same database to store Session state (just different tables) and I can see entries being added for Session state.

As I alluded before, it is almost as if the control adapter in the .browser file is being ignored (or overridden--is that even possible?).Notable differences: my box is Vista w/IIS 7 (yes, I am testing with IIS 7, NOT the VS2010 mini-server). The server is Server 2003 w/IIS 6. Both my boss and I are sure this was working at one point, but as it is "hidden" from normal view we don't know when it stopped.I can provide more details if someone needs, but again the code itself works on my local box and is pretty much from the SDK.

View 6 Replies

State Management :: Session.Abandon() In Not Working In A Few Cases?

Jun 29, 2010

Session.Abandon() in not working ASP.NET 2.0 (C#) in a few cases. In the same application its working fine in other places.

< sessionState
mode="StateServer"
cookieless="false"
timeout="20" />

The session mode is "SateServer".

View 7 Replies

State Management :: Cache Expiry Date Not Working?

Nov 26, 2010

I have added a list to the cache with an expiry date, however the expiry date doesnt work, im not sure how long the cached item lasts but its no more than a day.

[Code]....

View 5 Replies

State Management :: Querystring Is Not Working On Reloading A Page?

Jan 21, 2011

I've a Linkbutton control in the master page. And in the content page(Home.aspx) i'm trying to navigate it an aspx page(Apply.aspx) passing a value using querystring. Everything is working fine when i click the apply linkbutton control for the first time i.e i'm able to get the value the querystring and able to use it.

But when i click on the same linkbutton second time, i'm not getting the querystring value?how to persist the querystring value on reloading?

View 5 Replies

State Management :: Rewritepath Not Working With Cookieless Sessions

Apr 21, 2010

I've been working on this problem for some time without success. We have this website that has been working for many years now and we have been using cookieless sessions since the begining. Now we are integrating with another site to handle payment throught redirection. This provider ask for two adresses for success or failure of a payment so we have something like [URL] and [URL]. For design purpose thoses two pages do not exists and I use an httpModule to route to the proper page. I use httpApplication.Context.RewritePath to send to the proper page but I can never find back the session my user had before redirecting to the payment provider.

If I change the session mecanism to use cookies (cookieless="false" or cookieless="UseUri") with a few other tweaks, everything works fine Does anybody know if this has a chance to work? Is there a way to re-attach to an existing session?

View 2 Replies

State Management :: Working With Cookies Using Windows Vista Sp1

Jul 17, 2010

[Code]....

Now,where(i.e;in which location of my hard disk) can i find the cookie that i recently created? I am using windows vista sp1?

View 3 Replies

State Management :: Application Error "datatable Must Be Set Prior To Using Dataview "?

Jul 29, 2010

I have developed a website in asp.net 2.0 with backend MS SQL server 2005. After each 2-3 days when i try to login to my admin panel i get a /server application error "datatable must be set prior to using dataview ".When I made a research on this i found the error is in the caching part of the code where i am using a dataset to fill my dropdown lists. But I am using the same code everywhere and on other place i didn't get any error but on a specific page. i usually get error when i try to login to admin. After successful login i redirect the admin to a page adminBazaar.aspx. and the error is always thrown by dis page only.other pages with the same code are working fine and there are no issues.I am using SqlCachingDependency. but can't figure out how to solve the problem.Right now to solve this I have to go to the server stop the website,then stop the application pool and the restart both. We have created a separate application pool for the website.

View 4 Replies

State Management :: PageOne.aspx Uses Pagetwo.aspx Session Variables And Datatable Contents?

Mar 24, 2011

I have done a web appllication and when run simultaneously from different locations, the one that is started first would use the one that is started late's session variable and datatable contents. This is an exams web app and pageone.aspx results should never be used for pagetwo.aspx's results, because they are not the same questions.

What can I do to prevent this from happening. I am desperate, people are standing by to do exams and time is not on my side.

View 3 Replies

State Management :: Code Is Not Working Propely When Using Page.Ispostback

May 28, 2010

I want to don't let the page to go back ,for that i am using the code to expire the page after the first time it loads so that when second time the page will load it will not find the such page in cache ,but problem is that my code is not working propely when i am using page.Ispostback, iam inserting my code here[Code]....

View 1 Replies

State Management :: System.Web.HttpContext.Current.Items Not Working?

Jul 21, 2010

In a page (not default) I have:

Protected
Sub Page_Load(ByVal sender
As
Object,
ByVal e
As System.EventArgs)
Handles
Me.Load
Try
loginRep = BusinessLogic.SR.GetUserName("99999")
System.Web.HttpContext.Current.Items.Clear()
System.Web.HttpContext.Current.Items.Add("RepId",loginRep)

I don't any errors and when in the run in the immediate window:

? System.Web.HttpContext.Current.items("RepId") in the immediate window on THAT page I get the OBJECT.

Then I have a hyperlink with navigateurl to the next page "~/ActCnt.aspx"

On that page, ActCnt.aspx, when in the code I have:

Protected
Sub Page_Load(ByVal sender
As
Object,
ByVal e
As System.EventArgs)
Handles
Me.LoadIf
Not Page.IsPostBack
Then
Dim loginRep
As BusinessLogic.SalesRep = System.Web.HttpContext.Current.Items("RepId")

In the immediate window ? System.Web.HttpContext.Current.Items("RepId") returns a String that is equal to "RepId".

Even if I change it to not be an object, but a string I only get the Name "RepId" of the keypair. I have NEVER gotten the actual value.

View 2 Replies

State Management :: Cookie Working Differently In IE Explorer 8 And Chrome 5.0.375.70?

Jun 13, 2010

In my webconfig file, I am using Forms authentication and I have:

[Code]....

and my default.aspx page is protected as it should. After logging with the proper credentials I am directed to the protected default.aspx page, however when viewing other pages of my website in chrome, and then going back to the default.aspx page something strange happens. From certain pages in my website the default.aspx redirectes me to the login.aspx page, but not from all pages, only certain ones. This behaviour dosenot accour at all in IE Explorer8 where once I am properly validated in my login.aspx page, I can view the default.aspx page from all other pages in my website until I logout from default.aspx page.

View 2 Replies

State Management :: EnableSession Not Working - Session Variables Still Haywire?

Apr 22, 2010

[System.Web.Services.WebMethod(EnableSession=true)]

View 6 Replies

State Management :: Save Cookie When Users Marks The Remember Me Box But Its Not Working?

Apr 1, 2011

[Code]....

i'm using this to save a cookie when users marks the remember me box but its not working.

View 7 Replies

State Management :: Client And Server Side State Management?

Feb 25, 2011

when we go for client and server side state management in asp.net

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved