The following steps will permit you to get GCN 1.1 up and running under ASP.NET 2.0. It is a work in progress and I'll update as I go along - the objective is to get GCN 1.1 running under ASP.NET 2.0, prior to making any modifications so developers can unzip, apply changes, and have it run under ASP.NET 2.0
I am running the GCN under ASP.NET 2.0 using SQL Server 2005
Note: The following assumes that you have Visual Studio 2005 (click here for 180 day trial version) and have converted the project to ASP.NET 2.0.
Jody has provided step by step procedures for the conversion on the following post: http://forums.asp.net/1111663/ShowPost.aspx
AFTER PROJECT CONVERSION
/Communities/Common/Images/HtmlTextBoxUserImages
---------------------------------------------------
Images won't upload in HtmlTextBox editor
---------------------------------------------------
+ Turned on write access to folder 2005-05-13
/Scripts
---------------------------------------------------
When entering Edit Section the default (general) panel disappears
---------------------------------------------------
+ tabstrip.js 2005-05-11
- Modified Line 7 ... Changed (i=2; i <divs.length; i++) to (i=3; i < divs.length; i++)
/App_code/Engine/Framework/BaseClasses
---------------------------------------------------
Only default skin loads without error (can't find fail over files)
---------------------------------------------------
+ SkinnedCommunityControl.cs 2005-05-11
- Modified Line 172 .... Changed exception from FileNotFoundException to catch (HttpException fnfEx)
- Modified Line 244 .... Changed exception from FileNotFoundException to catch (HttpException fnfEx)
/App_code/Engine/Framework/ContentPages/Controls/
+ Web.config
- Modified connection string as applicable
---------------------------------------------------
ButtonType will become ambiguous under ASP.NET 2.0
---------------------------------------------------
+ HtmlTextBox.cs
- Added line 17 ........ using ASPNET.StarterKit.Communities;
- Modified line 1527 ... changed ButtonType.Image to HtmlTextBoxControls.ButtonType.Image
... changed (ButtonType) to (HtmlTextBoxControls.ButtonType)
- Modified line 1532 ... changed ButtonType.Image to HtmlTextBoxControls.ButtonType.Image
- Modified line 1845 ... changed ButtonType.FormButton to HtmlTextBoxControls.ButtonType.FormButton
- Modified line 2704 ... changed ButtonType.FormButton to HtmlTextBoxControls.ButtonType.FormButton
----------------------------------------------------------------------------------
Resource manager will not find HtmlTextBox.resx resource under ASP.NET 2.0
----------------------------------------------------------------------------------
+ HtmlTextBox.resx
- Copy from CSKDotNet\Engine\Framework\ContentPages\Controls to \App_GlobalResources
+ HtmlTextBox.cs
- Added line 1799 ... return Resources.HtmlTextBox.ResourceManager.GetString(key).ToString();
- Remarked out remaining code in GetResourceStringFromResourceManager()
----------------------------------------------------------------------------------
Images not appearing (mapping issue)
----------------------------------------------------------------------------------
SOLUTION #1: Manually applied the Redd's patches (differences between supplied files and GCN 1.1) took about 20 minutes and worked great! The link follows: http://www.reddnet.net/Programming/CSK+Stuff/CSK+Files/CSK+1.0/646.aspx
SOLUTION #2: Apply the following code changes (areas in red are new/modified code):
http://forums.asp.net/1118595/ShowPost.aspx#1118595 explains why the code below fixes the images issue.
Engine/Framework/BaseClasses/
+ CommunitiesModule.cs
public class CommunitiesModule : IHttpModule {
ADD THE FOLLOWING CODE AFTER THE ABOVE STATEMENT:
// WK.2005.11.19 IMAGE HANDLING UPDATE
static public string GetHandledImageName(string tsFileName) {
return tsFileName + ".img.aspx";
}
private void Application_BeginRequest(object source, EventArgs e) {
...
...
// Figure out the page and add to Context
if (requestPath.EndsWith(".aspx")) { <<- Find this line
ADD THE FOLLOWING CODE AFTER THE ABOVE STATEMENT:
// WK.2005.11.19 IMAGE HANDLING UPDATE
// .img.aspx is a programmatically assigned extension that ends
// with .aspx so that IIS will process it. Once here we can
// rewrite the context to the actual image name (strip off the
// .img.aspx) so that the application can process it as normal.
if (requestPath.EndsWith(".img.aspx")) {
Context.RewritePath(requestPath.Replace(".img.aspx",""));
ImageHandler loImage = new ImageHandler();
loImage.ProcessRequest(HttpContext.Current);
}
Engine/Framework/ContentPages/Controls
+ Logo.cs
void RenderLogoImage(HtmlTextWriter writer) {
writer.AddAttribute(HtmlTextWriterAttribute.Href, CommunityGlobals.ResolveBase("default.aspx"));
writer.RenderBeginTag(HtmlTextWriterTag.A);
// WK.2005.11.19 Add CommunitiesModule method reference
//writer.Write(String.Format("<img src=\"{0}\" border=\"0\" />", objSectionInfo.Logo));
writer.Write(String.Format("<img src=\"{0}\" border=\"0\" />", CommunitiesModule.GetHandledImageName(objSectionInfo.Logo)));
writer.RenderEndTag();
}
Engine/Framework/Images/Components
+ ImageUtility.cs
public static string BuildImagePath(int id, string fileName) {
string extension = Path.GetExtension(fileName).ToLower();
//WK.2005.11.19 New image handler support
//return id.ToString() + extension;
return id.ToString() + extension +".img.aspx";
}
public static string BuildFullImagePath(int sectionID, int imageID, string fileName) {
string path = SectionUtility.GetSectionPath(sectionID);
path = path.Remove( path.LastIndexOf("/"), path.Length - path.LastIndexOf( "/" ) );
string extension = Path.GetExtension(fileName).ToLower();
// WK.2005.11.19 New image handler support
//return String.Format("{0}/{1}{2}", path, imageID, extension);
return String.Format("{0}/{1}{2}.img.aspx", path, imageID, extension);
}
Admin/EditSections
+SectionAppearance.ascx.cs
protected void Page_Load(object sender, System.EventArgs e)
...
...
if (Section.Logo != String.Empty)
ImgLogoPreview.ImageUrl = ResolveUrl("~/" + Section.Logo);
else
CHANGE THE ABOVE LINE TO
if (Section.Logo != String.Empty)
ImgLogoPreview.ImageUrl = ResolveUrl("~/" + Section.Logo + ".img.aspx");
else