2pagesCMS version 1 is out!

A CMS in two asp.net pages, in 30 Kb total. Can’t believe! IT’S A MIRACLE!!

Out of joke, I’m experimenting with ultra simple interfaces and this is sorting out a nice project. So simple that you can modify and customize at you wish with no effort.

2pagesCMS is written with VWD2008, Vb.net and Access97. The database has one single table that, I suppose, selfexplains.

In few minutes it should be ported in any language or db of your choice. Let me know. Code exposed here is shared for customization and improvements. If you find it useful, please contribute.

Go to http://paginablu.wordpress.com/2pages-cms/ or to http://www.lr00.net/sitepage/ for more instructions.

Download 2pagesCMS.net version 1

Yeah! Wouldn’t it be fantastic? Give up all that mess of billions lines of code and HAVE JUST TWO PAGES! One page to show and one page to manage. That’all. (and I dont want to say how simple is the database…)

Working with VWD and VB.net, Access db.

Any contribution on theme is more than well accepted. May you clone this idea in other languages or support other dbs? Let’s share links!

Keep in touch!  I’m refining it, just a few bits…

Linking and Embedding

April 2, 2009

I’ve always had a passion for embedding, linking, dxf, insert, reference,include etc. Using HTML the IFRAME tag is a powerful embedder object. It opens a box and visualize inside an url, as a browser-in-the-browser.

Basic html sintax:

<iframe name=”inlineframe” src=”http://sitename.com/sample.html” marginwidth=”5″ marginheight=”5″ frameborder=”0″ height=”480″ scrolling=”auto” width=”640″></iframe>

ASP.net sintax (adding id)

<iframe id=”inlineframe” name=”inlineframe” src=”#” marginwidth=”5″ marginheight=”5″ frameborder=”0″ height=”480″ scrolling=”auto” width=”640″></iframe>

To have an idea see this page of embedded iframed sites

It is a tricky problem. Asp.net 2.0 does not support any way of detecting the screen and /or working window height and width. A brief research on the web has sorted out poor and complex solutions, so I tried out many combinations and this seems to work simply enough, at least with Firefox browser. Worst the scaling with Chrome.

Suppose you want to place an Iframe on your .aspx page and want this iframe to rescale on window resizing by user action.

IFRAME declaration, inside html (in my case it is inside a table <td> tag):

<iframe id=”myIframe” name=”myIframe”
src=”http://your.page.url”
frameborder=”1″
scrolling=”auto”
width=”95%”
height=”350″
marginwidth=”0″
marginheight=”0″ >
</iframe>

inside <head > tag, the main javascript function SizeHF():

<script language=”javascript” type=”text/javascript” >
function SizeHF() {
var height = window.innerHeight;
document.getElementById(“myIframe”).height = height – 40;
var url = document.getElementById(“myIframe”).src;
document.getElementById(“Label1″).Text = url;
}
</script>

the body tag:

<body onresize=”SizeHF()” >

inside <body> tag, after closing </form>:

</form>
<script language=”javascript” type=”text/javascript” >
var height = window.innerHeight;
document.getElementById(“myIframe”).height = height – 40;
</script>
</body>
</html>

Any comment or improvement is welcome.

By the way, this javascript suggests that we can use javascript to set the value of any element in the DOM of the aspx page and then exchange the value with asp.net functions.

Follow

Get every new post delivered to your Inbox.