ASP.NET Ajax feature in existing ASP.NET website - asp.net

I have a ASP.NET Website which was developed in ASP.NET 2.0.
Now I want to add a new page to the project which will make use of the ASP.NET AJAX features like Partial page updating.
Is there any options to do this ? Do i need to change any settings for this in my already existing project /Solution ?

The only problems you may run across is inside you web.config file if you don't go in and register the asp.net ajax assemblies.
Other than that you should be able to add a scriptmanager control and work with the page like any other asp.net ajax page.
Edit: Here is some documentation that should help you configure ASP.NET AJAX to an existing website.
http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx

There is a great tutorial about how to implement AJAX on a regular ASP.NET web site.
http://www.asp.net/learn/ajax-videos/video-81.aspx
Hth...

Related

Launch an ASP MVC project from a normal .aspx page

I have an existing ASP.NET web site running on .NET 4.5. I need to integrate an ASP MVC 4 project (which is its own fully-functional web application) into it so that when the user navigates to a certain page, the ASP MVC application is launched within the page - almost as if it were in an iframe.
In the main solution I can set both as startup projects, but this is obviously not what I am looking for. Can someone point me in the direction of how to do this? I have never used WCF before, but is this something that it could be used for? Thanks for anything!
You can create a hybrid webforms - MVC application.
To do this you need to:
copy the MVC configuration from the web.config of a new MVC project to your WebForms application web.config
create the standard MVC 4 folders (at least Views, Controllers)
reference the required assemblies
copy the web.config inside Views from the MVC project to the WebForms project Views folder
change the routing configuration to ignore routes including .aspx/.ascx, so that they are handled by web forms, and not MVC (do this also for .ashx, .asmx, or whatever other web forms based artifacts)
This way you have a single ASP.NET application which supports MVC and WebForms, and use the same authentication, session, and so on.
Then you can make this kind of integrations:
- make pages that are fully MVC or fully webforms. If you're using master pages, you need to create a master page for web forms, and a layout for MVC (this can be very hard or quite easy, depending on its content and design)
- make a webforms page and integrate the MVC pages using AJAX and MVC partial views
Aprt frommy comments, this blog entry will help you a lot: Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications
By the way, this is not theoretical... I have a web application with lots of pages, areas, and views, which uses this technique, and it works flawlessly. I had to redo the design of the master page (layout and CSS) so that both kind of pages look alike. I was lucky enough to have a menu rendered in a webforms placeholder using a SQL XML query and an XSLT, so re-using it in the MVC layout was absolutely easy. You can do something similar to this in your master page and MVC layout (I mean rendering the HTML manually, and using it in both pages, so that it's done only once)
You can take some time to get it to work, but it's worth the effort.

Routing in ASP.NET Web Forms Website

I am trying to implement routing mechanism into my ASP.NET Web Forms - Site. Unfortunately all tutorials on how to do it I can find describe ASP.NET Web Forms - Application scenario, with Global.asax file. I obviously do not have this file. What are my options?
Click the show all files icon on top of Solution Explorer and you should be able to see it.
you should look into the MVC design patten.

ASP.NET :URL masking

I have an ASP.NET web application where i have a page Signup.aspx and a home page.aspx.In my home page i have link to the signup.aspx page.I want to Hide the file extension.aspx from the addressbar when someone clicks on the signup link in home page.I want to show it as http://mysite.com/signup . Is there anyway to do this ? I am using VS 2008
thanks in advance
If you are using ASP.NET 3.5 ASP.NET Routing could be a good choice for you.
MSDN page: msdn.microsoft.com/en-us/library/cc668201.aspx
Using it with ASP.NET MVC at ScottGu blog: weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
Using it with ASP.NET 3.5: www.techbubbles.com/aspnet/aspnet-35-url-routing/
If your website runs under ASP.NET 2.0 Helicon ISAPI Rewrite could be a good choise for you. This is an IIS filter that redirects requests to your pages according to regex-based configuration file. They have a free version for one website.
Have a look at Helicon: www.isapirewrite.com
The simplest way would just be having a folder named "signup" with a default page that redirects to signup.aspx
Another option which does not involve rewriting the URL yourself is using the ASP.NET MVC Framework which will handle that kind of stuff pretty easily.

ASP.Net MVC View within WebForms Application

I am adding functionality to an ASP.Net webforms application and we've decided that new development will be done MVC with a view to move all functionality over eventually.
Obviously, MVC and WebForms play together rather nicely when it comes to accessing an MVC action via a URL. However, I'd like to display the MVC view within an existing tab (telerik) control on a WebForm page. This view will be using js/css file so that will need to be considered also.
Well I'd use jquery/js to load the tab dynamically on page load / select tab. If add a js function to the required handler you can fire an ajaxGet to retrieve the html from your MVC action URL.
If needed I can get some sample code. Are you using jQuery in your ASP.Net app or MSAJAX ??
Cheers
ian

Sending asynchronous request on clicking a sharepoint web part button control

I am new to this whole sharepoint and aspx programming. I have developed a sharepoint web part that has a button control. The onclick event is mapped to a method in my web part code. When I click the button the whole page reloads and the web part is rendered again. Is there a way to prevent this reloading of the page? Is there a way to call the function method in the background? Something similar to AJAX.
Thanks,
Jagannath
You can use Ajax, it just requires some sharepoint configuration. Here are a few posts to get you started:
http://weblogs.asp.net/jan/archive/2007/02/26/using-the-ajax-control-toolkit-in-sharepoint.aspx
http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3
Ajax or SilverLight are your only two options for Async operations without a page refresh.
Once you know the tricks needed to get SharePoint and ASP.NET AJAX to work together it's not that difficult.
Here are the steps required:
Ensure the ASP.NET AJAX Extensions are installed on all the front-end web servers (this is not required if you are using .NET 3.5 as the Extensions are included in the Framework)
Update the Web.config file for the SharePoint Application to support ASP.NET AJAX
Ensure any page that is going to use AJAX has a ScriptManager
Use an UpdatePanel or a client-side service call to get updated data and re-render the Web Part
This blog post has some resources from a talk I did on the subject at TechEd Barcelona 2008. These resources should give you the information you need to get started.
http://msmvps.com/blogs/windsor/archive/2008/11/13/teched-emea-resources-and-demos-integrating-asp-net-ajax-with-sharepoint-2007.aspx

Resources