Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










AJAX :: Persist Property Value Between Callbacks


I store a variable in the viewstate using a property :

[Code]....

but the value is not persisted through the callbacks. it always revert to 50 like ViewState["itemsPerPage"] is always null.


View 6 Replies (Posted: Nov 02, 2009 10:31 AM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Web Forms :: Modify A Common Property Via JavaScript And Persist It?
I am trying to modify a property in a GridViewRow...

I want to turn the display to 'none', but when I do any postback on the page, it doesn't persist... the page render again displaying the row...

But when I try it with the text in a TextBox, it persists!

Posted: Dec 15, 2009 11:09 AM

View 5 Replies!   View Related
State Management :: How To Make A Custom Property Or A Page Persist Across Postback
Ihave an object to hold some specific state information in my web application- I pass it back & forward between pages by making it a property of a basepage which works fine, but Ilose it on postback.

Is there any way to persist this property without manually adding & reading it againfromviewstate?

Posted: Sep 29, 2010 12:10 PM

View 3 Replies!   View Related
Difference Between Client Callbacks And Ajax Page Methods?
Based on my understanding, both of them essentially do the same thing (lets us execute a server side method from JS). Are there any differences?

Also, Ajax Page Methods can be implemented either using JQuery or using ScriptManager. Which one is preferred and why?

Posted: Aug 25, 2009 10:11 PM

View 6 Replies!   View Related
JavaScript - How To Implement Super Fast AJAX Callbacks/PageMethods
I am designing an ASP.NET web application (.NET 4.0) which basically has a page that should interact with the code behind every 1-2 seconds (Using Client callbacks or PageMethods via ScriptManager or jQuery.ajax) It'll be hosted on an intranet, so a 1-2 second refresh rate is kind of reasonable.

How can I make the page to access the web service/pagemthod in the code behind in a timeply manner (e.g. every 1 second). Should I use a javascript timer (I'm not familiar with javascrip very much)?

Although the site is hosted on an intranet, but I still need to implement a good approach to reach the desired refresh rate. the amount of data being transfered is about 1KB in each interaction. What are your recommendations on my design regarding this? (using callbacks or ScriptManager or jQuery.ajax,...

Posted: Feb 7 at 19:24

View 3 Replies!   View Related
How To Force DOM Modifications Done In Success Function Persist Within A JQuery.Ajax() Call
I am getting a JSON object from a webMethod by the call below and I set some textBox values based on the returned objects attributes.Problem is, just for a moment my textBoxes are populated but then immidiately they return back to empty.Do I make a mistake or I cannot make DOM elements modifications within a success function?

var ajaxCallOptions = {
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/JQuery/Chapter16-AJAX/PersonWebServices.asmx/GetPerson",
personId'));"/>
[code]...

Posted: Jun 20 10 at 20:21

View 3 Replies!   View Related
AJAX :: UpdatePanel - GridView - DataSource Null - Get The Datatable To Persist Between The Two Update Panels?
I am going to outline my setup then where i am failing

UpdatePanel1 - Contents : 3 textboxes and AddButton
UpdatePanel2 - Contents : 1 GridView and SubmitButton

AddButton adds new row to DataTable with data from textboxes, binds DataTable to GridView SubmitButton sends data to database. The Adding of a row works to add the row to the gridview, but it won't add a second or third and so on, only adds the 1. SubmitButton belives the DataTable that GridView is databound to is null and won't send anything to the database. How can i get the datatable to persist between the two update panels? Do i use Sessions as my storage location? Page

[Code]....

Posted: Jan 17, 2010 08:03 PM

View 2 Replies!   View Related
Web Forms :: Updating A Label With Callbacks?
I'm using a third party control which fires a server side method when a document gets saved. Should there be any problems with saving, I'd like to display a message on the client side, such as:

[Code]....

Doing that in server side doesn't work after discovering IsCallBack = true.

How do you update lblMessage via CallBack without a full PostBack?

Posted: Jun 14, 2010 06:54 PM

View 10 Replies!   View Related
Client Callbacks With Master Pages?
I'm following this example: [URL]

And I can get it to work with just a single page and a code behind, but when I add a masterpage, the examples doesn't work properly. Within my master page, I have a head content section and a body content section. It's nothing fancy.

How do i do client callbacks with master pages?

Posted: Aug 30 10 at 5:49

View 2 Replies!   View Related
C# - Scriptmanager RegisterStartupScript Does Not Work On Callbacks
I am using a third party UI Library (devexpress) to implement some data grids. These grids work with Callbacks (not UpdatePanel partial Postbacks).

I am trying to use Scriptmanager RegisterStartupScript to execute some code on the client after the callback. This works great with partial postbacks but does not work with Callbacks.

Is there any way to queue client side code for execution inside the callback server side handler?

Posted: Feb 8 at 13:29

View 1 Replies!   View Related
Javascript - Add Callbacks To Jquery Validation (when Used In MVC 2)?
I'm using jquery for validation in my MVC2 web app (as described here) and I'd like to wire up some callbacks that the jquery validation plugin supports, like invalidHandler, etc.

I can manually edit the MicrosoftMvcJQueryValidation.js and add my callbacks (in __MVC_EnableClientValidation, in the options variable) but I was looking for a better approach since that file is used repeatedly and I don't want to have to create one-off copies.

A way to manually add an invalidHandler (etc) callback to the form validation, would be exactly what I need. Obviously this would normally be done via the options when calling validate() for the first time, but since Microsoft controls that particular part, that isnt an option.

Posted: Oct 6 10 at 14:26

View 1 Replies!   View Related
Web Forms :: Multiple Server Callbacks (NOT POSTBACKS)?
I have 2 different javascript client side functions that are on timers. When the timers elapse they do a server callback and check for pending data. The first one executes perfectly by itself. The second one calls back and receives data perfectly as well...by itself. The problem I have is that when they are both enabled they *seem* to step on each other as there is only one conduit to the server and back.So I have everything segregated up to that point. To my knowledge I only have one...Page.ClientScript.GetCallbackEventReference.... to work with. Is there any way to keep them seperate. To my thinking what would be ultimate would be to have two DIFFERENT CallbackEventReferences for each clientside javascript function to use as its own.

Posted: Oct 22, 2009 10:57 AM

View 5 Replies!   View Related
Implementing Client Callbacks Programmatically Without Postbacks In Web Pages
Apropos MSDN link: [URL] [.NET Framework 4 - ASP.NET] Implementing Client Callbacks Programmatically Without Postbacks in ASP.NET Web Pages Using the code from the above link in the following code snippet, if you keep a break point on the statement "if (IsPostBack)" in the Page_Load event. The control moves into the "if (IsPostBack)" block after the alert, which mean that it is a Postback. Then, how come you say "...Without Postbacks"? I am getting confused here.

<%@&nbsp;Page&nbsp;Language="C#"&nbsp;AutoEventWireup="true"&nbsp;CodeBehind="Default.aspx.cs"&nbsp;Inherits="ASPCS2008ClientCallbacksProgrammatically._Default"&nbsp;%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"[URL]>
<%@&nbsp;Implements&nbsp;Interface="System.Web.UI.ICallbackEventHandler"&nbsp;%>
<scriptrunat="server">
stringaStringValue;
publicvoidRaiseCallbackEvent(StringeventArgument)
{
aStringValue=eventArgument;
}
publicstringGetCallbackResult()
{
returnaStringValue;
}
protectedvoidPage_Load(objectsender,EventArgse)
{............................................................

Posted: May 6 10

View 2 Replies!   View Related
Web Forms :: Implementing Client Callbacks Programmatically Without Postbacks?
Apropos MSDN link:

[URL]

[.NET Framework 4 - ASP.NET]

Posted: May 06, 2010 10:01 AM

View 2 Replies!   View Related
JQuery :: Modal Popup That Allows Callbacks Or Asynchronous Calls Without Losing The Popup?
any modal popup controls whereas I can interact with the controls, causing callbacks and asynchronous calls without losing the popup.

I tried with the modalpopupextender, but the popup will disappear with the call and re-rendering the popup like many people will cause massive flashes of the popup which i want to try and avoid.

Posted: Aug 07, 2010 03:38 PM

View 1 Replies!   View Related
AJAX :: Finding Auto Post-back Property Workable When Using Ajax CascadeDropdoenList?
I'm using Ajax CascadeDropdownList and it's working ok. But I need to execute DDL_SelectedIndexChanged in my web form for the second DDL. As I'm using Ajax CascadeToolkit AutoPostBack=True is not working and DDL_SelectedINdexChanged is not working as well. But I have to have it.

Posted: Dec 04, 2009 03:47 PM

View 3 Replies!   View Related
Web Form And Ajax Data Lost On Post Back - Finding Possible Cause / Ajax Or Changing Visible Property
I have two Repeater controls, each hosted in a user control. Both user controls are contained in the same aspx page. Only one User Control is visible at any one time. The repeaters are comprised of checkboxes, and text boxes for user input.

The aspx page is configured with an Ajax ScriptManager; and contains several Ajax UpdatePanels. These UpdatePanels result in partial page post backs when text is changed in a textbox control in controls on the aspx page (this is not the behaviour for the Repeaters in the User Controls). Through use of several AsyncPostBackTriggers, various controls contained in the other UpdatePanels on the page have their content refreshed in response to the partial page post backs they are configured be notified about.

Depending on a radio button group selection, I set the visible property to true or false - as appropriate for the User control containing a repeater control. The Repeater control is then populated with data using databinding. All of this works.

However, when the Submit button is clicked, the Repeater control contains no data.

Given that I am not dynamically adding the Controls containing the Repeater controls (but using Visible true / false). I would have thought that the State of the fields and the data in the visible control would be preserved during the post back.

The User Controls are contained within the UpdatePanel that contains the Submit Button.

I have explicitly Enabled View state without any effect.

Am I correct in assuming that I should not have to do any explicit handling of data changes the user makes (via client side script and manipulation of an Data Structure Representing the Repeater Data); and the View State should maintain the data I need to access on the server when submitted?

I do not believe that it is the User Control visible state changes that are causing the issue because when the page is initially loaded on of the User controls is populated with dummy rows (so it displays).

I am suspicious that because the visible state of the controls is changed during partial page post back, that the Page View State ends up with no knowledge of the User Control and therefore cannot track its data (or changes).

Posted: Sep 15 10 at 19:56

View 1 Replies!   View Related
C# - How To Persist Authentication From One Web App To Another
So my company has an ASP.NET web app, targeting .NET 3.5. I am tasked with building a ticketing system for them. I don't really need to use any resources of the company app, except for authentication. I would like to target .NET 4.0 and use the 4.0 goodies like entity framework and mvc 3.0. If I create an application targeting .net 4 nested within the main web app in IIS, is there a way to persist authentication so they do not require a different session within the 4.0 web app?

Posted: Feb 18 at 16:46

View 2 Replies!   View Related
How To Persist Password Across Postback
i have a form with 2 password fields in it and when the page is post back on validation, the password value is lost

Posted: Jul 9th, 2009, 01:04 AM

View 4 Replies!   View Related
MVC :: Can DataAnnotations Persist Through Serialization
I am using business objects that are accessed via webservices. These objects can be loaded via the webservice and serialized to my mvc app. The mvc app can get a web reference to the objects and they can be utilized in the mvc app. However, the business objects are where the classes are defined, and where the annotations are applied.

The mvc validation seems to have no idea that there are System.ComponentModel.DataAnnotations attributes applied to this business object class.

1) Are DataAnnotations lost when objects are serialized / deserialized?

2) If in mvc I use a view model approach, and have nested objects (which themselves have public properties - decorated with DataAnnotations) can/will the mvc validation system traverse the entire object model, the model being used for my view? (so it can see DataAnnotationsattributes of the nested object)?

Posted: May 24, 2010 01:12 PM

View 1 Replies!   View Related
How To Login Via SSL Persist When Switching To Non - SSL
I have an application I would like to force SSL on the login page and on the page that the CC is entered on. I would prefer to keep the rest of the application free of SSL.

I have the code working to force SSL on certain pages, and remove SSL on others. The problem I have is that if I log in with SSL enabled the user is only authenticated on the pages that are SSL. The reverse holds true as well, if the user logs in without SSL they are only authenticated on pages without SSL.

What can I do to have this persist between the two. Is this using cookies or the session?

Posted: Apr 5 10 at 19:45

View 1 Replies!   View Related
How To Persist A Variable On A Page
ive declared a custom type variable (structure) on my page in the position as shown below, but at very postback its values are reset as if i just declared it; for example if i assign a value on the button click even or on a ddl item change event the value is correctly stored when the sub ends but as when i access the same value or the structure again in the page, everything is gone, all strings type paramaters of the structure are set to null back again.

[Code]....

Posted: Nov 23, 2008 07:39 PM

View 2 Replies!   View Related
MVC :: How To Persist Search String
Site.Master contiainssearch form using code below. After pressing submit button entered search string is reset since whole page is re-loaded. How to persist search string so that search field contains enterread value after page is re-loaded ?

[Code]....

Posted: Mar 05, 2011 10:43 AM

View 13 Replies!   View Related
How To Persist Session Values In .Net
I'm implementing IHttpHandler and IRequiresSessionState and I'm using context.Session but after I set up a value in Session, it's lost in the next request. What can I do to persist the values ?

$.ajax({
url: "/test.test",
type: "POST",
data: "{'type':'GetStep'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {...}
});


The second call is similar to this, but the values that get set when I call this function are also lost on the next request.

public void ProcessRequest (HttpContext context)
{
context.Session ["Game"] = new Game (); // next time it is null
}

How do I persist values in Session state in ASP.NET ?

Posted: Mar 9 at 12:36

View 1 Replies!   View Related
Persist A Change In A DBML?
I have a table of users called Users

And a view called UsersActive that filters out deactivated users.

When I create my DBML, I drag the Users table in, then I change the property on the table to point to UsersActive.

This works well, until the DBML gets re-created.

Does anyone know how to fix this?

I've tried overriding the

[Table(Name="dbo.Users")]

attribute in a partial class but get the error:

Duplicate 'Table' attribute

Posted: Jun 24 10 at 1:22

View 1 Replies!   View Related
How To Persist Page State Across Pages
I need a way to save and load the Page State in a persistent manner (Session). The Project i need this for is an Intranet Web Application which has several Configuration Pages and some of them need a Confirmation if they are about to be saved. The Confirmation Page has to be a seperate Page. The use of JavaScript is not possible due to limitations i am bound to. This is what i could come up with so far:

[code]....

I can't seem to find a way to load the Page State after being redirected from the Confirmation.aspx to the PageToConfirm.aspx.

Posted: Mar 24 at 9:49

View 1 Replies!   View Related
How To Persist The Data From A Repeater After Postback
I have a repeater that displays financial data and prices for various stocks.

On this page, I also have an "export" button that needs to take the data ~on the screen~ and convert it into a CSV for the user.

The problem is, after I databind my list of "Stock" entities:

List<Stock> stocks = GetStocks()
rptStockList.DataSource = stocks;
rptStockList.DataBind();

The data is not persisted on postback.

Also, the data on this page is constantly being updated via an UpdatePanel and a Timer control (being re-databound each time). Every 30 seconds the prices displayed for the various stocks in the repeater control change.

Now, I have a linkbutton that has a click event method in the code-behind that is supposed to export the ~data on the screen~ for the user. I need to grab the current values for the list of stocks last databound to the repeater. I can't simply go grab the latest values from the database because those will have been changed in the time between the last refresh.

protected void lbtnExportStocks_Click(object sender, EventArgs e)
{
// No longer have the stock data used in the repeater control
ExportStocksToExcel();
}

I know that ASP.NET doesn't persist the datasource for the repeater on post-back but I need to still be able to either re-construct this list of Stock entities so I can send them the CSV or I need persist it in some way.

I don't want to do anything that is too heavy handed in terms of performance because during certain days of the week this application can have some heavy usage.

What is the proper solution to this type of situation? Should I iterate through the Repeater's "Items" collection and reconstruct the Stock entities?

Posted: Jul 1 10 at 18:17

View 4 Replies!   View Related
What's Best Way To Persist Login And Password SQL Server - Uses SMO?
I am creating a simple web management studio using SMO. Is it secure enough to persist/store user information (login and password for database) using ASP.NET mechanism (e.g. formsauthentication, cookies, etc.). What will be the best practice to do this?

Posted: Oct 21 10 at 15:46

View 1 Replies!   View Related
How To Persist Javascript Changes On The Server Side
how to persist javascript changes on the server side.For example if I added items to a drop down list client side, how can i persist them in order to read them on the server side.By the way, Telerik control have this feature.

Posted: Jan 6 at 13:34

View 2 Replies!   View Related
C# - How To Persist Graph Data For Website
We've worked out some of the tasks on our website can be efficiently solved by maintaining the data using a graph structure. But we don't have much of an idea about how the graph is best persisted. Further we want to write and read simultaneously in an efficient manner in out asp.net app so it needs to handle multiple threads. It doesn't need to be super fast but it needs to be scalable to handle potentially millions of nodes.

I don't want to hack my own system and have heard of Neo4j. Lots of Java developers seem to recommend it to one another. Obviously I'm on the .Net platform and prefer to not have to switch.

What are the available options, particularly on the .Net platform?

Posted: Nov 1 10 at 4:20

View 1 Replies!   View Related
ViewState - How To Persist State Between Two Pages
On page1.aspx i hava a textbox with id="tb1"
On page2.aspx I have a textbox with id="tb2"

page2.aspx is set as postbackurl for page1.aspx. For both labels enabl;eViewState is true. Shouldn't the text I write in page1 also appear in the label on page2? Can I implement this without looking into Request headers, and setting the text myself?

Posted: Feb 16 at 15:58

View 1 Replies!   View Related
Get Buttons State To Persist Through Postbacks?
I have aGridView, who's Header Sort Events are redirected to a custom EventHandler.

ThisEventHandler calls a method that creates a Table with a series ofbuttons, options ect, adds them to a Panel it also creates, and then adds the panel to the form.

This all works fine.

The issue is with the buttons in the table (that's in the panel, that's added to the form).

I can't seem to get these buttons to work. I think this has something to do with the Postbacks and Viewstates, but not sure. (more accustomed to the garbage collector in WinApps)

How do I enable a dynamically created Panel and all of its contents to persist through postbacks?

Posted: Dec 23, 2009 07:46 PM

View 3 Replies!   View Related
How To Persist A Model Across Multiple Requests In MVC 2
I'm building a web application that has a particular model representing some events. Users need to be able to add N number of people to a given event. Choosing people is handled by a partial view.

I'm trying to build a menu that displays when users click "add a person" to the event. Because the event hasn't been filled out completely yet, there is nothing in the database to persist between requests.

I also have validation logic on the event page.

My proposed solution is to add the form to search or add for people on the event form itself and have a submit button that sends the values that have been added back to the server, where I can store them in ViewData or Session.

Unfortunately, doing this flags the validation.

My second solution is to load a partial view responsible for loading the UI to add/search for a person. I could add a little code on the method in the controller that returns a partial view storing the existing data in a session variable or viewdata. Trouble is, I have to submit the form to do it--again tripping the validation!

I'm wondering if perhaps I chose the wrong tool to do this...because in webforms, there would probably be a postback and you would just perform an operation on that postback. I'd like to avoid rewriting the application in webforms and am wondering if there are ways I'm overlooking in ASP.NET MVC.

Posted: Jan 3 at 21:20

View 1 Replies!   View Related
ADO.NET :: Persist The Changes In Datamanager.dbml File?
I am using Linq first time.

It has a Datamanager.dbml file

Stored procedure just drag here and method are created correspondence that stored procedure.

If i change any thing in any method in dbml file and drag any stored procedure here then All changes are lost.

Means if i change in a method in dbml file. And i drag a new stored procedure in that file then changes are lost and that particular method have its earlier formation that was by default generated by
dbml file.

How can i persist my changes in dbml file.

Posted: Dec 06, 2010 04:24 PM

View 1 Replies!   View Related
C# - Private Key Does Not Persist Even With X509KeyStorageFlags.PersistKeySet
I am storing a key pair in Windows Store, and recently started receiving the "Keyset does not exist" error. Investigating a bit further i found out it could be two things, 1 - The private key is not stored with the persist key set attribute (X509KeyStorageFlags.PersistKeySet) and 2 - access rights to the key. I have tried both 1 and 2 with no success on one machine (in my machine it works apparently). The strange thing is that when i look into MicrosoftCryptoRSAMachineKeys (and S-1-5-18) the key remains there but only for a period of time then it is deleted which means that it is not persisting.

//If decoded then save as RSACryptoServiceProvider
newCert.PrivateKey = DecodePrivateKey(privateKeyFile, pkPassword)
if (newCert.PrivateKey == null)
throw new System.NullReferenceException("Decoded private key resulted in a null reference. Unable to store certificate.");
byte[] pfx = newCert.Export(X509ContentType.Pfx);
newCert = new X509Certificate2(pfx, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);

I am running this code on a WCF Service hosted on IIS, and the certificate is deleted even if i give permissions to Network Service, the AppPoolIdentity, my account, etc through MMC-CertMgr. Would anyone know why this happens?

Posted: Dec 9 10 at 2:02

View 1 Replies!   View Related
MVC :: Persist Viewdata That Changes In The Master Page?
I have a nested master page with radio button controlsand one or twodropdowns (depending on the radio button chosen). The dropdown(s)contains either carriers or our customers. If the dropdown type is customer, we display another dropdown to determine what type of customer (current, former, or test). Once a carrieror customer is chosen,an action is called to "set" the customer information in the session. This all works great. The problem is trying to persist the dropdown type, customer type, and customer or carrier chosen over each action/view. Once a customer or carrier is set, the user can chose different menu options (also on the master page) to perform different tasks against the customer or carrier data. I am still fairly new to asp.net mvc and to jquery and ajax. I have racked my brain and tried several different scenarios to get this to work. I tried a master view model which got inherited by the other view models. I couldn't get that to work. Now I am trying a base controller and just setting things in viewdata, but I still can't get it to work once I move to next controller/action/view. Can someone please let me know the best practice for doing this? And or tell me where I'm going wrong? I am at a pretty critical point in this project and am running out of time. The code follows:

Global.asax:

[Code]....

Site.Master:
[Code]....

Posted: Dec 21, 2010 03:18 PM

View 4 Replies!   View Related
AJAX :: How To Have Some Property Like Always On Top For Autocompleteextender
I have small problem, i am using ajax control toolkit for the first time. I have autocomplete extender control. when aauto completecontrol is displayed ,some portion of it gets hide by other controls like textboxes below the textbox associated with autocomplete extender. so i want to have some property like always on top for autocompleteextender

Posted: Jun 15, 2009 02:48 PM

View 5 Replies!   View Related
How To Persist A DropDownList Control In Master Page
If you have aasp:DropDownList object ona master page, what's the best way to persist it's selected index between different client pages? I've got it working ok if I set it to AutoPostBack=true, but I don't like how it refreshes the page. If I turn off the AutoPostBack, then theOnSelectedIndexChanged does not fire, and I loose the status when I go to a new page. (I am a novice web developer so the answer may well be very basic!)

Posted: Nov 06, 2009 11:48 PM

View 3 Replies!   View Related
Web Forms :: How To Persist The State Of Object On Postback
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]....

Posted: Jan 26, 2011 05:04 AM

View 1 Replies!   View Related
C# - Persist Silverlight MediaElement Playing On Postback
I am trying to figure out how to persist the playing of a Silverlight MediaElement playing within a Silverlight User Control embedded in an ASP.NET during postback.

The scenario goes:

Have a media player on a site, press play, continue navigating through site while the music continues playing.

What it does right now:

Obviously the object gets loaded anew on each postback or page redirect (even if it's back to the same page IE: default.aspx).

I've seen samples of how to persist the state of a Control on postback and even complex data through cross-page postback. But nothing that covers my specific case.

Other particulars:

Silverlight 2
ASP.NET
C#

My default.aspx:

[code]....

Posted: Nov 18 10 at 5:17

View 1 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved