Showing posts with label conversion. Show all posts
Showing posts with label conversion. Show all posts

Saturday, March 24, 2012

Atlas to RC1 Conversion

I have a pretty big Atlas website which I love. I want to go to RC1 but I hear trying to do that will make me stop loving my atlas website.

Is there a guide that I can use to upgrade from atlas to RC1?

Do you guys recommend that I just wait for the RTM?

Thanks!

Try thishttp://ajax.alpascual.com/Walkthrough/AtlasToAspNetAjax.aspx

Since I posted this I found: http://ajax.asp.net/files/Migration_Guide_CTP_to_RC.aspx

I guess there are A LOT of web.config changes to be made. Thanks for your reply though. I've learned from your posts before.



keenster:

Since I posted this I found: http://ajax.asp.net/files/Migration_Guide_CTP_to_RC.aspx

I guess there are A LOT of web.config changes to be made. Thanks for your reply though. I've learned from your posts before.

Thanks, very kind of you!

Let me know if you have any problem migrating, its pretty straigh forward.


ahh ha! It all works...except for the autocompleteextender. I think that needs it's own post.

I think i was successfull this time because i add to the web.config file that came with RC1 instead of trying to change mine to match it.


Atlas to AJAX conversion problem with delegate. Need help.

I'm having trouble with the sample below since moving from Atlas to AJAX.
I've done a LOT of research with prototypes and delegates, but I can't get
this simple, "class-like" example to work in AJAX as it did in Atlas.
Any help greatly appreciated. Thanks in advance.

============ASPX PAGE=============

<%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="WebApplication1.test" %>

<!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">
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="ScriptManager1">
<Services>
<asp:ServiceReference Path="WS1.asmx" />
</Services>
</asp:ScriptManager>
<input type='button' value='Click me' id='myButton' onclick='doThis(778899)' />
</form>
</body>
</html>

<script type="text/javascript">

function doThis( MyNumber ){

var tmpOjb = new MySampleClass( MyNumber );
tmpOjb._StartMyFunction();
tmpOjb = null;

}
MySampleClass = function( MyNumber )
{
this._MyNumber = MyNumber;

this._StartMyFunction = function()
{
// This WORKS, but with asyncronous call...
// ... this._MyNumber is lost when _MyReturnHandler is run
/* */
WebApplication1.WS1.HelloWorld(
this._MyNumber,
this._MyReturnHandler);
/* */

// This DOES NOT WORK anymore, but DID with Atlas..
// How can I get this to work again??
/*
WebApplication1.WS1.HelloWorld(
this._MyNumber,
{onMethodComplete: Function.createDelegate(this, this._MyReturnHandler)});
*/
}

this._MyReturnHandler = function(result)
{
alert(result + "::::" + this._MyNumber);
}
};

</script>


============ASMX PAGE=============
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Text
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.ComponentModel

<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
<ToolboxItem(False)> _
Public Class WS1
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function HelloWorld(ByVal myNumber As String) As String
Return "Hello World [" & myNumber & "]"


End Function

End Class

The userContext is available for this purpose.

<script type="text/javascript">

function doThis( MyNumber ){

var tmpOjb = new MySampleClass( MyNumber );
tmpOjb.StartMyFunction();
tmpOjb = null;

}

MySampleClass = function(myNumber) {
this._myNumber = myNumber;
}

MySampleClass.prototype = {
StartMyFunction : function() {
var userContext = "Here is some text. This can be a JSON object too";
WebService.HelloWorld(
this._myNumber,
this._OnSucceed,
this._OnFail,
userContext);
},

_OnSucceed : function(result,userContext)
{
alert(result + "::::" +userContext);
},

_OnFail : function(error) {
alert(error);
}
}

</script>

http://ajax.asp.net/docs/ClientReference/Sys.Net/WebRequestClass/WebRequestUserContextMethod.aspx


Thanks Raj! That saved me a lot of time.
I wish I submitted the question earlier.

Thanks again.

Atlas to AJAX Conversion

