Referencing controls in a subform, for example, in query criteria is not very intuitive. Here is a great concise article that explains how to do it:

http://blogs.techrepublic.com.com/msoffice/?p=188

Posted by gcastner | with no comments

Recently I wanted to give someone access to one of my teaching web sites. They were not a student or faculty member so they didn't have an account in our active directory. I am not a system administrator so I wasn't able to add them to the active directory either. The solution was to add a second membership provider to my ASP.NET site. The first membership provider is based on active directory. The new, 2nd provider is a SQL provider. I found a great blog post that had the relevant code for checking the username and password against the second provider: http://www.stevideter.com/2008/03/20/using-two-membership-providers-for-aspnet-logins/.

The code behind for the login page was in C# so I thought I would provide the bare bones Visual Basic equivalent:

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate

Dim foundUser As Boolean = False

'this will call the default MembershipProvider
If (Membership.Provider.ValidateUser(Login1.UserName, Login1.Password)) Then
foundUser = True
' otherwise, explicitly call secondary provider
ElseIf Membership.Providers("AspNetSqlMembershipProvider").ValidateUser(Login1.UserName, Login1.Password) Then
foundUser = True
End If

If (foundUser) Then
e.Authenticated = foundUser
End If

End Sub

The membership section of web.config looks like this:
<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
<providers>
<add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString" attributeMapUsername="sAMAccountName" enableSearchMethods="true"/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" />
</providers>
</membership>

Posted by gcastner | with no comments

These tools can help you analyze your pages and optimize them for improved search engine rankings.

1. Yahoo Site Explorer: Allows you to see which pages are linking to your site. For example, link:isom.uoregon.edu will show you all pages that link to isom.uoregon.edu

2. Google Webmaster tools: Tools that ensure Google is indexing your site correctly.

More tools coming soon.

Some of the information in this post is from a presentation given by Andrea Loreto of SEO Architect

Posted by gcastner | with no comments

To avoid displaying the complicated error messages displayed by the .NET framework, you can direct users to a more user-friendly page by inserting the following tags into your web.config file:

<customErrors mode="RemoteOnly" defaultRedirect="errors/error.aspx">
     <error statusCode="404" redirect="errors/error404.aspx"/>
</customErrors>

Using this method of error handling also has the added benefit of not displaying sensitive server information to the user (or potential hacker). "RemoteOnly" means that the error messages are still displayed in their normal format if viewing the pages on the web server itself. You can also view the error messages in the server's event viewer or e-mail the errors to a system administrator by inserting the following code (or similar) into your global.asax file:

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        Dim varCurrentException As Exception
        varCurrentException = Server.GetLastError.InnerException()
    
        'E-mail to system administrator
        Dim client As New SmtpClient
        Dim message As New MailMessage
        message.Body = "Error: " & varCurrentException.ToString & "<br/><br/>Source: " & Request.Url.ToString
        message.Subject = "DSC488588 Web Site Error"
        message.From = New MailAddress("name@domain.com", "System Adminstrator")
        message.IsBodyHtml = True 'Assume HTML format for website owner

        message.To.Add("name@domain.com")
        client.Send(message)
    End Sub

Remember that it is better to explicitly handle individual errors (for example, using Try, Catch) rather than relying on this catch-all method for handling all errors. Use this method for detecting any remaining errors but consider handling them individually if they reoccur.

Posted by gcastner | with no comments
Filed under: ,

1. uoregon email

The UO IT department has a great page with instructions for viewing your uoregon e-mail through Outlook and other e-mail programs:

http://it.uoregon.edu/help/email/setup.shtml

If you do use Outlook, my suggestion is that you use POP (the server is pop.uoregon.edu) rather than IMAP so that all your e-mail (if you have multiple e-mail accounts in Outlook) all goes into the one Inbox.

2. Hotmail

Use the Microsoft Outlook connector available at http://www.microsoft.com/downloads/details.aspx?FamilyID=7aad7e6a-931e-438a-950c-5e9ea66322d4&displaylang=en

3. Gmail

Follow the instructions at http://mail.google.com/support/bin/answer.py?answer=86374

More Posts Next page »