Webpart for cross browser

After few try, I could come up with the solution of using webpart in asp.net.

For me, with the fresh installation of VS 2010 and SQL 2008 R2, webpart did not work. Following the steps, I solved it:

1. Database:

Webpart use default aspnetdb database. So without configuring database, it was giving me pain. And almost all web help & tutorial did not clear about that.
1.1 Search for aspnet_regsql.exe in your computer. Make sure double click the one which is in .net 4 directory and not in the .net 2 directory
1.2 Select server name. But DO NOT select any database. Leave it to

1.3 By default, it should provide the database name aspnetdb

1.4 Next—next–finish

2. Design

2.1 Adding the Web Part Components
:

Download ajax control toolkit 4.0
http://ajaxcontroltoolkit.codeplex.com/releases/view/43475#DownloadId=116534

unzip all

put only these 2 files in project bin folder:
AjaxControlToolkit.dll
AjaxControlToolkit.pdb

Left toolbox of VS 2010, add tab–> chose item — > choose ajax AjaxControlToolkit.dll

2.2 Add ToolkitScriptManager from ajax 4 control toolkits

2.3 Download: Microsoft ASP.NET Futures (July 2007) from:
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=A5189BCB-EF81-4C12-9733-E294D13A58E6&displaylang=en

Install it. Default location should be: C:\Program Files\Microsoft ASP.NET\ASP.NET Futures July 2007\

Copy Microsoft.Web.Preview.dll from C:\Program Files\Microsoft ASP.NET\ASP.NET Futures July 2007\v1.3.61025\3.5 location and paste it into bin folder of project.

2.4 Add tab –> choose item –> browse –> Microsoft.Web.Preview.dll

2.5 Add the following component to your webpage from the asp.net 4 features

  • 1 x Web Part Manager
  • 2 x Web Part Zones



2.6 Final code should be like this: code

2.7 Display Modes and Personalization

http://waitink.blogspot.com/2008/06/ajax-web-parts-part-1-drag-and-drop.html

If you see error for the code line: WebPartDisplayMode please add the folowing line in top section of the cs file:

using System.Web.UI.WebControls.WebParts;

2.8 Configure web.config: source

Reference:
1. http://waitink.blogspot.com/2008/06/ajax-web-parts-part-1-drag-and-drop.html
2. http://www.microsoft.com/downloads/en/details.aspx?FamilyId=A5189BCB-EF81-4C12-9733-E294D13A58E6&displaylang=en
3. http://ajaxcontroltoolkit.codeplex.com/releases/view/43475

Advertisements
By simplemsexchange Posted in ASP.NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s