Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Wednesday, March 28, 2012

How do I use AJAX controls when my site was not created with AJAX enabled?

My site is not originally created with AJAX Conotrol Toolkit Web Site. How do I use the TabContainer and TabPanel?

Step 1 - Add the following references to your project...

.NET: System.Web.Extensions

.NET: System.Web.Extensions.Design

PROJECT / BROWSE: AjaxControlToolkit

Step 2 - Modify your web.config (add in the bits you don't have)

<configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/><section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><system.web><pages><controls><add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></controls></pages><compilation debug="true"><assemblies><add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation><httpHandlers><remove verb="*" path="*.asmx"/><add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/></httpHandlers><httpModules><add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></httpModules><system.webServer><validation validateIntegratedModeConfiguration="false"/><modules><add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></modules><handlers><remove name="WebServiceHandlerFactory-Integrated"/><add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></handlers></system.webServer>

Step 3 - Top of your aspx page

<%

@.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI"TagPrefix="asp" %>
<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>

I think that's about it!


Thanks! I'll give that a try. By the way, does the IIS server needs to have some kind of update for all my AJAX enabled pages to work?

As long as you've installed the ASP.NET AJAX (downloadable from this site ajax.asp.net) then you'll be fine - it has to be installed on the machine you're using as the web server as it places itself in the GAC.

Monday, March 26, 2012

How do I enable .NET 2.0 & AJAX 1.0 in VS2008?

I have to build some applications with VS2008 thatstill target .NET 2.0 and AJAX 1.0 (what we have been using in VS2005). I have created the new project as a .NET 2.0 project, but can't see how to enable AJAX 1.0.

How is this done please? Step by step instructions would be ideal.


Thanks in advance.

In VS 2008, we do not have a separate project type for AJAX Enabled Web site

All you have do is add the

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

from now on, you can start using the other AJAX server controls just like you did in AJAX 1.0 Extensions for ASP .NET 2.0


Right, I have to target .NET 2.0 because our web farms are going to stay .NET 2.0 for the forseeable future... and they also have AJAX 1.0 installed. So I need to make sure that I can build .NET 2.0/AJAX 1.0 compatible websites in VS2008... particularly I'll be building a basic template that my team can use to get up and running on VS2008 quickly.

Adding a Script Managerisn'tgoing to add the necessary components to my .NET 2.0 project so AJAX 1.0 runs without any other tweaking on my part- is it?

As I understand it, what you suggest would actually be using whatever the new version of AJAX is (instead of AJAX 1.0)... correct?


Well, in VS2008 we do not have a separate template for AJAX enabled web site. All you have do is drag and drop the AJAX controls to your page. Your website will work just fine even if only targetted to 2.0 framework


So when I deploy the VS2008 .NET 2.0/AJAX site to our .NET 2.0/AJAX 1.0 servers, there won't be an issue?? This is one of those things that I need to verify before I start pushing out new project templates, etc.


Well, this is what Microsoft is calling it as "Target Framework" as one of the key feature of VS 2008

I am using VS2008 Professional and tested the target framework feature and it is quite impressive. I only tested in my local machine though.

Hope this helps


I think the best way to do this:

- install, vs2005, asp.net ajax extensions 1.0, and finally vs2008

- create an ajax enabled web site/wap in vs2005 (or load your existing project if any)

- now open and convert the project in vs2008. Do not change the target framework, this ensures that your web.config and references remains compatible with the .net 2.0 + ajax 1.0 combo.

Maybe a new project (with 2.0 target) in a standalone vs2008 (no vs2005 installed) also works, I'm just wondering that in this case the project how to reference ajax 1.0?!


In doing some more experimentation, here's what I've figured out... sort of:

I converted copies of my old VS2005 web app templates to VS2008 (still targeting .NET 2.0). In fact, I didn't have to do anything special at all to get things to work. Just open the old Solution, tell it to convert, and bingo... things work. Of course this is a SIMPLE Master Pages based template, so nothing fancy going on that might cause trouble. ;)

The basic AJAX Extensions seem to run fine whether the project is targeting .NET 2.0 or 3.5.

I then installed the AJAX Controls for both AJAX 1.0 and the new 3.5 compatible version (two different tabs in the Toolbox in VS2008). When I have a 2.0 compatible project open, only the 2.0 Controls are available in the Toolbox (very smart!). So that makes it dead simple to use the right stuff in the right project(s).

Wanted to share this with the community - in the event someone else needs the help.


sound great. Please do not forget to mark the posts that helped you. By this way the thread will marked as answered.

Saturday, March 24, 2012

How do execute a server-side click event for a ModalPopupExtender?

I have created a modal popup to show up during page load. It is my logon dialog box. Anyways, I have set the OkControl property to my logon button to execute some codes through the ModalPopupExtender control staticly and dynamically through Page_Load but both didn't work..

What is my problem?

Thanks!

Ok, I follow the flow from this person website.http://blogs.vertigosoftware.com/alanl/archive/2006/07/25/Creating_a_Confirmation_Using_the_ModalPopup_Extender.aspx It works with a button.

I want to use the SHOW event when the page load but it doesn't work. It seem like it is not rendering the javascript or couldn't find it.

What is my problem?


Hi,

Have you tried this link?

http://blogs.msdn.com/phaniraj/archive/2007/02/20/show-and-hide-modalpopupextender-from-javascript.aspx