How To Save Data Through Ajax Webservice Without Postback
Mar 15, 2010Or is there any simpler solution ?
View 1 RepliesOr is there any simpler solution ?
View 1 Replies I have web app which stores certain things on a page in a cookie when the page posts back in case the user doesn't finish what they're doing and come back later. But now I must do a javascript time-out and actively save the info to the cookie rather than wait for the user to postback. All my cookie code is on server side where I use Response and Request objects to read and write cookies and I want to leverage that. So I would like to just use ajax calls to a webservice. Is there a way for me to access Request and Response objects and read and write cookies to the browser via those objects during a webservice call? Or should I just go with javascript?
EDIT: Sorry i wanted to specify that I would like to use jquery-ajax.
I have a page that calls a webservice from JavaScript using the approach described in this article: [URL]
This is working fine. The problem is when the page causes a postback before the end of the execution of the webservice's method. When that happens, the succeeded callback method never gets called. Does anyone know if there's a workaround to this?
I am looking for an event firing before a DropdownList auto-postback to save Listbox items (populated with JS) in the ViewState.I tried the OnSelectedIndexChanged event but it's fired too late.
View 5 RepliesI am using link button in updatepanel and click on asp:linkbutton it refereshes all page. to stop _dopostback on link button click.or any alternative to use linkbutton.
View 1 RepliesI am working on an application just like any fast food restaurant uses for example McDonalds.
Basically, application consists of three parts.
1) Web Application # 1 to take orders (Used by the clerk(s))
2) Web Application # 2 to process orders (used by the chef back in the kitchen)
3) WebService returns new orders (with PENDING status) to Web Application # 2.
Write now, Application # 1 adds new orders to the database. Application # 2 calls the WebService to get new ordes by REFRESSHING the page again and again. Refreshing the page over and over again is the problem.
I want the WebService to automatically send new data (oredrs with PENDING status) to Web Application # 2 whenever Application #1 add new order.
Application # 1 can call WebService (sending true flag) to let it konw that something has been added so the WebService can broadcast new date to Application # 2
Here is the flow which I am trying to achieve
Application # 1 (Takes new Order)
Application # 1 then call WebService (sending true)
WebService (if true is received), send new data to WebApplication # 2, cause postback on Applicatin # 2 automatically
For Example just imagine when you walk in McDonalds
Clerk takes your order -> New order is automatically send to the Kitchen (to process order)
Here is the breakdown
Application # 1 = Clerk taking order
WebService = Mechanism which is sending new order to Kitchen
Application # 2 = Monitor in the Kitchen receiving orders.
So I have a WebMethod that I call using jQuery. The method is supposed to return a unique URL to a image file created dynamicly.
The WebMethod is called in a for loop so anywhere from 1 to 50 calls gets fired async.
The problem is that the webservice seems to be using the same instance of the object, so that it returns the same value to a couple of the requests.
[Code]....
Shouldn't the WebMethod create a new instance of the class for each call, so that all values are stored individually in memory?
[Code]....
My scenario is create a webservice(regional weather prediction, or currency rate), and a client application having a updatepanel and then consume that service.Now, when webservice changes its data(temperture goes up or down, rate changes)I want to ask is there any way client can aware that webservice has changed so it will update properly.
View 3 RepliesI'm using Webservice which will return the data from the database through datatable and I'll convert the datatable into byte array. In front end, I'll reconvert the bytearray to datatable and used ajaxloader to display it in the form.. It is dynamic loading. So, for each click, it is taking 10 seconds to retreive the data regardless of the size of the data. So, I used static datatable and I've loaded all data in that datatable in page load event. But, no reaction. It is taking only same time. Even, there is no data to retreive, the ajax loader is going on loading for 10 seconds. Problem is with Ajax or my webservice?? Plz, tell me some other idea??!!
[Code]....
I am using a web service to pass back search results. To do this I am using ToolkitScriptManager with a ServiceReference to my web service and calling the web service up with javascript. The javascript call looks something like this:
WebService.GetResults("search term", OnSuccessGetData, OnFail);
If the request is successful the "OnSuccessGetData" function is fired and the results are inserted into a DIV tag. Because the resulting search results can be large I wrote the service to only pass back the first 20 results on the first trip. After that I make calls again to the service to return the next 5 results and continue to do this until all the results are loaded. This all works wonderful. You can see it in action at www.lsbio.com and use the search term "human mouse". My problem is that when the user clicks on a product and then hits the 'Back' button the search results have to be fetched again from the webservice.
Is there a way to keep the search results in the DIV tag to remain as part of the page so when the user navigates away from the search page and uses the 'Back' button to navigate back the search results are still there without having to hit the webservice again?
If I didn't make myself clear enough on what I am trying to do, go ahead and test the site www.lsbio.com, use the search terms human mouse, click on a product and then hit the back button.
Background:I'm building a custom control as a base class that derives from CompositeControl. It consists of a FormView, a ObjectDataSource and a CRUD-Button Series (Create, Read, Update, Delete - Buttons). I'm loading the different FormView templates within the deriving classes dynamically from file with Page.LoadTemplate().
Class structure:
TabControlBase:CompositeControl
Employer:TabControlBase
Applicant:TabControlBase
Each deriving class knows the specific template-paths for loading FormViews templates.
The ObjectDataSource is connected with a DAL using a Select and an Update Method. The Select-Method works fine: When loading the CompositeControl the data of the DAL are shown in the Labels of the embedded FormView (ReadOnly-Template). When I'm switching to Edit Mode the data also are displayed in the TextBoxes (Edit-Template).
The problem occurs when I'm trying to update data using the "Save" - Button: The connected DAL-Method is calling properly, but the parameters all are NULL.Tree structure of this custom control:
Panel -
--- FormView
EditTemplate (ascx): Name, Name1, Segment
--- ObjectDataSource
--- CRUD-Button Stack: New, Edit, Delete, Save, Cancel, Copy, Print
All controls will be added dynamically in the base class "TabControlBase" within the overridden CreateChildControls - method. The CreateChildControls method is called by the deriving classes e.g. Employer after setting specific properties e.g. templates,
object data source methods etc.The control is placed in a simple abc.aspx-Page. What I detected so far on PostBack
- When I'm looking at the ViewState Collection within the OnLoad-method of the abc.aspx the ViewState-Collection is Null (Count = 0)
- It seems that the control tree is empty. I'm not able to find any control using a proper working recursive FindControlMethod
- Only the Page.Request Collection shows the expected controls
Conclusion for now:It seems that the CompositeControl "forgets" the values of the FormView TextBoxes on PostBack. It seems it has to do with ViewState Management.
I have one AsyncFileUpload control ,one Attach button,one Listbox and Save button.
When Users browse the file and click the attach button, filename must be added to listbox. So in this way the user has the option to add upto multiple filenames to listbox. For this i have written the following code
[Code]....
this is source code
[Code]....
In Attach button click event i added the filename to listbox and saved the Asyncfileupload controls in different session variable.
When user clicks on save button all files has to be saved in application folder and for this i wrote the following code.
[Code]....
But iam unable to save all the files . Suppose i added two AsyncFileupload controls to session variables, only last file i,e. 2nd file can only be saved and couldn't get first file.
[Code]....
How can I save asp:HiddenField value across postback?
View 4 RepliesI am new to AJAX. I am designing a feedback form for a video conferencing session in asp.net web application which will be displayed as a modal window. The questions on the modal window will be displayed from a table stored on SQL Server 2008 and the responses of those questions should again be stored back in a different table on SQL Server after user clicks on the SUBMIT button on the modal window (and also, the window should close after the action).
I am not aware of the way to retrieve data from or store data to SQL server from modal window though I know how to retrieve and store data using asp.net and c#...
I have two repeaters where i'am moving rows from one to another by jquery drag and drop.
My question is, I want to achieve the first and second columns (they are the parameters) of each repeater (table) so that could call a webservice to make the update on database. So, how I achieve this and how can i call a webservice passing to the method the parameters for each change on both tables.
When an asynchronous postback happened inside update panel, another postback happens also for MasterPagenot only update panel embedded page .I want to prevent this MasterPage postback . is this possible ?think like i have a MasterPage and another page which is test.aspx which is content page of MasterPagei have update panel at test.aspxwhen asynchronous postback happens at this test.aspx update panel it also loads
MasterPage Page_Loadi want to prevent this (it should not also load MasterPage Page_Load)
Since data saving is a time consuming, I would like to call data saving method using Ajax and that too Async what i mean is as soon as the user click submit button it just display the confirmation page and data saving bit keeps going on in the background.
Is this possible using Ajax tool kit?
How to save data from html controls(radio button,dropdownlist,listbox,checkbox) to database by using jquery ajax.
View 1 RepliesI'm referring in this question [URL] ....
and now what I want is without using the submit button and save to database
I want to add gridview row data into to data base I am doing it perfectly.My problem is that want all gridview row data save and then web method should be called but in my cause one gridview data save in array then call webmethod,then other row data save in array then call webmethod called this process should be so on.But I want it webmethod should be called when all gridview row save in array.
Follwing code
Jquery
<script type="text/javascript">
$(function () {
$("[id*=btnSubmit]").bind("click", function () {
var Customer = {};
[code]....
need to save autonatically after 10 am.
View 1 Replieslets say you have the toggle buttons from this page: [URL]
and you put it in a UpdatePanel AJAX... so lets say on a partialpostback.. when you re-create teh controls on server-side, the state of whether or not those buttons were pushed is long-lost and gone.. so how then how do you remember those states?
Can I save each button state into viewstate or session state? regenerate each button then call the javascript function to change its color-state depending on the session state variable?
i my futur webpage i wan't to use ajax. First i tough to use a panel to hold my controls and turn in visible/invisible with buttons. But if i use ajax and i refresh the page and show other controls.
I have a page with 3 different kind of data. in the first you can't type a name, you function, ... in the other more specific and the last one an evaluation. but if i refresh my page to a other what hapends with the data i typed in the first, can it be saved at temporary place. Because at the end all the data will be saved in a SQL database, but it still needs to be possible before it goes into the database to change it.
OK, here's my scenario. I inherited a website and I'm dealing with a quirk. I have a page that has a repeater with auto postback controls in it. And also a hyperlink or a button to open a RadWindow to add a new item or edit an existing one, the repeater probably could have been a Gridview, but forget that for now.
If you use the button to add a new entry or the hyperlink to edit, it works fine and closes and refreshs the page. BUT, after you click ANY of the auto postback check boxes and THEN try and use the new button or edit hyperlinks the RadWindow works, but on clicking SAVE or CLOSE it throws a dialog box in IE and Firefox letting the user know that:
"To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."
IE's message is similar. Clicking RESEND works fine and everything is ok, but its a bit distracting to the user. The RadWindow open a page that has THIS javascript in it:
function RefreshParentPage() {
I'm not sure whether or not this is the correct forum...I have been asked to develop a webpage with a very simple table. 10 columns, 10 rows. Each cell will have a dropdownlist. Several people will have this page up at any given time and they will all make changes as needed. I am planning on using a SQL Server
2008 database to keep track of the entries.I need the page to verify the data it contains against the data in the database every 5 seconds or so. If they are different, either the page can refresh or (if possible) the dropdownlist can just change to the correct value.