I am very new to Ajax and unfortunately I was kind of thrown right into the middle of it. My predecessor created a webpage using Atlas and never finished it before he left and now I need to convert it to Ajax and get it finished. I am in the process of converting it but I have come across this one section of code that I cannot seem to figure out the conversion.

PublicSub SetConfirm(ByVal buttonAs LinkButton,ByVal TextAsString,ByVal ConfirmExtenderAs AtlasControlToolkit.ConfirmButtonExtender)

ConfirmExtender.TargetProperties.Clear()

Dim propAsNew AtlasControlToolkit.ConfirmButtonProperties

prop.ConfirmText = Text

prop.TargetControlID = button.ID

ConfirmExtender.TargetProperties.Add(prop)

EndSub

If I change AtlasControlToolkit.ConfirmButtonExtender to AjaxControlToolkit.ConfirmButtonExtender like VS2005 recomends it underlines ConfirmExtender.TargetProperties in blue as well asAtlasControlToolkit.ConfirmButtonProperties. I expectedAtlasControlToolkit.ConfirmButtonProperties to be underlined but the suggested alternates don't match. I get the following options:

AjaxControlToolkit.ConfirmButtonExtender

AjaxControlToolkit.AnimationScripts

AjaxControlToolkit.ToggleButtonExtender

I would assume the first one but it when I go to fix ConfirmExtender.TargetProperties it does give me any thing even remotely close to TargetProperties.

PublicSub SetConfirm(ByVal buttonAs LinkButton,ByVal TextAsString,ByVal ConfirmExtenderAs AjaxControlToolkit.ConfirmButtonExtender)

ConfirmExtender.TargetProperties.Clear()

Dim propAsNewAjaxControlToolkit.ConfirmButtonExtender

prop.ConfirmText = Text

prop.TargetControlID = button.ID

ConfirmExtender.TargetProperties.Add(prop)

EndSub

It might be the way it is being used in the *.ascx page. Here is the code:

<asp:ImageID="Image7"runat="server"ImageUrl="~/Images/optionbullet_Lightblue-gray.gif"/>

<asp:LinkButtonID="LBtnDelete"runat="server"Text="Delete"/>

<cc1:ConfirmButtonExtenderID="LbtnDeleteExtender"runat="server"/>

Thanks in advance for the help.

Hi, check this link how to configure AJAX in web.config

http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx

Smile


You want to set the TargetControlID and ConfirmText properties. You can set that in the markup, e.g:

<cc1:ConfirmButtonExtender ID="LbtnDeleteExtender" runat="server"
TargetControlID="LBtnDelete" ConfirmText="..." />

or in code:

LbtnDeleteExterder.TargetControlID = LBtnDelete.ID;
LbtnDeleteExtenderConfirmText = "...";


Have you configure your application for AJAX..

Post it on forum, if solved your problem.


Hi,

as Scott suggested, you should set the TargetControlID and ConfirmText properties on the Extender instance. You have to get rid of TargetControlProperties instances.

Back to the "Atlas" times, a single Extender instance could be bound to multiple server controls. To do that, you had to declare multiple TargetControlProperties instances as children of the Extender instance. Each TargetControlProperties had the purpose of configuring the Extender functionality for a given server control.

Now, an Extender is associated to only one server control. Therefore, all the configuration job is done in the Extender instance. The TargetControlID property specifies the ID of the extended server control.

Atlas to Ajax Conversion

I am very new to Ajax and unfortunately I was kind of thrown right into the middle of it. My predecessor created a webpage using Atlas and never finished it before he left and now I need to convert it to Ajax and get it finished. I am in the process of converting it but I have come across this one section of code that I cannot seem to figure out the conversion. Can someone please help me?

PublicSub SetConfirm(ByVal buttonAs LinkButton,ByVal TextAsString,ByVal ConfirmExtenderAs AtlasControlToolkit.ConfirmButtonExtender)

ConfirmExtender.TargetProperties.Clear()

Dim propAsNew AtlasControlToolkit.ConfirmButtonProperties

prop.ConfirmText = Text

