UpdatePanel Resetting Object To Inital State?

Jan 13, 2011

I have an application that I am currently writing that works by iterating through nodes, and then updating the page with the information of the current node. I have an UpdatePanel in the page which contains a label, textbox, and a button. The label lists the currently available children of the current node, the user enters in which child they want to go to into the textbox, and then hits the submit button. I set the new value of the node in the submit button's event handler.

Here's my problem: Every time I enter in which node I want to navigate to, the object resets its value to the value it was initially initialized to. I have even put this same code into a Windows Form to validate that it's working correctly to iterate through my tree, and it works as it should, so I know my problem is AJAX-related.

This is the first app that I have written using AJAX, so I am still in the process of learning how it works. Here is the HTML:

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">[code]....

current is the current node, which has a public ArrayList of all of its children's IDs. tree is the NodeTree I have; calling Node just returns the new node. Both current and Tree get initialized in the Page_Load event, and that only fires once (when the page is first loaded).It's really pretty simply code; I'm just having difficulty understanding why the AJAX isn't working correctly.

View 3 Replies


Similar Messages:

State Management :: Session Object Not Saving Items Inside UpdatePanel

Jun 23, 2010

I have a multiview inside an updatepanel. in one of the views, I save a value in a session object like this:

Session["xyz"] = "some string value";

Then I switch to another view and try to pick it up the value in a button's OnClick event:

string x = Session["xyz"].ToString();

But I get a null reference error. Debugging it shows that Session["xyz"] is indeed null, yet other Session variables are still there. Is there something special about Session and AJAX?

View 5 Replies

AJAX :: Prevent Scroll From "resetting" When Using Updatepanel?

Jan 9, 2010

I have an updatepanel with a button inside. When I click the button the gridview inside the updatepanel is getting re-bound to its datasource. But if I scroll the page during this update the scrollbar bounces back to the position it had when I clicked the button (it happens when the update is complete). Can I prevent this in any way? I would like to scroll the page during this update wihout having the page bounce back to the "button click position" when done updating.

View 5 Replies

State Management :: PollLockedSessionCallback Error After Migrating To 2.0/ Object Reference Not Set To An Instance Of An Object

Aug 19, 2010

We have an applicaiton that was converted to the new framework using the wizard in Visual Studio 2008. When we install the applicaiton in production and change the iis settings to use the 2.0 framework we start to see these errors in the event viewer on the web servers. We are using SQL Server Session State and have 3 web servers in a load balancer. Object reference not set to an instance of an object.</Message><StackTrace> at System.Web.SessionState.SessionStateModule.PollLockedSessionCallback...

View 1 Replies

State Management :: LoadViewState - Object Reference Not Set To An Instance Of An Object?

Jul 16, 2010

I have a problem.This particular code when used on local machine is working fine, but when it is used on serverit gives an error like " Object reference not set to an instance of an object.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object._isRefresh = _refreshState == (bool) Session["__ISREFRESH"]; "

View 1 Replies

State Management :: Unable To Cast Application State Object?

Nov 3, 2010

global.asax:-I have defined a struct (my_struct)-I add a List of structs (List<my_struct>) to Application["MyList"] In default.aspx:-I have defined the exact struct (my_struct) and want to cast the Application["MyList"] object to the List of structs.

example: x = (List<my_struct>)Application["MyList"];

I receive this error "Unable to cast object of type 'System.Collections.Generic.List`1ASP.global_asax+my_struct]' to type 'System.Collections.Generic.List`1[_Default+my_struct]'

View 1 Replies

State Management :: Session State Object Configurations

Nov 9, 2010

[Code]....

View 3 Replies

AJAX :: Save State Of Dropdown And Gridview In Updatepanel?

Feb 21, 2011

I would like to find a solution to my problem. In these senario I've got two pages.

First page:

5 dropdowns in updatepanel and a gridview in updatepanel

Second page:

Displays info of the selected row

Problem:

So if a user makes a selections on all dropdownselection and selectes to view a row, wich in this case goes to page2 for more info.

But when the user returns to page1 all the selections and gridview has the "default" values so to speak, and not what the user has selected.

View 2 Replies

AJAX :: Page State Lost During Postbacks With Updatepanel

Jan 14, 2010

1. I have couple of checkboxes and some text fields outside the updatepanel.

2. Based on the checkbox selection, I will be hiding/showing the fields to user using javscript.

3. I have a upload control in the same page which is placed under the updatepanel. When I upload the file, I will be reading the content of the file and I'm trying to load it into the controls which are outside the updatepanel. As I know the controls won't updated until unless it has been added under the updatepanel.

