About the author

Name of author Kevin Brammer lives in Houston and spends most of his time painting, designing, and programming ASP.NET/C#.
E-mail me Send mail

Pages

Advertisements

 

PNG Effects

by Admin 6/26/2008 3:42:00 AM

The folks over at www.webdesignerswall.com are having a lot of fun with transparent PNGs to do fun things like create image borders and text effects. I have had a lot of difficulty in the past trying to get PNGs to work in Internet Explorer 6 - but they promote a nifty IE PNG Fix borrowed from twinhelix that seems to get rid of this problem altogether. 

 


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Perfect Pagination Using CSS

by Admin 6/26/2008 2:53:00 AM

Antonio Lupetti has posted a well written tutorial explaining how to style paging controls with CSS to look like Digg, Flickr or clean HTML.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Creating a Photo Gallery with FlickrNet

by Admin 5/31/2008 8:02:00 AM

Updated 9/18/08 

Live Demo

If you have been looking for a way to include your Flickr photos on your website using ASP.NET, then you definitely need to take a look at the FlickerNet API. There are several good examples on the site to help you get started, but I didn't see any that showed how to return photos from a specific set. After a little trial and error I was able to figure out how to accomplish this, and it turns out that it is quite easy.

The first issue I had was due to the fact that I am hosting my site on a managed server with 1and1.com. Turns out you have to declare the proxy directly within the FlickrNet configuration parameter. You also have to make sure that you are using your actual UserID and not your screen name. I learned this the hard way, but I discovered that the easiest way to determine your UserID is to look at the RSS feed links on any of your Flickr pages. One other issue I ran up against involved permission errors for the default cache setting for FlickrNet. I decided that I was not going to need this and simply disabled the cache setting in the web.config. Let's take a look at the necessary web.config settings. You may need to change these depending on your particular needs. Remember that the proxy setting is for sites hosted with 1and1.

Web.config

<configSections>

  <section name="flickrNet" type="FlickrNet.FlickrConfigurationManager,FlickrNet" allowLocation="true" />

</configSections>

<flickrNet apiKey="putyourflickrAPIkeyhere" secret="flickrsharedsecret" cacheDisabled="true" >

  <proxy ipaddress="ntproxy.1and1.com" port="3128" />

</flickrNet>

<appSettings>

  <add key="UserId" value="flickrUserID"/>

</appSettings>

The method that I used to return the photo collection from a particular set in Flickr is pretty straightforward.

Gallery.aspx.cs

using System;

public partial class Gallery : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        PhotoRepeater.DataSource = RecentPhotos();

        PhotoRepeater.DataBind();

    }

    public static FlickrNet.PhotoCollection RecentPhotos()

    {

        FlickrNet.Flickr flickr = new FlickrNet.Flickr();

        FlickrNet.Photoset set = flickr.PhotosetsGetPhotos("72157600111054287");

        return set.PhotoCollection;

    }

}

Now that we have the web.config and the code behind set up and ready to go, it is time to decide how to present the information. The example on the FlickrNet site has a good example of how to use the Repeater control to return thumbnails with links back to the main Flickr page. I wanted to spice things up a bit, so a found a nice Javascript gallery that would work with the repeater control called SmoothGallery.

In order to use SmoothGallery, follow the setup instructions provided on the site. Then set up your repeater control's item template with the basic image information as follows.

Gallery.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Gallery.aspx.cs" Inherits="Gallery" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Sandbox</title>

    <link rel="stylesheet" href="css/jd.gallery.css" type="text/css" media="screen" />

</head>

 

<body>

    <form id="form1" runat="server">

      <div id="body">

            Gallery made possible with <a href="http://www.flickr.com">Flickr</a>, <a href="http://smoothgallery.jondesign.net">SmoothGallery</a> and <a href="http://www.codeplex.com/FlickrNet/">

            FlickrNet</a> API<br /><br />

      <div id="myGallery">

            <asp:Repeater runat="server" ID="PhotoRepeater">

                <ItemTemplate>

                    <div class="imageElement">

                        <h3><%# Eval("Title") %></h3>

                        <p>Copyright 2007 Kevin Brammer</p>

                        <a href="<%# Eval("WebUrl") %>" title="open image" class="open"></a>

                        <img src="<%# Eval("MediumUrl") %>" class="full" />

                        <img src="<%# Eval("SquareThumbnailUrl") %>" class="thumbnail" />

                    </div>

                </ItemTemplate>

            </asp:Repeater>

       </div>

    <script type="text/javascript">

        function startGallery() {

            var myGallery = new gallery($('myGallery'), {

                timed: false

            });

        }

        window.addEvent('domready', startGallery);

    </script>

  </div>

    </form>

</body>

</html>

And that should just about do it. Also, be certain that you don't have any fancy CSS affecting your links, because that might mess with the gallery navigation. Good luck!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Intersting Article on Presenting Information

by Admin 5/15/2008 3:21:00 AM

I came across this pair of good articles articles by Rob Adams on UI design and presenting information to the end user while I was researching Flex development:

Designing for Flex - Designing Content Displays 

Get Your Design Out of My Content

There are a lot of interesting ideas here that Rob put forth here, some adapted from Edward Tufte. The "every pixel on the screen" concept is something I have heard before when talking about traditional graphic design. Obviously, this doesn't mean you end up with a simple page of ASCII!! Rather, I think the idea here is to always push for unity and design that enhances rather than competes with your content. I like to think that ideal technology solutions are ones that always be strive for transparency, removing barriers to content in such a way that interaction with the application or tool in question simply becomes a natural extension of everyday activity.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Favorite FireFox Add-ons for Web Development

by Admin 5/4/2008 6:11:00 AM

Here are a couple of FF Add-ons that I have been finding really useful:

FireFTP - great for using FTP as a tab in your browser window. Saves your connection profiles and makes it easy to do quick updates and previews with web development.

GMarks - If you like using Google Bookmarks instead of a social bookmarking site, this add-on makes it easy to organize your bookmark labels as folders. You'll definitely want to set it up to use the sidebar - this seems to work the best. Once you are up and going and have all of your bookmarks organized, it is simple to drag a link from your address bar directly into the sidebar folder you want it to appear in. Also has a nice search feature. 

 FireBug - Definitely worth a test drive if you still haven't tried this yet. This really eliminates the need for the old 'right-click-view-source-selection' technique in order to troubleshoot layout and CSS issues. Of course, it does a lot more than than, but I use it because it previews the source code and CSS really well.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Powered by BlogEngine.NET 1.3.0.0
Theme by Kevin Brammer