prop.TargetControlID = button.ID

ConfirmExtender.TargetProperties.Add(prop)

EndSub

Thanks in advance for the help.

You need to get the AJAX Control Toolkit, and use that to replace the ATLAS Control Toolkit.

If that's not it, provide a little more detail on the specific s of the problem, and we'll get it.


I just realized that it might be the way it is being used in the *.ascx page. Here is the code:

<asp:ImageID="Image7"runat="server"ImageUrl="~/Images/optionbullet_Lightblue-gray.gif"/>

<asp:LinkButtonID="LBtnDelete"runat="server"Text="Delete"/>

<cc1:ConfirmButtonExtenderID="LbtnDeleteExtender"runat="server"/>

I would really appreciate any help I can get with this.


If I change AtlasControlToolkit.ConfirmButtonExtender to AjaxControlToolkit.ConfirmButtonExtender like VS2005 recomends it underlines ConfirmExtender.TargetProperties in blue as well asAtlasControlToolkit.ConfirmButtonProperties. I expectedAtlasControlToolkit.ConfirmButtonProperties to be underlined but the suggested alternates don't match. I get the following options:

AjaxControlToolkit.ConfirmButtonExtender

AjaxControlToolkit.AnimationScripts

AjaxControlToolkit.ToggleButtonExtender

I would assume the first one but it when I go to fix ConfirmExtender.TargetProperties it does give me any thing even remotely close to TargetProperties.

PublicSub SetConfirm(ByVal buttonAs LinkButton,ByVal TextAsString,ByVal ConfirmExtenderAs AjaxControlToolkit.ConfirmButtonExtender)

ConfirmExtender.TargetProperties.Clear()

Dim propAsNewAjaxControlToolkit.ConfirmButtonExtender

prop.ConfirmText = Text

prop.TargetControlID = button.ID

ConfirmExtender.TargetProperties.Add(prop)

EndSub

Atlas TabControl: conversion to Ajax (.net 1.0 rc) failed

Hi,

I found a nice tabcontrol that has ajax enabled through the atlas dll. (location:http://geekswithblogs.net/steveclements/archive/2006/08/27/89438.aspx)

I wanted to convert it so it uses the new AJAX 1.0 RC. When I do so, I get an error on the javascript that updates the active button; can someone tell me what is going wrong?

The javascript error is: Object Expected and I get it linenumber 26 in the javascript below. It has something to do with the $( ) but it works great with the non enabled AJAX website using the atlas dll.

1<script type="text/javascript" language="javascript">2 // Var to store active tab...set to first tab on page load.3 var activetab;4 this.onload = function() {5 activetab = "tab1";6 }78 function tab_OnMouseOver(tab)9 {10 // Only use hover effect if tab is not active11 if(tab.className != "tabactive"){12 tab.className = "tabover";13 }14 return false;15 }16 function tab_OnMouseOut(tab)17 {18 if(tab.className != "tabactive") {19 tab.className = "tabs";20 }21 return false;22 }23 function tab_activate(tab)24 {25 // Set current active tab to normal26 $(activetab).className = "tabs";27 // Set tab class to active28 $(tab).className = "tabactive";29 // Set activetab var to this tab30 activetab = tab;3132 // return true so the control will still postback33 return true;34 }35</script>

If someone wants the two projects to look at it more closely, just let me know; or try it yourself! The atlas tabcontrol source can be located at site mentioned above.

 This is the asp.net code of the button which calls the javascript (maybe it helpsHuh? ): 
 
<td class="tabactive" id="tab1" onmouseover="return tab_OnMouseOver(this)" onmouseout="return tab_OnMouseOut(this);">   <asp:LinkButton CssClass="tabbtn" runat="server" ID="LinkButton1" Width="90" OnClientClick="return tab_activate('tab1');" CommandArgument="0"></asp:LinkButton></td>

The $() function was removed some time ago (I think at Beta 1). The new name for that function is $get().


Changing the $() to $get() resolved the problem! All works fine now.

Thanks alot Steve!