Showing posts with label framework. Show all posts
Showing posts with label framework. Show all posts

Monday, March 26, 2012

AJAX asynchronous calls without update panel

Is the UpdatePanel always needed to make Asynchronously calls to the server? I was catching up with the client side capabilities for the framework using the $get and $sys client classes and seem to provide a lot of functionality. Any samples, tutorials where I can go to get some reference. I went through the AJAX framwework documentation but no help.

No, you can also use webservices or pagemethods take a look at these links:

http://www.asp.net/ajax/documentation/live/overview/AsynchronousLayerOverview.aspx

http://www.asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx

http://www.asp.net/ajax/documentation/live/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx

Hope this helps,
Elias.

Wednesday, March 21, 2012

Ajax and Expression Web

Hi Guys,

Is it possible to add the Microsoft Ajax Framework to Expression web so that the controls show up in the Expression Web toolkit ?

If not is a version going to be availble for Expression web ?

Kind Regards

Andy

I would really like to know this as well. If Expression Web is the future of front-end web development, why can't I use the official ASP.Net AJAX components in my projects? Is there some other way to work with developers using Visual Studio 2005 and the new control toolkit?

Does anyone have any information on this?

I'd really like to know if this is possible. I'd agree that it is insane if not! I wish Microsoft would consolidate their web design/development products into one (preferably Visual Studio).

Thanks in advance.


I found this link about the topic http://blogs.msdn.com/andrewj/archive/2006/12/13/custom-asp-net-controls-and-expression-web.aspx , but it talks about using the GAC. Can someone from MS chime in and tell us if our controls must be in the GAC to use them in expression web?

Thanks,

Jon


You can access the ajax items in Expression provided the web.config is setup to use MS Ajax. What I did was create a project using the ajax web template (control or just ajax) in Visual Studio 2005 and then opened up that project in Expression. The issue is the tags are available in the 'code' view, but you get an error in 'designer' mode. You'll also see this if you build user controls that reference 3rd party controls (like the RAD controls). I have not been able to get the designer to use the controls without this error so I'm assuming the designer does not know about the 'referenced' dll objects.

If you don't have VS Studio or the Ajax template, you can manually add the ajax support -- but it is a bit of a pain...

-Don


Andy

Easiest way is to open up to explorer windows, one to where you install the ajaxcontroltoolkit.dll and the other to windows\assembly.

Drag and drop the ajaxcontroltoolkit.dll into the assembly folder.

Add the following to each page which references controls from the toolkit, best to double check the version and publickeytoken - you can see the values in the assembly folder.

<%@. Register
Assembly="AjaxControlToolkit, Version=1.0.10606.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
Namespace="AjaxControlToolkit"
TagPrefix="ajaxToolkit" %>


ToolkitScriptManager still can't display for some reason, I'll keep digging.

HTH

Rob


Thanks for that Rob, but why do we have to struggle to do it and why can Microsoft Visual Web Developer Express a free tool from Microsoft install the Ajax controls but the money costing Expression Web can't !!!

All I can say is . . . BRING ON THE NEXT VERSION OF EXPRESSION WEB . . . as the ability to add new controls easily is crucial, at the moment you have to build part in Expression Web and then open it in VWD Express to use Ajax, its just so annoying !!!


When I try to either drag n drop or copy/paste the system will not allow me to put the ajaxcontroltoolkit.dll into the Wndiows/Assembly directory.

There are seveal ajax controls I would like to use on my site but can not get them to work in Expression Web. We have just converted to using Expression Web for designing updates to our application. The tool is far superior to the old FrontPage but I am having some learning pain when trying to step up to ASP.NET and learn how to use it.


Has there been any progress made on this issue? I googled it a bit but didn't turn up too much.

I have just installed Expression Web and I am a bit hesitant to use it because the site I am currently designing makes heavy use of AJAX controls.

I did read a few things about using custom ASP.NET controls in Expression. About using GAC and editting your web.config. Will these same techniques allow Expression Web to fully integrate AJAX controls?

http://blogs.msdn.com/andrewj/archive/2006/12/13/custom-asp-net-controls-and-expression-web.aspx


So I got everything working. I figured I'd explain how for future viewers.

This is how you get Ajax and the AjaxControlToolkit working in Expression Web (code view w/ intellisense and design view with properties).

STEP 1 - In your sites web.config file you must have the following:

<system.web>
<pages>
<controls>
<addtagPrefix="asp"namespace="System.Web.UI"assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<addtagPrefix="ajaxToolkit"namespace="AjaxControlToolkit"assembly="AjaxControlToolkit, Version=1.0.10920.16768, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
</controls>
</pages>

<compilationdebug="true">
<assemblies>
<addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<addassembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<addassembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<addassembly="AjaxControlToolkit, Version=1.0.10920.16768, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
</assemblies>
</compilation>
</system.web>

NOTE: The assmebly version and keys may vary depending on what version of the toolkit you have installed. These are simple enough to find in the sample website for the AjaxControlToolkit's web.config.

NOTE: Since the AjaxControlToolkit is referenced in the web.config you do not need to include <%@. Register Assembly... %> on each of your pages.

STEP 2 - Add the AjaxControlToolkit.dll to your site's bin folder.

STEP 3 - Add the AjaxControlToolkit.dll to GAC

This is simple. Open the Visual Studio Command Prompt (from Start menu) and navigate to the bin folder of your site and type d:\> gacutil /i AjaxControlToolkit.dll

Now open your site in Expression Web and everything should be working!


One thing I would like to add...

The line in <assemblies> for the AjaxControlToolkit has version info and a publicKeyToken that cannot be found in the web.config of the sample website and it will vary depending on the version of the Toolkit you have installed.

To find this info you can either write a small program (1 line of code really) or just put the following line into a Watch while you are debugging something:

System.Reflection.Assembly.LoadFile(@."[PathToAjaxControlToolkit]\SampleWebSite\Bin\AjaxControlToolkit.dll").FullName

This will give you the text to put in the assembly attribute for the <add assembly=""/> line.

The file you reference here must be the same one you add to the GAC.



Oh won't some kind soul come and mark my post as the answer?


Yeah, I had a problem getting that going too. A quick powershell script handed the info over for me. I guess Reflector would produce the same result as well.

PowerShell script:

$assembly = [System.Reflection.Assembly]::LoadFile("path\to\AjaxControlToolkit.dll")
$name = $assembly.GetName()
"<SafeControl Assembly=""{0}"" Namespace=""{1}"" TypeName=""*"" />" -f $assembly.FullName,$assembly.GetName().Name

Output:

<SafeControl Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TypeName="*" />