Here how you add control to the theme (I used SidePanel.ascx but you can add it anywhere, doesn’t matter). First, register control:
<%@ Register src="~/User Controls/SBPanel/SideBarPanel.ascx" TagName="SBPanel" TagPrefix="uc2" %>
Then, add it to the theme:
<h1>Ajax callback example</h1>
txt = $("txtSBPanel").value;
file = "/BlogEngine.NET/User controls/SBPanel/SideBarPanel.aspx";
CreateCallback(file + "?txt=" + txt, SBPanelCallback);
In our call back, we take parsed and formatted by server data and update region of the page to display it, but it is up to you what to do in the call back function, you can do nothing if it make sense:
panel = $("SBPanelShowAreaText");
panel.innerHTML = s;
User control discussed in this post you can download using link below. Let me tell you up front: it is NOT a production quality code; it is only proof of concept. I will turn it into gadget later on and make it available for download, but you can easily use it as is right now if you see a fit.
To get it working:
1. Unzip folder that contains control files and change call to the .aspx page in the SideBarPanel.ascx to reflect path to your server (for example, in my case it would be http://rtur.net/blog/User controls/SBPanel/SideBarPanel.aspx).
2. Upload folder and files to the host server. You should have directory structure as shown in the picture on the right.
3. Register control in the ~/themes/standard/SidePanel.ascx the way described above (I only tested it with standard theme).
4. Add control to HTML markup, again as was described in the text above (I appended it to the end of SidePanel.ascx).
Go to your website, click in the panel and type in some text. Click “Done” and you should see changes in you blog’s side bar.
Don’t get too creative with HTML you type in: the code uses “poor men’s” URL encoding, simply replacing angle brackets with square ones in the background.
SBPanel.zip (2.01 kb)