Emil’s Blog

Programming Windows, .Net, EPiServer and whatnot…

[Powered by WordPress.]

September 20, 2007

Databinding with a GridView

by @ 13:01. Filed under .Net programming

Here's how to call a codebehind function for the rows of a GridView. No rocket science, but useful for reference...

ASPX:
<%# GetStatusImage(Container) %>

Code behind:
protected string GetStatusImage(IDataItemContainer row)
{
}

or

ASPX:
<%# GetStatusImage(Container as GridViewRow) %>

Code behind:
protected string GetStatusImage(GridViewRow row{
}

/Emil

Retrieving the username for the current user

by @ 12:26. Filed under .Net programming

This is how to retrieve the username for the currently logged in user:

WindowsIdentity myIdentity = WindowsIdentity.GetCurrent();
string username = myIdentity.Name;

[powered by WordPress.]

jour·nal n. A personal record of occurrences, experiences, and reflections kept on a regular basis; a diary.

Internal links:

Categories:

Search blog:

Archives:

September 2007
M T W T F S S
« Jul   Nov »
 12
3456789
10111213141516
17181920212223
24252627282930


View Emil Åström's profile on LinkedIn

General links:

I read:

Visitors

Recent Comments

Spam caught

Other:

Clicky Web Analytics

36 queries. 1.220 seconds