Sunday, March 11, 2012

Atlas or Ajax problem

Hi,
???I installed Ajax Beta 2?and?futures?November?CTP in my PC and wrote some simple testing codes in WebService.cs.I found it could access session variables in web service.Here are my testing codes for your reference.
<div>
<asp:UpdatePanel ID="upnlCallWebService" runat="server">
<ContentTemplate>
<asp:TextBox runat="server" ID="txtClientName" MaxLength="50" Columns="50"></asp:TextBox>
<asp:AutoCompleteExtender ID="AutoCompleteExtenderClent" ServicePath="~/Web Services/WebService.asmx"
ServiceMethod="HelloWorld" MinimumPrefixLength="1" TargetControlID="txtClientName" runat="server">
</asp:AutoCompleteExtender>
<asp:Button ID="btnCallWebService" runat="server" Text="Call WebService" OnClick="btnCallWebService_Click" />
<asp:Label ID="lblWebService" runat="server" Text="Web Service"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCallWebService" EventName="Click" />
</Triggers>
</asp:UpdatePanel
</div
protected void Page_Load(object sender, EventArgs e)
{
????Session["HelloWorld"] = "Welcome to use Ajax framework";
}

[WebMethod]
public string HelloWorld() {
?????return (Session["HelloWorld"] as string);
}

protected void btnCallWebService_Click(object sender, EventArgs e)
{
WebService ws = new WebService();
Label lblWebService = upnlCallWebService.FindControl("lblWebService") as Label;
lblWebService.Text = ws.HelloWorld();
}

So I suggest you to download the latest Ajax Beta 2 and Futures November CTP to install in your PC.Try to test it.If you have any question about this,can you post some codes here?This will be a great help for us to fix the problem.

Jasson_King:

Hi,
I installed Ajax Beta 2 and futures November CTP in my PC and wrote some simple testing codes in WebService.cs.I found it could access session variables in web service.Here are my testing codes for your reference.
<div>
<asp:UpdatePanel ID="upnlCallWebService" runat="server">
<ContentTemplate>
<asp:TextBox runat="server" ID="txtClientName" MaxLength="50" Columns="50"></asp:TextBox>
<asp:AutoCompleteExtender ID="AutoCompleteExtenderClent" ServicePath="~/Web Services/WebService.asmx"
ServiceMethod="HelloWorld" MinimumPrefixLength="1" TargetControlID="txtClientName" runat="server">
</asp:AutoCompleteExtender>
<asp:Button ID="btnCallWebService" runat="server" Text="Call WebService" OnClick="btnCallWebService_Click" />
<asp:Label ID="lblWebService" runat="server" Text="Web Service"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCallWebService" EventName="Click" />
</Triggers>
</asp:UpdatePanel
</div
protected void Page_Load(object sender, EventArgs e)
{
Session["HelloWorld"] = "Welcome to use Ajax framework";
}

[WebMethod]
public string HelloWorld() {
return (Session["HelloWorld"] as string);
}

protected void btnCallWebService_Click(object sender, EventArgs e)
{
WebService ws = new WebService();
Label lblWebService = upnlCallWebService.FindControl("lblWebService") as Label;
lblWebService.Text = ws.HelloWorld();
}

So I suggest you to download the latest Ajax Beta 2 and Futures November CTP to install in your PC.Try to test it.If you have any question about this,can you post some codes here?This will be a great help for us to fix the problem.

Hi Jasson_King,

Thanks for your help! Your code is very helpful!

I am using Windows XP Pro and VS 2005 and SQL 205.

And I need to download the"ASP.NET AJAX 1.0 Beta 2" at http://www.microsoft.com/downloads/details.aspx?FamilyId=F93BF884-EE17-4524-9E5E-EDB45F3D79F5&displaylang=en Right?

And I need to download"ASP.NET 2.0 AJAX Futures November CTP" at http://www.microsoft.com/downloads/details.aspx?FamilyID=D7101C1A-5993-4F70-9944-4B98F312502D&displaylang=en Right?

Thanks for your help again!

May


Yes,you are right.You'd better download Ajax control toolkit and Microsoft Ajax Library which will help you to do Ajax website application development.

Ajax control Toolkit:http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx

Microsoft Ajax Library:http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

Wish the above can help you.


Jasson_King:

Yes,you are right.You'd better download Ajax control toolkit and Microsoft Ajax Library which will help you to do Ajax website application development.

Ajax control Toolkit:http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx

Microsoft Ajax Library:http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

Wish the above can help you.

That's great! I am going to download all of them in the next 2 hours. And then I will try your code. And then I will let you know the result.

Thanks again!

May


When I double click on the ASPAJAXExtSetup (ASP.NET AJAX 1.0 Beta 2).
I got the following message:

"Another version of this product is already installed.
Installation of this version cannot continue. To
configure or remove the existing version of this product.
use Add/Remove Programs on the Control Panel."

I did not install ASP.NET AJAX 1.0 Beta 2). Then I double click on ASPAJAXCTP (ASP.NET 2.0 AJAX Futures November CTP)
I got the following message:

"Microsoft ASP.NET AJAX Futures November CTP requires
Microsoft ASP.NET 2.0 AJAX Extensions. The Microsoft
ASP.NET 2.0 AJAX Extensions installer can be found on
the website (http://go.microsoft.com/fwlink/?LinkID=76098). Please
install the product and try again."

And I did not install ASP.NET 2.0 AJAX Futures November CTP.


In fact a few months ago, I had installed the ASP.NET 'Atlas' on my laptop.
And I put the following code into my project.

<asp:TextBox runat="server" class="formElement" ID="txtClientName" MaxLength="50" Columns="50"></asp:TextBox>

<atlas:AutoCompleteExtender ID="AutoCompleteExtender1" ServicePath="AutoCompleteClients.asmx" ServiceMethod="GetSuggestions" MinimumPrefixLength="1" runat="server">

<atlas:AutoCompleteProperties TargetControlID="txtClientName" Enabled="true" />
</atlas:AutoCompleteExtender>

(Please note that the AutoCompleteClients.asmx contains C# code).

What these code does is that there is a textbox (txtClientName) for the user to enter a client name and then there is a drop down list shows all
the client names which match with the character(s) that the user enter into the textbox. For example:

The user enter J into the textbox. Then the drop down list will show all names which begin with J. Now the user enter I into the
textbox. In other words, JI is now in the textbox. And the drop down list will show all names which begin with JI. Now the user
enter M into the textbox. In other words, JIM is in the textbox. Now the drop down list will show all names which begin with JIM.
And so on. My problem is that I cannot able to pass a clinic variable into the "AutoCompleteClients.asmx".


If I install Atlas. Then install both "ASP.NET AJAX 1.0 Beta 2" and "ASP.NET 2.0 AJAX Futures November CTP". Can I still
get the textbox and drop down list feature work as I am having now using Atlas ?

Thanks,
May


Sorry I mean If Iun-install Atlas. Then install both "ASP.NET AJAX 1.0 Beta 2" and "ASP.NET 2.0 AJAX Futures November CTP". Can I still
get the textbox and drop down list feature work as I am having now using Atlas ?

Thanks,
May


You need to add?a reference to Ajax control toolkit as the following,besides,most of the controls in Ajax framework has asp tagprefix.Maybe you need to change the tagprefix of some?controls?with?atlas?tagprefix to asp tagPrefix.
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
e.g,
Microsoft.Web.Atlas.dll
<atlas:UpdatePanel ID="UpdatePanel1" runat="server"/>
Microsoft.Web.Extensions.dll or Microsoft.Web.Preview.dll
<asp:UpdatePanel ID="UpdatePanel1" runat="server"/>
Maybe you also?need to add reference toAjaxControlToolkit.dllin the ToolBox of Visual Studio .Net 2005.
Wish the above can give you some helps.

Jasson_King:

You need to add a reference to Ajax control toolkit as the following,besides,most of the controls in Ajax framework has asp tagprefix.Maybe you need to change the tagprefix of some controls with atlas tagprefix to asp tagPrefix.
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
e.g,
Microsoft.Web.Atlas.dll
<atlas:UpdatePanel ID="UpdatePanel1" runat="server"/>
Microsoft.Web.Extensions.dll or Microsoft.Web.Preview.dll
<asp:UpdatePanel ID="UpdatePanel1" runat="server"/>
Maybe you also need to add reference toAjaxControlToolkit.dllin the ToolBox of Visual Studio .Net 2005.
Wish the above can give you some helps.

Thanks! I will try this later.

Thanks again!

May

No comments:

Post a Comment