.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

ProfileParameter or OnSelecting

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net
 

I have a page that is basically an account setup page where users can update their own info.  So when the page loads I want to automatically populate the FormView with their information.  I wasn't able to get the ProfileParameter to work for some reason.  The user is definitely logged in as the page requires them to be to access the page at all.  I have also confirmed that through debug watch function.  Here's the problem I get with that.


<asp:SqlDataSource runat="server" ID="dsOrganization" ConnectionString="<%$ ConnectionStrings:ProBonoPro %>" OnSelecting="dsOrganization_OnSelecting" 
        SelectCommand="select * from pbp_organizations_v where UserId = @UserId">
        <SelectParameters>
            <asp:ProfileParameter Name="UserId" PropertyName="UserId" />
        </SelectParameters>

Also tried using PropertyName="ProviderUserKey" - same result.

This gives me an error "System.Web.HttpException: DataBinding: 'ProfileCommon' does not contain a property with the name 'UserId'."  It dies at the fvOrganization.DataBind() line below.

The other thing I tried was to add the parameter in the OnSelecting event, which gives me the error &


View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend