blog .RO

How to add a script widget to BlogEngine.NET

A while ago I have created this widget for my own needs. Since the number of BlogEngine users is growing I have decided to make it public in order to make it available to anyone that needs it.

What is it ?

It's a widget like all other widgets that allows blog administrators to add HTML code into it.

How to implement ?

To add this widge to your blog use the following steps:

  • In the 'widgets' directory create a new folder. Name this folder whatever you like. This will be the name of the widget.
  • In the folder you have just created add two user controls (.ascx).The names of the controls are predefined so you can NOT name them whatever you want. The names are: "edit.ascx" and "widget.ascx". To add an User Control: right-click the folder, choose "Add new Item...", and from the list select "Web User Control". 
  • HERE is the code for the "edit.ascx" file and HERE is the code for the "edit.ascx.cs" file.
  • HERE is the code for the "widget.ascx" file and HERE is the code for the "widget.ascx.cs" file.
  • After you have added these 2 files rebuid the website and run it. When you log into the admin section of your blog you should be able to see/select this widget from the widgets dropdown.

HERE is my original widget. If you don't want to bother creating your own you can use mine. Simply insert the folder in the "widgets" directory. The widget is called "Javascript". This is the uncompiled version of the widget

Enjoy !

Tags: , , , ,

BlogEngine.NET | Web

Comments

Logo Designs United States, on 11/11/2011 9:29:56 PM Said:

Logo Designs

Good article.Congratulations to you. I put it in my bookmarks

Barry Herne , on 2/29/2012 6:46:59 PM Said:

Barry Herne

I like your widget, but if I  use it, will this be the plagiarism?

Adaugati comentariu


(Will show your Gravatar icon)

  Country flag


  • Comment
  • Preview
Loading



    toateBlogurile.ro