4. I moved all the controls outside the udpatepanel (checkboxes and textboxes) and placed it inside the updatepanel so that when the file is uploaded I can read the file and assign to the controls.

After this, I was able to assign the values to the control. However, the problem is, the state of the page (javascript hide and show) has not been retained during the postback. For example, if i have 2 checkboxes and 2 textboxes, if i click firstone, it should show the first checkbox. If I click the second checkbox, it will show the second textbox. By default, when the fresh load happens, first textbox will be shown. When I click the second checkbox (its showing the second textbox) and do the postback by uploading the file, the state gets lost and when the page load completes, it's showing the first textbox instead of showing the second textbox.

View 3 Replies

AJAX :: Embedded Object/active-x Disappears When Contained Within Updatepanel?

Mar 7, 2011

I have an update panel within it i have my activeX control, below it i have a dropdown that you make a selection from, once you make a selection im trying to pass in different paramters, which really are just the source of the control, since everything else will be the same.. but when i make a selection, the control disappears..

If i remove the update panel and make a selection the control is still visable on the page, at the moment, i dont have much setup, im just trying to get the page layout and framework setup adn working, then i can start plugging in my datasource so actual data is being passed in..

I do have a trigger associated with the updatepanel, but with or without it it still causes the control to disappear..

Just to be clear, it disappearing when i view the page in my browser and make a selection, not within VS. Whats weird is that ONLY that control disappears, the rest of the controls on the page stay visible, the dropdown and buttons.

View 2 Replies

C# - Wrong State In Server Controls With Same ID's When Dynamically Adding UserControl To UpdatePanel?

Feb 6, 2010

Here is what I am trying to do. I have a page with two link buttons and an updatepanel (the two linkbuttons trigger the updatepanel). I have two usercontrols which have labels with same ID's. When I click the first link button, I add the first usercontrol to the updatepanel and set the label value to datetime.now

when i click the second link button i add the second usercontrol but i see that the value of the label from the first control is set in the label in second user control. if the id's are different there is no problem - but in my case the usercontrols are being developed by different teams and I am integrating them in the way i mentioned - so they may have same ids.

View 2 Replies

AJAX :: Javascript Change-state Toggle Button Inside An Updatepanel?

Oct 7, 2010

I've got a rather difficult one here. I have a JavaScript jquery toggle button inside an update panel. Right now i'm using <form body="onload"> to recall this javascript to re-apply the button state after each partial postback. It works, but it requires two clicks sometimes.

The problem is... after a few clicks, it is significantly slowing down the PC, and I can see the clicks trailing half a second to nearly a second. If I have a group of buttons, all those click events are just catching up to my clicks. It is rather amusing but I suppose it has to do with the fact that the postback is calling the <body onload=" event> each time after the button is clicked.

so how can I then, make this performance faster?

View 1 Replies

How To Maintain The State Of The Object In Web Service

Mar 27, 2011

Is it possible to send the object to the web service and the web service returns the object?is it possible to maintain the state of the object while sending it to the user through web service?

View 2 Replies

Cookies And The Session State Object?

Mar 29, 2011

my main concern is using Session. I've always been under the impression that if you use the following statements (not that I would):

Session["newVar1"] = "a new session variable";
Session["newVar2"] = "a new session variable";
Session["newVar3"] = aLargeVariableThatHoldsLotsOfData;

You would be creating 3 new session cookies that hold the particular value. But I think my asp book is indicating that you would actually create 3 new variables in your session state object and ASP would only pass a unique Session ID (as a cookie?) in the response, and would get this ID upon the next request and associate that ID with your Session State Object (that IIS has stored in memory..?):

[code]....

That doesn't seem ideal for a website with lots of traffic. A server that is storing and maintaining thousands and thousands of instances of session state per website seems like way too much overload.
I'm trying to see what's going on on my own, but I'm having trouble.. I can't find my site's cookies anywhere on my machine (IE/windows xp). I've checked C:Documents and Settings icholasrCookies and C:Documents and Settings icholasrLocal SettingsTemporary Internet Files which, according to this yahoo answer, IE cookies are stored as well. I'm using ticket authentication in my app which stores a auth cookie on the client, so a cookie from my site has to be somewhere..

View 1 Replies

Web Forms :: How To Persist The State Of Object On Postback

Jan 26, 2011

I bind textbox to a property of an object. After running the app, if the value of textbox is changed, I expect the object to update this property .This does not happen. I also understand that I am recreating the object from viewstate on postback, which is wrong. how to persist the state of object on postbacks all.

[Code]....

View 1 Replies

State Management :: How To Store Object In Cookie With C#

Apr 10, 2010

I'm using session to store C# object but my session is expiring regularly.

