Hi Everyone,
I'm a newbie in AJAX .NET and have only tried experimenting the
technology with ASPX pages before. Now that I am calling
WebUserControl (ASCX pages) with AJAX, it doesn't work. I have tried
searching for answers in previous posts, have tried suggested
solutions, but I just can't seem to get it up and running.
Here's background of the problem: I have an ASPX page named
RmrGood.aspx, which calls an ASCX page named RmrGoodControl.ascx,
located at the Components folder, so calling it would create a relative
path Components\RmrGoodControl. I registered the class inherited by
RmrGoodControl.ascx. (please see the following code):
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(Components_RmrGoodControl));
}
}
I created an AJAX method:
[AjaxPro.AjaxMethod]
public string ComputeTotalQuantity()
{
return something;
}
And a javascript function to call the AJAX method in
RmrGoodControl.ascx:
function ComputeTotalQuantity()
{
Components_RmrGoodControl.ComputeTotalQuantity(ComputeTotalQuantity_CallBack);
}
function ComputeTotalQuantity_CallBack(response)
{
// Check that if any errors are returned
if(response.error == null)
{
// get the value from the response into the var object
var dt = response.value;
//alert(dt);
if( dt!=null )
{
document.getElementById("RmrGoodControl1_lblQuantity").innerHTML = dt;
}
}
else
{
alert("ComputeTotalQuantity_CallBack - " +
response.error.Message);
}
}
What's funny is that when I tried to run my application in the debug
mode and placed a breakpoint at the following line:
AjaxPro.Utility.RegisterTypeForAjax(typeof(Components_RmrGoodControl));
When I viewed the watch message it has the following error:
The type 'Components_RmrGoodControl' exists in both
'{7DD1F5D7-3A91-46DB-A5DB-EE9EC509BA2E}' and
'{4D00C73C-E635-4697-BCC5-DA01233D089A}'
What does this mean? Did I register the control twice? Please help.
Will greatly appreciate your quick response.
Many Thanks!!
webchick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---