BlogEngine.net Extension for Embedding JotForms form

by Sameera 28. July 2010 14:47

JotForm is one the best online Form Builders out there. It offers more enticing features on its free edition than any of its rivals.

But, why would a developer need an online Form Builder? If you are building a site from scratch or if you are using a powerful CMS such as DNN, you'd probably build the form yourself or use a form builder module. But, increasingly more people are deploying BlogEngine.net as a CMS as it's much more simpler to theme, customize, deploy, train and maintain. And BE.NET, meant to be a blog engine doesn't (yet!) have the cabailities to build forms on the fly: Nor there are any modules (yet!) to do the same. So, the likes of JotForm becomes a really good option. [More]

The problem? Well, there's no easy way to embed a JotForm on a BE page or a post. That's why I went ahead and built this simple extension.

How do I use it?

You just drop the JotFormEmbed.cs in to the App_Code/Extensions folder of your BE.NET installation. Then inside a Page or a Post, type [jotform:formid,width,height] where formid is the unique ID for your JotForm form. The width and height parameters define the size of your form area.  You can find out the form ID by looking at the URL JotForm genreates for you.

e.g. http://www.jotform.com/jsform/111111111 where 111111111 is the form ID.

e.g.

[jotform:111111111,100%,250px]

And, that’s it!

NOTE: I couldn’t get the JotForm script tag to work because it seemed to mess up the rest of the BE.NET template. I left the code to insert the script tag in tact. But, I doubt I’d get back to fixing it as the IFrame works fine enough for me.

The C# Source

JotFormEmbed.cs (3.15 kb)

Getting ASP.NET Development Server (WebDev.WebServer.exe) on Vista

by Sameera 4. April 2009 12:51

I came across a weird issue today with my ASP.NET Dev Server. I’m running Vista Home Premium with Firefox set as the default browser. I was consistently getting a “Failed to Connect: Firefox can't establish a connection to the server at localhost:<port>.” error. Little bit of Goolge pointed me to several posts suggesting that I turn off IPV6 on my network adapter. Hmmm… Nope! Idea! I know a better way to fix this (fingers crossed). More...

Codoxide Library | Updates and New Home

by Sameera 15. November 2008 21:08

I have made several updates to the Codoxide.Common Library and moved the project over to SourceForge.net.

The project's new home is codoxidelib.sourceforge.net and the new SVN repository is https://codoxidelib.svn.sourceforge.net/svnroot/codoxidelib/trunk

Codoxide.Common Library Version 0.0.1 (Concept Phase): Database Wrapper, Basic Design Patterns, Configuration Handlers

by Sameera 20. October 2008 11:18

Today I'm so excited to announce the first release of the Codoxide.Common Library. High Five! I haven't been over ambitious about the version numbering as I want you to treat this library to still be in concept stage.   Codoxide.Common Library Released

Unfortunately, this release had taken longer than expected cos of my newly cramped up schedule. Worst part of that is I'm posting this code without proper documentation (yep, excuses!). Nevertheless, there's plenty of code in here to prove useful to many. So here goes!

Features/Components

Patterns

  • SharedInstance<T>
  • Singleton<T>
  • Factory e.g. Factory.Build<T>()

Configuration

  • ConfigurationManager<T>
  • ConfigurationSectionBase

Data

  • Database<CONNECTION_TYPE, COMMAND_TYPE, ADAPTER_TYPE>
  • Map<T>

 

SharedInstance<T>

SharedInstance is actually the most basic type of generic Singleton implementation that's been around in the C# community. This implementation was both simple and efficient. But, it violated the definition of a Singleton by depending on the presence of a public constructor and thereby allowing additional instances to be created. Therefore, I have refrained from calling this a Singleton resorted to the term SharedInstance.

E.g:


SharedInstance<User>.Instance.Login("admin", "password");

User employee1 = new User();
employee1.Username = "emp001";
employee1.Password = "pass001";
employee1.Save();

Singleton<T>

More advanced implementation of the generic Singleton implementation. Uses reflection, custom attributes and "lazy initialization" to provide a powerful way to create and initialize your singletons.

E.g:


public class UserPreferences : IXmlSerializable, ISupportLazyInitialization
{
    ..

    public virtual void Initialize()
    {
        try
        {
            string location = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Codoxide\\preference.xml";
            if (File.Exists(location))
                using (XmlReader reader = XmlReader.Create(location))
                {
                    reader.ReadToFollowing("Preferences");
                    this.ReadXml(reader);
                    reader.ReadEndElement();
                }
        }
        catch (Exception ex)
        {
            throw new InvalidConfigurationException("Exception occurred while loading the preferences from disk", ex);
        }
    }
    ..
}

...

Console.WriteLine(Singleton<UserPreferences>.Instance.BackgroundColor);

Factory.Build<T>

This one's another powerful and unique implementation. Coolest feature of this class is that you can do something like the following:


using (IDatabase db = Factory.Build<IDatabase>())
{
    ..
}

This allows developers of class libraries to write their code using interfaces or abstract classes, leaving the library users to specify the concrete classes via configuration files.

Grab the Code

There's of course, plenty more to be documented regarding the library. And you can expect the project space to be updated in coming (err..) weeks Wink.

Until then, you can:

Check out the code (using SVN): https://codoxidelib.svn.sourceforge.net/svnroot/codoxidelib/trunk

Browse the project space: http://codoxidelib.sourceforge.net/

Updating the Database Wrapper for C#

by Sameera 19. June 2008 04:52

I have made a few updates for my Generic Database Wrapper class. The update contains a bug fix along with several additional methods for supporting DbParameters.

The new source file can be downloaded here. I have also updated the file linked to the original post.

About Me

Sameera Perera

Sameera Perera

  • Solutions Architect
  • View Sameera Perera's profile on LinkedIn

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Disclaimer

This is a personal blog. The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

All forms of source code published on Codoxide.com are distributed under the Apache License, Version 2.0 unless otherwise stated.
The rest of the content are published under a Creative Commons Attribution 3.0 License.
Creative Commons License