C4 marches on

Core04i has now gone .net, and suprisingly easy it was too. I spend a long time creating the original version in classic ASP, and about as long again deriving an equivalent PHP version. Both work well but I’ve started a site for the local swimming club (gratis incidently). As this will need quite extensive functionality then the .net route suites well to this purpose. Additionally, I need to get my .net skills up a few gears as the ePortfolio web site is being replaced with a .net version (C#) so I need the necessary skills to develop this alongside my .net expert colleagues.

One aspect of the C4 software that was a problem was being able to allow users to link to pages within their site. This had been done by asking them to enter the page name (listed below their editing box) and use regular expressions to fish these out and replace them with the correct pageid=… for the real hyperlink. However, I successfully hacked the not-too-complex tinyMCE editor code to place a drop-down select box in the appropriate place and use javscript to fill the “insert link” text box. This proved a doddle for ASP and PHP but the .net version (where I had been using FCKeditor.net) proved a nightmare (the javascript was very complex). So, reverting to using the tinyMCE editor (works absolutely fine within an aspx page) there still was the problem of getting the select box loaded (from the SQL Server database). Trying to convert the normally popped up .html file by tinyMCE (changed easily to .php or .asp files with associated scripts) to an aspx web web form wasn’t going to work. How was I going to do it?

You guessed it, AJAX to the rescue! The solution was to pop up the html file as usual but have an onload function call an aspx file using AJAX that returns the appropriate select box html to be inserted onto the page. The only additional work was to strip away all the additional html code that comes with the aspx file call (viewstate stuff etc..) by delimiting the required html to be string lifted by the javascript split() function.

All going well.

Advertisements

About this entry