Where is that ActionLink!?!

by OfirYaron 2/25/2009 3:51:00 AM

I've been wrestling with MVC today.

I recently installed the RC after working with preview version for a while for some reason lots of my most favorite extended methods were gone after this installation.

So far I've tried re-installing the MVC RC package, overriding the dll manually, removing all the other assemblies from the web.config - leaving system.web.mvc the only one and nothing helped.

Oddly enough the object explorer show the ActionLink method on system.web.mvc.dll (namespace: system.web.mvc.html class:LinkExtensions) But all the insallisence give is a a short list that that seem to come from HtmlHelper but not those I need:

After playing with it a little - trying different assemblies I've found that the Extensions were moved to 'system.web.mvc.html', and the reason it didn't work was becouse the GAC was still holding an old version of that assembly (Preview 5)

Currently rated 4.3 by 3 people

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

Tags: ,

MVC

Round Corner generator

by OfirYaron 2/14/2009 2:46:00 AM
This is a little function I've built that return an image of a round corner - by selecting the border color and the fill color, the nice thing is you can use it to generate a rounded corner on the fly in your web site, it's pretty fast!

public static Bitmap RoundedCorner(ContentAlignment position ,int height, int width, Color border, Color fill)
{
    Bitmap myBmpImage = new Bitmap(1, 1);

    // Create the graphics object
    Graphics myGraphics = Graphics.FromImage(myBmpImage);
    myBmpImage = new Bitmap(myBmpImage, new Size(width, height));
    myGraphics = Graphics.FromImage(myBmpImage);

    float pX = 0;
    float pY = 0;

    if ((position == ContentAlignment.BottomLeft) || (position == ContentAlignment.BottomRight)) pY -= height;
    if ((position == ContentAlignment.BottomRight) || (position == ContentAlignment.TopRight)) pX -= width;

    // Set Background color
    myGraphics.Clear(Color.Transparent);
    myGraphics.SmoothingMode = SmoothingMode.HighQuality;
    myGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;

     if (fill != null)     
        myGraphics.FillEllipse(new SolidBrush(fill), pX, pY, width * 2, height * 2);

    if (border != null)
        myGraphics.DrawEllipse(new Pen(border), pX, pY, width * 2, height * 2);

    myGraphics.Flush();
    return (myBmpImage);
}
 

Ill upload test project later on to show how it works - right now you can pretty much copy-paste it.

Cheers,

Ofir 

 

Currently rated 4.7 by 7 people

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

Tags: , ,

It's about time

by OfirYaron 2/12/2009 5:53:00 AM

Hi,

My name is Ofir Yaron and I'm a Brewer/.Net Developer

I'm .Net Developer for nine years now (C#) and worked before, for about five years with C++/VB/Delphi and many more icky languages :)

I recently started working with MVC and Linq after working with Monorail and ActiveRecords for a while, I still haven't decided which I hate more.

I've worked with web form before that – but I'm really trying to repress that period.

I opened up this blog to share programming issues that I deal with and think that they might interest someone else beside my-self and share my on growing knowledge and passion on Beer making.

You can email me to blog@ofiryaron.com for any interesting issue or problem you are facing, I'll be happy to dive in and try to help, and you are more than welcome to send me beer recopies, especially the Guinness recipe :)

 

Cheers

Ofir Yaron

Currently rated 4.7 by 7 people

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

Tags: , , , , ,

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in