webchick wrote:
> 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
By the way, the webusercontrol is being called at design time(see
code):
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="RmrGood.aspx.cs" Inherits="RmrGood" %>
<%@ OutputCache Duration="60" Location="Client" VaryByParam="None" %>
<%@ Register Src="Components/RmrGoodControl.ascx"
TagName="RmrGoodControl" TagPrefix="uc2" %>
<%@ Register Src="Components/MenuControl.ascx" TagName="MenuControl"
TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<HEAD id="HEAD1" runat="server">
<TITLE>ECN - Request</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
<link href="style/ecn.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0
onLoad="MM_preloadImages('images/home_admin_02.gif','images/viewstatus_hover.gif','images/aproverfcn_hover.gif','images/userprofile_hover.gif','images/logout_hover.gif')">
<form id="Form1" runat="server">
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" valign="bottom" style="height: 151px">
<uc1:MenuControl ID="MenuControl1" runat="server" />
</td>
</tr>
<tr>
<td width="10" class="bartall" style="height: 192px" > </td>
<td bgcolor="#FFFFFF" width="964" valign="top" style="height:
192px">
<uc2:RmrGoodControl ID="RmrGoodControl1" runat="server" />
<td width="10" class="bartall" style="height: 192px" > </td>
</tr>
<tr>
<td colspan="3" background="Components/images/home_admin_19.gif"
style="height: 17px"> </td>
</tr>
<tr>
<td colspan="3" class="footer" >Copyright 2006-2007. All rights
reserved <br/></td>
</tr>
</table>
</form>
</BODY>
</html>
Just for your reference! Answers anyone? 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
-~----------~----~----~----~------~----~------~--~---