Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




113 posts

Master Geek


Topic # 27693 4-Nov-2008 12:28
Send private message

Hi,

 

I pretty old school when it comes to some elements of webdevelopment.  

At present I have a pretty little css script that lays out my menu and then a big ugly iFrame that contains each specific page.

Obviously this is ugly and needs to change.  What alternatives are there to iFrames.  I've been told off a few times on here for using them and now Im starting to see why.

 

Cheers

 

Hadley


Create new topic


113 posts

Master Geek


  Reply # 175674 4-Nov-2008 12:40
Send private message

should also mention, what I've liked about iFrames is that I can give it a name, and then just tell my links to goto this name frame

I iz your trusted friend
5811 posts

Uber Geek
+1 received by user: 140

Mod Emeritus
Trusted
Lifetime subscriber

  Reply # 175679 4-Nov-2008 12:55
Send private message

you can attempt an AJAX and a DIV with an ID, bolt it with good proper use of CSS and XHTML (for AJAX return data) and feed directly into the DIV with a specific ID and let browser render it on the fly.

Pretty much a concept I have in mind but no example to provide yet.




Internet is my backyard...

 

«Geekzone blog: Tech 'n Chips Takeaway» «Personal blog: And then...»

 

Please read the Geekzone's FUG

 


 
 
 
 


8027 posts

Uber Geek
+1 received by user: 387

Trusted
Subscriber

  Reply # 175697 4-Nov-2008 13:27
Send private message

Yeah basically you'd have your header, menu and footer and some page content.  The page content is changed on click dynamically without refreshing the rest of the page or doing a post and the selected menu item is changed.. thesedays you'd do that with ajax basically javascript doing an xmlhttprequest to call a webservice to get dynamic content or calling a page method in java, asp.net etc.

Sites like Facebook make heavy use of ajax to give a more seemless ui.

You didn't mention if you are using any programming languages or technologies (php, asp etc).  If the hosting you are using supporst such technologies it's time to start learning one imo as they give you a lot or power and flexibility. 

However you can still use javascript to load html into a section of the page without php, asp etc

Here's a overview of how to do simple ajax
https://developer.mozilla.org/En/AJAX/Getting_Started

Here's another getting started type article
http://www.alistapart.com/articles/gettingstartedwithajax

Recently lots of Javascript frameworks have sprung up that simplify the process used in the link above into simpler api like calls.
example:  http://jquery.com/



113 posts

Master Geek


  Reply # 175698 4-Nov-2008 13:33
Send private message

thanks for the responses guys.

 

Im using vb.net and a javascript to control the height of the iFrame (eek)

 

I'd rather use something client side, as you suggested a javascript, as I imagine this would take less time to load each page.

 

I currently have as you said, header, menu, content, footer, it is in the content panel I have my ugly iFrame.  Is it not possible to put something else there that I can interact with like an iFrame?  I suppose that would just be an iFrame by any other name wouldnt it?

 

I hope this all makes sense, the website is www.lens.co.nz if you want to take a look.

 

Cheers

 

Hadley


8027 posts

Uber Geek
+1 received by user: 387

Trusted
Subscriber

  Reply # 175706 4-Nov-2008 13:51
Send private message

Since you are using asp.net I think in your case you would be best using asp.net ajax if you want to continue to DIY without investing a lot of time in truely learning web development..

It's pretty simple to get started with lots of videos and tutorials etc
http://www.asp.net/ajax/

Another option you might consider in your situation is using a free .net cms (Content Management System) package eg:
http://www.umbraco.org/
http://www.kentico.com/free-cms-asp-net.aspx
http://www.axcms.net/en_axcms_home.AxCMS?ActiveID=1848

..then you can spend less time on coding and more on authoring content and design

I iz your trusted friend
5811 posts

Uber Geek
+1 received by user: 140

Mod Emeritus
Trusted
Lifetime subscriber

  Reply # 175753 4-Nov-2008 16:34
Send private message

definitely recommend ASP.NET and Atlas (AJAX component) and do dynamic content insert from XMLHTTPRequest returned data.

Make sure the data return is well XML/XHMTL structure for ease of content population.




Internet is my backyard...

 

«Geekzone blog: Tech 'n Chips Takeaway» «Personal blog: And then...»

 

Please read the Geekzone's FUG

 


Phil Gale
1107 posts

Uber Geek
+1 received by user: 44

Trusted
Red Jungle
Subscriber

  Reply # 176310 6-Nov-2008 15:19
Send private message

pwaddles:

Hi,

 

I pretty old school when it comes to some elements of webdevelopment.  

At present I have a pretty little css script that lays out my menu and then a big ugly iFrame that contains each specific page.

Obviously this is ugly and needs to change.  What alternatives are there to iFrames.  I've been told off a few times on here for using them and now Im starting to see why.

 

Cheers

 

Hadley



I may be missing something here, but whats wrong with just using separate pages? it's by far the simplest approach. Why do you need to have a 'content' pane which your effectively injecting content into all the time rather than just navigating to that page?

Unless done very carefully, using frames/ajax/whatever introduces overheads and alters the usual behaviours of your website that a visitor will be expecting. For example, ever tried bookmarking a specific page on your website?

You don't need to reproduce the menu/header/footer code on every page, if you're using asp.net then just use a MasterPage as a page template, and create a new page (which uses the masterpage) for each section of your website you want to link to.




Red Jungle: we make fantastic software

RSS  Twitter  Facebook  Skype



113 posts

Master Geek


  Reply # 177809 13-Nov-2008 15:44
Send private message

Thanks for the ideas guys, Im giving it a go with a master page as per redjungle.  So far so good.

 

Using the contentplaceholders and all that, which made me think it would be cool to populate the entries in a menu from entries in a database table.  The logic is easy enough, I'm just not sure how to add it to the page in the right place.  I've also looked at placeholders but no luck with them either.  I've tried using 'response.write' but it puts everything at the top of the page.

Cheers

 

Hadley


Phil Gale
1107 posts

Uber Geek
+1 received by user: 44

Trusted
Red Jungle
Subscriber

  Reply # 177812 13-Nov-2008 16:19
Send private message

Hi Hadley,

There's actually an ASP.net menu control which can be databound quite easily. Alternatively if you want to manually build the HTML yourself, you can do things like iterate through your database in the code behind and build up a string of HTML and write it out. Just set the placeholders .Text property to your output string.

I'm not sure what level you're at so let me know if you have specific questions or anythings not terribly clear.




Red Jungle: we make fantastic software

RSS  Twitter  Facebook  Skype



113 posts

Master Geek


  Reply # 178337 17-Nov-2008 11:43
Send private message

Thanks redjungle,  I have the code to spit out my loooooong string with some cool logic behind it.  Only prob was that the placeholders dont have a .text property. Easy workaround though, I just used a label.text property and it worked just how I wanted.

 

Cheers

 


Phil Gale
1107 posts

Uber Geek
+1 received by user: 44

Trusted
Red Jungle
Subscriber

  Reply # 178358 17-Nov-2008 13:35
Send private message

Whoops, yeah sorry my bad.. with the placeholder you append a control rather than set the text property.. so something like:

myPlaceHolder.Controls.Add(New LiteralControl(myHtmlString))

Sounds like you've got it sorted anyway - but just be aware that using a label control will add a little extra markup - a SPAN tag around the label content, wheras a placeholder wouldn't.




Red Jungle: we make fantastic software

RSS  Twitter  Facebook  Skype

62 posts

Master Geek


  Reply # 178361 17-Nov-2008 13:43
Send private message

Another easy way of doing it would be using PHP includes.
Not client side but seamless when using seperate files for pages.

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.