473,414 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

AJAX.NET Callback

Hi,

maybe there a couple of people working around with ASP.NET
Callbacks..... Callbacks are working fine i.e. a Button hit from the
client then makes server side work and then back again to the client
without any postbacks...

However when those values need to be used from the server side ... they
don't reflect the real value updated... my question is what needs to be
done to read a value from a control that has been updated by AJAX
callback ?

thanks

Mar 22 '06 #1
9 1228
PJ6
Give up with the standard event model, it's junk. Make your buttons AJAX,
too and you'll be all set.

Paul

"Varangian" <of****@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Hi,

maybe there a couple of people working around with ASP.NET
Callbacks..... Callbacks are working fine i.e. a Button hit from the
client then makes server side work and then back again to the client
without any postbacks...

However when those values need to be used from the server side ... they
don't reflect the real value updated... my question is what needs to be
done to read a value from a control that has been updated by AJAX
callback ?

thanks

Mar 22 '06 #2
You may find this helpfull http://atlas.asp.net/default.aspx?tabid=47

It is the atlas framework for ASP.net 2.0 and makes using AJAX with ASP.net
much easier.

"Varangian" wrote:
Hi,

maybe there a couple of people working around with ASP.NET
Callbacks..... Callbacks are working fine i.e. a Button hit from the
client then makes server side work and then back again to the client
without any postbacks...

However when those values need to be used from the server side ... they
don't reflect the real value updated... my question is what needs to be
done to read a value from a control that has been updated by AJAX
callback ?

thanks

Mar 22 '06 #3
what do you mean exactly ? yes almost I will do anything AJAX... but I
need to get values from those updated controls by AJAX... what are the
options ?

Mar 22 '06 #4
You have to access the control's values as you would with normal
clientside scripting. For example you would get a textbox's text using
the JavaScript command document.getElementById("textbox1").value;

The callback implementation in asp.net 2 doesn't allow you to use your
serverside script on the client, it only eases the setup of the
callback communication.

Mar 22 '06 #5
how can I do this? The GetCallBackEventReference already sets attribute
on a Button "OnClick" forexample ... how do I get back the value ? do I
need to override the "OnClick" attribute with another function ?

Mar 22 '06 #6
You can either use the ClientClick property of the button or you can
add an ordinary HTML button and give it a click event handler on the
client.

It's difficult to know what you are trying to do since you don't post
any code or link.

Mar 22 '06 #7
PJ6
You need to render some server-side script to get the values...

document.getElementById("RandomElement1").value

Paul

"Varangian" <of****@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
what do you mean exactly ? yes almost I will do anything AJAX... but I
need to get values from those updated controls by AJAX... what are the
options ?

Mar 22 '06 #8
ok then thanks first of all .. all of you :)

say I have this code on the Server Side

// On page set callbackreference
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("OnClick",
this.Page.ClientScript.GetCallbackEventReference(t his, "'datetime'",
"DisplayDateTime", null) + "; return false;");
}

#region ICallbackEventHandler Members

string s_CallbackResult;

public string GetCallbackResult()
{
return s_CallbackResult;
}

public void RaiseCallbackEvent(string eventArgument)
{
if (eventArgument == "datetime")
s_CallBackResult = DateTime.Now.ToString();
}

#endregion
now on the client side

function DisplayDateTime(result, context)
{
var label = document.getElementById('Label1');

label.innerHTML = result;
}

Now I want to use that Datetime value displayed on Label1 .... when I
did this and tried to get that value simply Label1.Text was marked as
"Label1" or ""

thats it? how can I retrieve that value from the Label ?

Mar 22 '06 #9
Take a look at this example and you are set to go...

http://www.ajaxtoday.com/ArticleDeta...5/Default.aspx

- Rafiq

"Varangian" wrote:
Hi,

maybe there a couple of people working around with ASP.NET
Callbacks..... Callbacks are working fine i.e. a Button hit from the
client then makes server side work and then back again to the client
without any postbacks...

However when those values need to be used from the server side ... they
don't reflect the real value updated... my question is what needs to be
done to read a value from a control that has been updated by AJAX
callback ?

thanks

May 6 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: NH | last post by:
Hi, I have been toying around with this for a day now. Has anyone else tried it? Two questions: 1: How do you pass a paramater to the server side event, e.g. if you wanted to pass a selected...
10
by: Showjumper | last post by:
There are 3 or so different AJAX libs that are out there available for use - Anthem.NET AJAX.Net Atlas Atlas as i undserstand it is for ASP.NET 2.0. What about about the other 2? Any comments,...
1
by: Mihir | last post by:
Hi There, I've problem while I submit a button where I used AJAX, I created simple page which will search the customer name from database using AJAX. Once I search customer ID i need to search...
0
by: Mathan Babu | last post by:
Hello, Once the AJAX request is fired the readystate property remain as 1. It never gets changed and the callback method is not firing as a result the ..aspx page is not being rendered. The...
0
by: Darren.Ratcliffe | last post by:
Hi everyone I am getting the above problem when I am trying to use AJAX on my Visual Studio 2005 solution - I seem to keep getting it when I click the back button in my browser. (And, the...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
by: Lit | last post by:
Hi, I would like to run some dynamic-JavaScript code at the end of a callback of an AJAX Call. for an update Panel 1---I click on a button on the browser, 2---AJAX method called server...
1
by: Joey | last post by:
Hey guys, here's what I have... To help manage browser windows with session state on the server, I have some javascript code in one of my master pages that gets planted into most (content) pages...
7
by: Andrew Poulos | last post by:
I'm working on a "simple" tracking system for a client that will be receiving elearning packages from 3rd parties. I'm intending to do the communication with the database using ajax. My...
12
by: canabatz | last post by:
i got this php file 'check.php' that checks for changes ,and showing a counter for posts !! $show_data="SELECT * FROM bidding_main WHERE bid_id='$bid_id' ";...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.