Nevermind, I got it:
<script runat="server">
// Obtain the gallery folder from query string
string album;
void Page_Load(Object sender, EventArgs e)
{
album = Request.QueryString["album"];
if (album == null || album=="/")
gallery1.FolderPath = "106";
gallery1.FolderPath = "~/DotNetGallery/" + album;
}
</script>