Friday, May 18, 2012

Thursday, May 17, 2012

Visibility in IE

Visibility in IE - make sure you pass valid values and it works fine
also the difference between visibility and display

For in Labels

For in Labels

IIterable as datasource

since u can use IIterable for datasources here is some neat code to quickly add a select item in a collection:

       IService client = new service();
              var things = client.Getthings();
              things.Insert(0, new thinge{ text = "--Select--",  desc  = "" });
              cmbthings.DataSource = modules;
              cmbthings.DataTextField = "text";
              cmbthings.DataValueField = "desc";
              cmbthings.DataBind();

bug in EF?

with what appears to be a bug - updating complex objects in the model viewer does not update the "create" factory methods in the designer.cs, only the properties get updated

Friday, May 11, 2012

mac issues

I uploaded a page which makes a iframe visible/invisible and sets text to a div. Got the dreaded MAC error (only on balance loaded environment). disabling view state did not help so I brought in the nuclear option


EnableViewStateMac="false"

Wednesday, May 9, 2012

Set Querystring in VS


Publishing

Its prudent to publish locally to a folder and then copying what you need over as opposed to publishing to a working (even development) environment because the chances of you overwriting config files and perhaps references in the bin are great

Friday, May 4, 2012

Nice use of extensions


    public static class StringExtensions
    {
        public static string FormatWith(this string source, params object[] parameters)
        {
            return string.Format(source, parameters);
        }
    }

then you can "{0}{1}".FormatWith(a,b)

Thursday, May 3, 2012

Add NTFS rights to app pool


C:\>ICACLS E:\blah\blah    /grant "IIS APPPOOL\blahapp":(OI)(CI)(RX)