﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programming By A Tool &#187; UI</title>
	<atom:link href="http://byatool.com/tag/ui/feed/" rel="self" type="application/rss+xml" />
	<link>http://byatool.com</link>
	<description>There are sites that try to contain the sweet.  This is not one of them.</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:01:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ASP.Net MVC: Create a link method&#8230; ie JUST GIVE ME THE STUPID URL</title>
		<link>http://byatool.com/utilities/asp-net-mvc-create-a-link-method-ie-just-give-me-the-stupid-url/</link>
		<comments>http://byatool.com/utilities/asp-net-mvc-create-a-link-method-ie-just-give-me-the-stupid-url/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 20:54:17 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://byatool.com/?p=737</guid>
		<description><![CDATA[One thing that kind of annoys me is the situation where you just want a url, but you don't want one of the prepackaged links using: Html.RouteLink Or Html.ActionLink Mostly because you want to be able to create your own html and you only want the created url. Well turns out there's a method for [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that kind of annoys me is the situation where you just want a url, but you don't want one of the prepackaged links using:</p>
<pre>   Html.RouteLink
Or
   Html.ActionLink</pre>
<p>Mostly because you want to be able to create your own html and you only want the created url. Well turns out there's a method for this: The RouteUrl method on the UrlHelper class. Down side is that it's not static and takes a few lines to use, so not cool UI design side. Well here's a method that uses that method and gives you a method to exact a method of victory. I think that sentence had promise, but fell short of complete failure.</p>
<p>Anyways, here it is... The "Just give me the stupid url" method, CreateUrl for short.</p>
<pre>        public static String CreateUrl
        (
          <span style="color: #008080;">RequestContext</span> context,
          <span style="color: #008080;">RouteCollection</span> routeCollection,
          <span style="color: #008080;">String</span> routeName,
          <span style="color: #008080;">String</span> controller,
          <span style="color: #008080;">String</span> action,
          <span style="color: #008080;">RouteValueDictionary</span> routeValues
        )
        {
            <span style="color: #008000;">//Create the helper
</span>            <span style="color: #008080;">UrlHelper</span> neededHelper = new <span style="color: #008080;">UrlHelper</span>(context, routeCollection);

            <span style="color: #008000;">//get the route to check what it is holding at far
</span>            <span style="color: #008000;">//as defaults go
</span>            <span style="color: #0000ff;">var</span> neededRoute = (<span style="color: #008080;">Route</span>)routeCollection[routeName];

            <span style="color: #008000;">//this might be overkill honestly.  Basically in case the
</span>            <span style="color: #008000;">//Route contains the "controller" key only then add it to the
</span>            <span style="color: #008000;">//values for the route.  Otherwise just ignore.  It's possible
</span>            <span style="color: #008000;">//someone might pass in a controller/action but the route
</span>            <span style="color: #008000;">//doesn't take them. At which point you'll</span>
<span style="color: #008000;">            //be showing the "Aw maaaaan" face.</span>

<span style="color: #0000ff;">            if</span> (!<span style="color: #008080;">String</span>.IsNullOrEmpty(controller) &amp;&amp; neededRoute.Defaults.ContainsKey(<span style="color: #800000;">"controller"</span>))
            {
                routeValues.Add(<span style="color: #800000;">"controller"</span>, controller);
            }

            <span style="color: #0000ff;">if</span> (!<span style="color: #008080;">String</span>.IsNullOrEmpty(action) &amp;&amp; neededRoute.Defaults.ContainsKey(<span style="color: #800000;">"action"</span>))
            {
                routeValues.Add(<span style="color: #800000;">"action"</span>, action);
            }

            <span style="color: #008000;">//And then the call to create the url string.
</span>            <span style="color: #0000ff;">return</span> neededHelper.RouteUrl(routeName, routeValues);
        }</pre>
<p>And in use View side:</p>
<pre>  <span style="color: #0000ff;">&lt;</span><span style="color: #ff0000;">a href=</span><span style="color: #0000ff;">"</span>
  <span style="color: #ff9900;">&lt;</span><span style="color: #ff9900;">%</span>
  CreateUrl
  (
    Html.ViewContext.RequestContext,
    Html.RouteCollection,
    GeneralConstants.RouteDefault,
    <span style="color: #800000;">"SomeController"</span>,
    <span style="color: #800000;">"SomeAction"</span>,
    new <span style="color: #008080;">RouteValueDictionary</span> { { <span style="color: #800000;">"id"</span>, 1 } }
  )
  <span style="color: #ff9900;">%</span><span style="color: #ff9900;">&gt;</span><span style="color: #0000ff;">"</span>
  <span style="color: #0000ff;">&gt;</span>
  Something is linked
  <span style="color: #0000ff;">&lt;/</span><span style="color: #ff0000;">a</span><span style="color: #0000ff;">&gt;</span></pre>
<p>Now mind you I did use a link there so it seems like a silly example. However, you can do many other things now that you just have the url itself.</p>
<div  class="related_post_title">Related Posts</div><ul class="related_post"><li><a href="http://byatool.com/lessons/spark-view-engine-asp-net-mvc-and-you/" title="Spark View Engine, ASP.Net MVC, and You">Spark View Engine, ASP.Net MVC, and You</a></li><li><a href="http://byatool.com/writing/byatool-com-gets-a-shiny-new-tool/" title="ByATool.com gets a shiny new tool!">ByATool.com gets a shiny new tool!</a></li><li><a href="http://byatool.com/lessons/data-annotations-mvc-and-why-you-might-like-them/" title="Data Annotations, MVC, and Why You Might Like Them">Data Annotations, MVC, and Why You Might Like Them</a></li><li><a href="http://byatool.com/pontification/asp-net-mvc-quick-overview-of-controller-structure/" title="ASP.Net MVC:  Quick Overview of Controller Structure">ASP.Net MVC:  Quick Overview of Controller Structure</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://byatool.com/utilities/asp-net-mvc-create-a-link-method-ie-just-give-me-the-stupid-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Spotlight: Iconshock.com</title>
		<link>http://byatool.com/website-spotlight/website-spotlight-iconshockcom/</link>
		<comments>http://byatool.com/website-spotlight/website-spotlight-iconshockcom/#comments</comments>
		<pubDate>Fri, 08 May 2009 20:45:33 +0000</pubDate>
		<dc:creator>Andre</dc:creator>
				<category><![CDATA[Website Spotlight]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Icons]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://byatool.com/?p=641</guid>
		<description><![CDATA[Website: Iconshock ( http://www.iconshock.com/ ) Description: From their website - Iconshock offers the largest icon collection over the internet, with nearly 500,000 unique icons (they don't include sizes or file types in this estimation, only different and unique icons) with the highest quality and most of them including source files to allow you to make [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Website:</strong> Iconshock ( <a href="http://www.iconshock.com/" target="_blank">http://www.iconshock.com/</a> )<br />
<strong>Description:</strong> <em>From their website</em> - Iconshock offers the largest icon collection over the internet, with nearly 500,000 unique icons (they <span style="text-decoration: underline;">don't</span> include sizes or file types in this estimation, only different and unique icons) with the highest quality and most of them including source files to allow you to make your own changes. All those icons are included in about 200 different collections with different design styles to choose from according to your application GUI.</p>
<p><strong>Icons &#038; Logos</strong><br />
Iconshock.com offers great looking icons and logos for reasonable prices.  Both their icons and logos are of very high quality.  Source files are also included so that you can modify them as needed.  Personally, I am a fan of the <a href="http://www.iconshock.com/icon-sets.php?application=super-vista-general-icons&#038;prd=affcomm43923">Super Vista</a> and <a href="http://www.iconshock.com/icon-sets.php?application=lumina-general-icons&#038;prd=affcomm43923" target="_blank">Lumina</a> sets.  Iconshock offers the ability to purchase single sets or create your own bundle of sets to purchase at a reduced price.  You can also subscribe and get all the icons they offer plus any new icons added during your subscription.  The website is quick and easy to navigate.  If you need a custom logo or icons created specifically for you, Iconshock can do that as well.  I have been a web developer for over 10 years, and their <a href="http://www.iconshock.com/icon-design.php" target="_blank">portfolio</a> of custom work is AMAZING!</p>
<p>
<div align="center" style="padding-top: 7px;">
<font color="gray">Example Logo</font><br />
<img src="http://www.iconshock.com/img/product/th_L000021.jpg" alt="Example Logo" style="border: Solid 1px Gray" />
</div>
<p><br/></p>
<p><strong>The Community</strong><br />
What sets Iconshock apart from their competition is a community portal which rewards people for their participation.  Each week, Iconshock allows users to vote on which free set of icons the community receives.  Users can collect free icon sets by swapping with other members.  Free sets can also be unlocked by earning points by simply logging in or posting in their forums.  You can join the community on their website or by searching Twitter for #Iconshock.  Recently, community members were recognized for their participation when they were awarded full icon sets.  You can read more about these awards on the <a href="http://blog.iconshock.com/general/iconshock-awards/" target="_target">Iconshock Blog</a>.</p>
<p>You can browse through some of their icons below:</p>
<div align="center"><!--[if IE]><iframe src="http://www.iconshock.com/Iconshock_widget.php?IS_a=2,1,FFFFFF,019ED3,affcomm43923,3" width="311" height="226" id="Iconshock_widget_IS" frameborder="0" scrolling="no" style></iframe><![endif]--><!--[if !IE]><--><iframe src="http://www.iconshock.com/Iconshock_widget.php?IS_a=2,1,FFFFFF,019ED3,affcomm43923,3" width="311" height="227" id="Iconshock_widget_IS" frameborder="0" scrolling="no" style="background-color:#FFFFFF"></iframe><![endif]--></div>
<div align="center" style="padding-top: 14px;">
<font color="gray">Icon Set Specifics</font>
</div>
<div style="border: Solid 1px Gray; margin-bottom: 10px; padding: 14px;">
<strong>Sizes</strong></p>
<ul>
<li>Normal: 256x256, 128x128, 72x72, 64x64, 48x48, 32x32, 24x24, 16x16 pixels (available in png only)</li>
<li>Hot: 128x128, 48x48, 32x32, 24x24, 16x16 pixels (available in png only)</li>
<li>Disable:128x128, 48x48, 32x32, 24x24, 16x16 pixels (available in png only)</li>
<li>ico:256x256, 128x128, 48x48, 32x32, 24x24, 16x16 pixels</li>
<li>gif :128x128, 48x48, 32x32, 24x24, 16x16 pixels</li>
<li>bmp:128x128, 48x48, 32x32, 24x24, 16x16 pixels</li>
</ul>
<p><strong>Color States</strong></p>
<ul>
<li>Normal: Normal color</li>
<li>Hot: Contrasted Colors, useful in rollovers, active buttons</li>
<li>Disabled: Gray Scale colors, useful in inactive buttons</li>
</ul>
<p><strong>Formats</strong></p>
<ul>
<li>PNG</li>
<li>GIF</li>
<li>ICO</li>
<li>BMP</li>
</ul>
</div>
<div  class="related_post_title">Related Posts</div><ul class="related_post"><li><a href="http://byatool.com/utilities/asp-net-mvc-create-a-link-method-ie-just-give-me-the-stupid-url/" title="ASP.Net MVC: Create a link method&#8230; ie JUST GIVE ME THE STUPID URL">ASP.Net MVC: Create a link method&#8230; ie JUST GIVE ME THE STUPID URL</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://byatool.com/website-spotlight/website-spotlight-iconshockcom/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
