c# - Can't access custom profile properties from web.config? -


I have the system in my web.config file. The following two profile properties are between web tags:

  & lt; Anonymous identification enabled = "correct" /> & Lt; Profile & gt; & Lt; Properties & gt; & Lt; Add name = "customer name" permissionNanam = "true" /> & Lt; Add name = "CustomerID" permissionNanam = "true" /> & Lt; / Properties & gt; & Lt; / Profile & gt;  

When I try to access Profile.CustomerName or Profile.CustomerID from the aspx.cs file, it is not visible. I thought that when you make a custom profile property, it automatically updates aspnetdb with new properties. The profile does not even show in intellisense.

This problem occurs if you are creating web applications. Web apps, unlike websites, do not generate profile common class. You can either follow this method: (Appendix 2)

I have not used the above assembly individually, so anyone can give some advice on this. However, you can also try:

  Item Customer Name = HttpContext.Current.Profile.GetPropertyValue ("Customer Name")  

with you This method will not get intellisense, but as long as you know the name of the property, it can be reached this way.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -