вівторок, 19 квітня 2011 р.

CSS opacity

/* This works in IE */
filter: alpha(opacity=50);

/* Older than Firefox 0.9 */
-moz-opacity:0.5;

/* Safari 1.x (pre WebKit!) */
-khtml-opacity: 0.5;

/* Modern!
/* Firefox 0.9+, Safari 2?, Chrome any?
/* Opera 9+, IE 9+ */
opacity: 0.5;

Copy:

filter: alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;

понеділок, 18 квітня 2011 р.

How to set Visual Studio default "company name"?

Set value in RegisteredOrganization under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

вівторок, 5 квітня 2011 р.

View LINQ Generated SQL

Write class:

public class LinqDebugger : System.IO.TextWriter
{
static readonly LinqDebugger _instance = new LinqDebugger();
static readonly string _separator = new String('_', 150);

public static LinqDebugger Instance { get { return _instance; } }

private LinqDebugger()
{
}

public override void WriteLine(string value)
{
System.Diagnostics.Debug.WriteLine(value);
if (!string.IsNullOrEmpty(value) && value.StartsWith("-- Context:"))
System.Diagnostics.Debug.WriteLine(_separator);
}

public override System.Text.Encoding Encoding
{
get { throw new NotImplementedException(); }
}
}

Use:

var db = new DBDataContext();
db.Log = LinqDebugger.Instance;

VS output:

понеділок, 4 квітня 2011 р.

ListView + DataPager + QueryStringField


protected void Page_Load(object sender, EventArgs e)
{
//page EnableViewState="true"
if(!IsPostBack) BindData();

//page EnableViewState="false"
//BindData();
}

private void BindData()
{
int page;
if(!int.TryParse(Request.QueryString[pager.QueryStringField], out page)) page = 1;

pager.SetPageProperties((page - 1) * pager.PageSize, pager.PageSize, false);

items.DataSource = _items;
items.DataBind();
}