473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net 2.0 callback feature

does anyone know how this feature works? i have made a simple sample to
test it, it complied w/out any error, but when i ran the page, i got
javascript error, saying the javascript function "UseCallback()" that
created in code-behind is not defined. i am using winxp w/ sp2, ie6.
any help will be appreciated.

portion of the codes:
aspx page:
<script type="text/javascript">
function GetNumber()
{
UseCallback();
}

function GetRandomNumberFromServer(TextBox1, context)
{
document.forms[0].TextBox1.value = TextBox1;
}
</script>
....
aspx.cs page:
string cbReference =
Page.ClientScript.GetCallbackEventReference(this, "arg",
"GetRandomNumberFromServer", "context");
string cbScript = "function UseCallback(arg, context) {" +
cbReference + "; }";

Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"UseCallback", cbScript, true);

Jun 4 '06 #1
2 950
Try reading this:
http://www.reimers.dk/blogs/jjrdk/ar...6/02/07/4.aspx

mlcy wrote:
does anyone know how this feature works? i have made a simple sample to
test it, it complied w/out any error, but when i ran the page, i got
javascript error, saying the javascript function "UseCallback()" that
created in code-behind is not defined. i am using winxp w/ sp2, ie6.
any help will be appreciated.

portion of the codes:
aspx page:
<script type="text/javascript">
function GetNumber()
{
UseCallback();
}

function GetRandomNumberFromServer(TextBox1, context)
{
document.forms[0].TextBox1.value = TextBox1;
}
</script>
...
aspx.cs page:
string cbReference =
Page.ClientScript.GetCallbackEventReference(this, "arg",
"GetRandomNumberFromServer", "context");
string cbScript = "function UseCallback(arg, context) {" +
cbReference + "; }";

Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"UseCallback", cbScript, true);


Jun 4 '06 #2
thanks for your reply. i have had my code worked. :)

Jun 4 '06 #3

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

Similar topics

2
13194
by: Ray Stevens | last post by:
Anyone see this error that appears to have cropped up with the RTM version of .NET: BASE EXCEPTION:: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled...
1
17020
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
0
1440
by: skberen | last post by:
Issue: We have a web user control on a web page (aspx) that uses the new ASP.Net 2 feature Client Callback. The web user control is using a CheckBoxList control and button control to allow the...
2
627
by: matsla | last post by:
Hi, I use the ICallbackEventHandler interface, as per "Implementing Client Callbacks Without Postbacks in ASP.NET Web Pages". When i update some dropdown controlls in the callback and then do...
5
2262
by: Johannes Röckert | last post by:
Hi, can anyone help me on how to develop a program in c++ which does single step execution using a callback between the asm commands? I need something like debuggers do - a callback function...
0
982
by: kkmar | last post by:
Hello Please can somebody help me with issue. I am using CallbackEvent and trying to call that function from Javascript.I am trying to retrieve multiple values from database by sending...
2
2153
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
5
1933
by: sajin | last post by:
Hi All.. We are using VB .Net 2005 for implementing an API. API needs to generate events. For this client wants us to use Windows Callback (delegate implementation). The intention of using...
9
4529
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
1
6891
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
7381
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
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
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
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.