asp.net 2.0 callback feature

M

mlcy

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.GetType(),
"UseCallback", cbScript, true);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top