Creating an AJAX-Enabled Web Site - asp.net

I'am trying to follow an ASP.NET with AJAX Training. At certain moment, they deploy an AJAX-Enabled Web Site. but for me I can't found this option (I'm using Visual Studio 2008).
Even if I installed the Ajax Control Toolkit it still not working for me !!
What must I do to find this ?

Even if you can't find the template, you can still do everything the training kit needs.
The only difference between an ASP.NET web project and an AJAX-enabled ASP.NET web project is that it takes care of a few pre-requisites for you:
1) It adds a reference to the Ajax control toolkit. You can do this manually by right-clicking on your project in the Solution Explorer, choosing "Add Reference", and navigating to the AjaxControlToolkit DLL (or find it in under the .NET tab, if you've added it to the GAC).
2) It adds a ScriptManager control to your aspx page. It comes with the Ajax Control Toolkit. The ScriptManager is required to use any of the AJAX Control Toolkit controls. Add it to the top of your page.
If you take care of those two things, you should be good to go - it's the same thing as using the Ajax-enabled website template.

I have an issue in 2nd step. As i am using update panel and there is already a ScriptManager in master page, so I am using ScriptManagerProxy in updatepanel.
So when i start adding "ToolkitScriptManager" it shows error "Two scriptmanager" instances are not possible in one page...
Manish Jain

Related

SharePoint Webpart and ASP.NET User Control

I am developing SharePoint Web Parts for MOSS 2007 on Visual Studio 2008. Up until now, I've been adding all my controls by hand to the code behind... but an earlier post suggested I could use the designer to create an ASP.NET User Control, then add it to the webpart, and everything is happy... See figure 5 for an example.
However, I can't seem to add a new ASP.NET User Control to my MOSS WebPart project, the template just doesn't appear. If I create a WebApplication and make my User Control in there, I can't see any SharePoint templates to add to the project. Finally, I tried copying a simple aspx file and its code behind to my webpart directly, and adding them as an "existing component"... but now the designer won't recognize the aspx file. Next, I'd probably try adding two projects to my solution, and just referencing any dll's from the ASP.NET application...
So how do I get an ASP control into my SharePoint WebPart project so that I can use the Visual Studio designer?
Edit: So here is a partial solution where the ProjectTypeGuids needs to be modified. When I try this, it gives me an error saying "The project type is not supported by this installation". I am using Visual Studio 2008.
Try reading some of the following tutorials:
http://www.google.com/search?q=create+sharepoint+web+part+as+feature
What type of functionality and/or display are you trying to create? You may not even need a user control. For example, create a very simple "proof of concept" HTML table as a custom Web control (Web Part). Create it as a Feature and use the Solution Framework to deploy it:
Create a Web Part with VSeWSS 1.3 - Part I
Create a Web Part with VSeWSS 1.3 - Part II
Scott Guthrie offers up resources here on Web Parts and User Controls:
Writing Custom Web Parts for SharePoint 2007

Custom Server Control that can be dragged into design view in Visual Studio

How do I setup a custom server control, so that it can be dragged into a design view in Visual Studio?
I have create a separate ASP.NET Server Control project and a custom MailLink control, basically by copying the code from this MSDN article: How to: Use Custom ASP.NET Server Controls in Visual Studio. The control works fine, if I manually register the library and insert the control in my web page with these two lines:
<%# Register Namespace="Samples.AspNet" TagPrefix="Sample" %>
<Sample:MailLink runat="server" />
But how do I register / configure the control, so that it can be dragged into a design view i Visual Studio? If I drag my control from the solution explorer all I get is the path to the control. If add the dll from the server control project to my VS toolbox I get a clipboard FORMATETC error when I drag the control onto the design view.
Here's a how to that I found more useful than the MSDN one.
http://www.osnews.com/story/6802/Visual_Studio_NET_Design_View_and_Custom_Web_Controls
This shows a step by step process of how to handle it http://www.newmobilecomputing.com/story/6802/Visual_Studio_NET_Design_View_and_Custom_Web_Controls/page4/
Just to make sure we're on the same page:
There are more than one type of control you can build in ASP.Net. Unfortunately, depending on what kind of control you build you can normally only get designer support for a control from Visual Studio at either the time when you are developing the control, or the time you are developing the page where the control will be used, but not both. Controls that are not supported will just show up as grey boxes.
IMO this was a major failure of Visual Studio/ASP.Net, but I digress. I have seen this limit overcome by using an ascx control with no code-behind.
Now that that's out of the way, let's move on.
It sounds like in this case you're working with a Server Control. You're in luck, because Server controls should get designer support from Visual Studio when you're building the page where the control is used. However, you need to make the control available to the project.
Server controls are normally compiled down to a dll assembly. You must include a reference for this file in your solution. At this point you should be able to right click in your toolbox and select Choose Items.... This will present you with a dialog box that will allow you to select your assembly. At this point your controls should show up in the toolbox.
Unfortunately, Visual Studio can at time be quirky about adding these controls. You may need to restart Visual Studio for them to be available. Note that I still use Visual Studio 2005, so hopefully things have improved in this respect for 2008.

