Tag: aspx

ASP.NET/C# image resizer for responsive layouts

I will probably elaborate on this a bit further when I find some more time, but for now, this post is going to be mostly code. What I have here is a relatively simple way to generate images that are resized server-side based on the screen dimensions (note: not window …

Continue reading

Dynamic GridView rows in ASP.NET

Here's a simple proof-of-concept for dynamically adding and removing rows in an ASP.NET GridView control while maintaining the existing data. The ViewState is used to maintain the information between postbacks. The rehydrate_table function takes advantage of this to rebuild the table anew whenever an event takes place.

Default.aspx …

Continue reading

LDAP authentication with C#

LDAP, or Lightweight Directory Access Protocol, is a convenient, central repository for a system's personnel information. LDAP (and other Active Directory services) are widely-used by organizations big and small to consolidate user credentials and identification data. For instance: a reporting services application, a webmail client, and a database administration suite …

Continue reading

Programmatically compile Audiences in SharePoint 2010

According to the documentation for the SharePoint 2010 SDK, you cannot trigger Audience compilation programmatically. Well—that's not true. It isn't documented, but it is possible. The painful thing about it is that you must know the ApplicationId of the UserProfileService application. This is where reflection comes in extremely handy …

Continue reading

Simple file access concurrency in C#

When working without the safety net of a RDBMS in a multi-user environment, file concurrency may become an issue. In a project I've been working on recently, XML files are being used as the custom data store. This is all fine and dandy for now—with a user base of …

Continue reading

Check all CheckBoxes in a GridView using jQuery

If you're working with a GridView control where you've built a CheckBox control into each row of data displayed, odds are, it would be convenient for your users if a "Check/Un-check All" option was available. The following example will show how to do just that; and with only the …

Continue reading

Custom error messages with ValidationSummary in ASP.NET

Sometimes, there are problems encountered in a code-behind file that don't warrant the extra work and mark-up that would otherwise be required to add CustomValidator controls to the page for displaying error messages to the user through your ValidationSummary. Wouldn't it be nice if you could (somewhat) easily take care …

Continue reading

LDAP authentication with VB.NET

LDAP, or Lightweight Directory Access Protocol, is a convenient, central repository for a system's personnel information. LDAP (and other Active Directory services) are widely-used by organizations big and small to consolidate user credentials and identification data. For instance: a reporting services application, a webmail client, and a database administration suite …

Continue reading

Using the ConnectionStrings element in ASP.NET web.config

If you are building a series of web applications that may rely on duplicate data (such as connection strings for pages that query databases), or you want to separate certain constants from your other code, you need a centralized method for storing and referencing that data. In this case, the …

Continue reading