Here's a stand alone page that exhibits my problem....

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
        SqlDataSource1.SelectParameters.Add("UserName",
System.Web.HttpContext.Current.User.Identity.Name.ToString)
    End Sub

    Protected Sub SqlDataSource1_Selecting(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
        Username.Text = e.Command.Parameters("@UserName").Value _
                & "'s Profile"
    End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml";>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Username" runat="server" Text="Label"></
asp:Label>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$
ConnectionStrings:UserInfoConnectionString %>"
        onselecting="SqlDataSource1_Selecting"
        SelectCommand="SELECT * FROM [UserInfo] WHERE ([UserName] =
@UserName)">
        <SelectParameters>
            <asp:Parameter Name="UserName" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>

Reply via email to