Silverlight in ASP.NET

Duplicate:
How do I use Silverlight from ASP.NET?
How do I add some Silverlight content to an already created ASP.NET website?
Add a new Silverlight application to your existing solution. Here's an MSDN article which shows how to integrate it with your existing website, so building the Silverlight application will deploy the Silverlight control to your ASP.NET website's Client_Bin folder.
To add a Silverlight control to a webpage in your site, you can reference the Silverlight test page that's automatically created for you, or you can use the ASP:Silverlight control, which will take care of loading the Silverlight object.
You only need to copy the XAP file to your site and reference it.
When you create a blank SL project you get the boiler plate code for the ASp .net site for free.
Having an ASP .net 3.5 SP1 enabled site, you can asp:Silverlight control:
Going without any ASP .net sugar control (you can use it on ie an php page), you can use an Object intance inside a div:
Soirry tried to paste code samples but didn't work well :-(.
Microsoft does not recommend using the ASP:Silverlight control as of Silverlight 3.
There's a great article at MSDN about how to include Silverlight using the <object> tag, or using the silverlight.js library: Integrating Silverlight with a Web Page. This helped clear up a lot of confusion for me.
This makes it much easier to provide a more customized experience that fits in better with the rest of your application.
(There's also a decent article explaining how to interact with the Silverlight control once it's embedded in your page: HTML Bridge: Interaction Between HTML and Managed Code)

How would you go about using the ASP.NET AJAX Control Toolkit in a project that doesn't use ASP.NET on the back end

Your backend could be PHP or Python but you want to use the controls from the ASP.NET toolkit is there a successful way to do this?
I don't think that it is possible.
The ASP.NET AJAX Toolkit is based on ASP.NET technique (what a surprise) and needs ASP.NET.
It contains server-side controls, which are translated to HTML and Javascript by the ASP.NET engine. It is not working without the engine.
However you can check the code itself to see how it is working, what it generates on the browser side and get ideas and Javascript codes to build into your application or framework.
Edit: I've just found an interesting project, which is in alpha stage, check this out.
Why do you want to use the ASP.NET AJAX Toolkit with PHP / Python?
Have you considered other non ASP.NET specific AJAX libraries like jQuery, Dojo, MooTools, YUI?
ASP.NET AJAX and the ASP.NET AJAX Toolkit is ASP.NET centric, you'll gain more flexibility using other AJAX libraries with PHP / Python.
are you talking about the ASP.NET AJAX Control Toolkit?
Have a look at this blogpost on Stephen Walther's blog:
ASP.NET MVC Tip #36 – Create a Popup Calendar Helper
In this post he shows how to use the 'script only' version of the AJAX Control Toolkit. This version of the AJAX Control Toolkit does not contain server-side controls or control extenders. It contains only the client-side files – JavaScript, CSS, images – required to use the client-side AJAX behaviors.
Stephen Walther is a Senior Program Manager at Microsoft who is responsible for ASP.NET MVC content and community (his job title is ASP.NET MVC Ninja).
I have found that much of the functionality in AJAX Control Toolkit can be accomplished via the javascript frameworks such as jQuery.

Compile errors after converting to a Web Application Project from a Web Site

I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at Converting a Web Site Project to a Web Application Project.
The issue is that standard ASP.NET controls that are embedded as child controls within the ContentTemplate of the Ajax Control Toolkit's TabContainer/TabPanel are no longer visible to the page (and result in compile errors). It appears that they can only be referenced with a call to FindControl whereas, when the project was a Web Site, they were directly accessible in the page's code behind file as properties.
Unfortunately, we have a lot of webforms that utilize the TabContainer, and converting all the references to child controls from simple property refences to FindControl calls will be quite burdensome.
While researching the problem I found a reference to a property called TemplateInstance in Single Instance Templates that seemed promising, but I understand that this is applicable to control designers, not control users. Any help would be much appreciated.
I thought I'd add one other point. The problem is not specific to the Ajax Control Toolkit's TabContainer. Indeed, I have a FormView control, and all the child controls in the ItemTemplate are no longer recognized by the compiler as being properies of the Page and result in compile errors. I can't believe that I have to change all of these propery references to findcontrol calls throughout my forms just because I moved from a Web Site to a Web Application Project. :-(
I'd be curious to hear what your final decision was to resolve this.
Reading your post, compared with my own current web app conversion research, leads me to venture out and refer you to this page hoping it may shed some light on what happens with your code-behind file upon conversion and compilation.
Did you generate a designer file for all the controls, via "Convert to Web Application..."

Resources