I've given 540 minutes for session timeout. ( <sessionState mode="InProc" timeout="540"/>)

Now I want to use cookie instead of session to remove this timeout problem.

code below:

[code].....

View 17 Replies

State Management :: Make Serialization For Object

Feb 18, 2011

I have code :

[Code]....

Is it right?

View 4 Replies

State Management :: How To Serialize An Object Into Cookie

Apr 1, 2010

I had an xml-serialization which worked fine, but as I have just knew it doesn't work in Opera browser. I think, it's security rules don't allow to write to cookies xml-content.What can I do? Can I use binary serialization or something else?

View 2 Replies

State Management :: Can't Update Progress Object?

Oct 26, 2010

Anyway, I currently have a ajax based progressbar, which works like this: my long-task stores progress in session. Async callback retrieves progress from session, progressbar is updated. Everybody is happy... not! This only works when the "main loop" of the time-consuming task runs in either codebehind or a class with httpcontext. But all my businnes objects cannot do such thing. So, the next natural spet would be to say "move it to a static class" ProgressHelper or something, but since static classes are shared across all appDomain, I would bump into concurrence problems. So, can i have say a "static list progress" say progress["session1_progress"], progress["session2_progress"], progress["sessionN_progress"]? I cannot really see a way to update progress from inside a task in a business object, which i might want to use also in other plattforms like a desktop app?

View 7 Replies

State Management :: Persisting A Class Object?

Nov 5, 2010

I wish to persist a class object across postbacks by using a single session variable/object/whatever.

The class has about a dozen single variable properties; and about a dozen table properties; and several methods. The main table tracks rows of sporting event results. The web site will collect one row at a time for each postback. The data in the object's constructor is based on a dataset, but the data in the class will grow each time I do a postback so I don't want to loose the information in the class. The data isn't very big - it will fill a single computer screen.

Being new to programming I am thinking that I can store the dataset in the session but that would slow down the response time because I the methods would have to be called to refine the data - or maybe I can just store the entire class object in a session.

View 3 Replies

State Management :: Use An Object From The Cache In A Mvc View?

Sep 24, 2010

I am working with asp.net mvc and i am trying to get acces to a object that is in the cache.In the Application_Start() of Global.asax.cs i create and store an object in the cache like this:

Translator translator = new Translator();
HttpContext.Current.Cache.Insert("Translator", translator, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration);

Translator holds a dictionary with translations.Now i want acces to this object from the cache to use functions and get values from the dictionary.I know i can acces it like this HttpContext.Current.Cache.Get("Translator") or Cache.Get("Translator") in the views But how can i use the functions of the object ? The meaning of the cache is to have a object that is accesable througout the webapp right ?

Do i have to make an object and asses the value of the Cache.Get("Translator") to it, so i can use the functions or is there another solution?

View 3 Replies

State Management :: Boggled About The Session Object?

Feb 11, 2011

On my local machine I've got a website running which uses the login control to authenticate a user and write a formsauthentication ticket to the client (which is also on the same local machine). At the login process it stores a a small serializable userobject in a session object named Session["appuser"]. Now when I open FF and login to the website all is fine so far... But here's the thing I cannot for the life of me figure out...

When I open IE8 and login to the same website, the session object which was created in FF is completely overwritten with the one created in IE. I thought that every session is unique, but now I'm really starting to feel my knowledge of sessions is almost next to nothing... Is there anyone out there that could tell me why I'm seeing this.

View 10 Replies

State Management :: How To Know If A Session Object Was Never Instantiated

Sep 7, 2010

how I can know if a session object was never instantiated?

View 1 Replies

State Management :: Object Is Byref And Shared?

Apr 14, 2010

I have a Session Varaible in which I am assinged a List of "MLoad" objects (Ex:- 10 MLoad objects) from the initial search. After that basing some icon click i am trying to get the new filtered results (Ex:- say 1 MLoad object) and assigning them to the public property "ListSearchResults" (See code below). When i do this the original results in the Session are changed(10 MLoad objects are getting replaced with 1 MLoad object ==> which just been filtered). What i have to do so that the "ListSearchResults" in Session is not changed. It is now byref, how to make it byval?

in acreate an object See below code and after retreving t

[Code]....

View 1 Replies

State Management :: Send Object From One Page To Another?

Aug 21, 2010

I want to create object in 1.aspx, and then send it to 2.aspx. This methods are bad, because:

1)Send object with url, like this:

http://www.example.com/?param1=123

This is not confidential.

2)[Code]....

This is bad too, because in 2.aspx this fields send to textboxes, and if user go to 2.aspx without 1.aspx,

View 2 Replies







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