|
| ProfileCommon namespace error after converting a Web Site to a Web App |
 |
Thu, 7 Feb 2008 15:18:50 +0000 |
Hi all,
I converted my Web Site to Web App (on VS2005 SP1) and made all changes that I
saw in web tutorials...
After getting problems with 'Profile' namespace, I solved it by installing ASP
NET WebProfile Generator.
What should I do after creating a class 'WebProfile.cs' based on my web.config
?
The problems with de 'Profile' class gone, but in some places I use the
ProfileCommon to create profiles and set his properties for new registered
users.
When I build the solution, VS2005 don't recognize ProfileCommon as a namespace..
that show me a error in reference/assembly.
What should I use intead of ProfileCommon, or what sould I do here?
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
TextBox txtUserId =
(TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(&
quot;UserName");
TextBox txtSenha =
(TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(&
quot;Password");
TextBox txtNome =
(TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(&
quot;txtNome");
TextBox txtCidade =
(TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(&
quot;txtCidade");
DropDownList ddlUF =
(DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindCont
rol("ddlUF");
ProfileCommon prof =
(ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);
prof.Nome = txtNome.Text;
prof.Cidade = txtCidade.Text;
prof.UF = ddlUF.SelectedValue;
prof.Creditos = 0;
prof.Save();
Roles.AddUserToRole(txtUserId.Text, "Usuario");
GameUserBll.Adiciona(txtUserId.Text, txtSenha.Text);
}
Here is the profile section of my web.config:
<profile defaultProvider="CustomProfileProvider">
<providers>
<add name="CustomProfileProvider"
connectionStringName="LocalSqlServer"
applicationName="/PTMacWebApp"
type="System.Web.Profile.SqlProfileProvider"
/>
</providers>
<properties>
<add name="Nome" type="System.string" />
<add name="Cidade" type="System.string" />
<add name="UF" type="System.string" />
<add name="Creditos" type="System.double" />
</properties>
</profile>
Thanks, and sorry about my bad english (I'm brazilian).
See ya.
|
| Post Reply
|
| Re: ProfileCommon namespace error after converting a Web Site to a Web App |
 |
Thu, 7 Feb 2008 23:53:25 +0000 |
Ok..
After a lot of search, I solved my own problem looking here:
http://www.eggheadcafe.com/tutorials/aspnet/48857836-0c72-4efb-9d29-fbcb8e17ef3
a/integrate-windows-live-id.aspx
protected void btnRegister_Click(object sender, EventArgs e)
{
MembershipUser user= Membership.CreateUser(UserId, UserId,
txtEmail.Text);
if(user!=null)
{
//don't really need next line, just habit...
FormsAuthentication.Authenticate(UserId, UserId);
WebProfile Profile = new WebProfile();
Profile.Initialize(UserId,true);
Profile.FirstName = this.txtFirstName.Text;
Profile.LastName = this.txtLastName.Text;
Profile.Newsletter = this.chkNewsLetter.Checked;
Profile.Email = this.txtEmail.Text;
Profile.Save();
Well.... that code is what I looking for.
"Thanks for help".
|
| Post Reply
|
| Re: ProfileCommon namespace error after converting a Web Site to a Web App |
 |
Sat, 9 Feb 2008 13:08:03 +0000 |
do not have my devenv at hand, can I assume the WebProfile is a standard class
in the .NET 2.0+ framework? in which namespace?
|
| Post Reply
|
| Re: ProfileCommon namespace error after converting a Web Site to a Web App |
 |
Mon, 11 Feb 2008 14:58:35 +000 |
degt:
do not have my devenv at hand, can I assume the WebProfile is a standard class
in the .NET 2.0+ framework? in which namespace?
Hi degt,
I added it manually by installing the following plugin:
http://www.codeplex.com/WebProfile
You will find instructions inside the downloaded package. If you have
problems, ask me here.
See ya!
|
| Post Reply
|
| Re: ProfileCommon namespace error after converting a Web Site to a Web App |
 |
Tue, 12 Feb 2008 11:53:57 +000 |
We have migrated to VS.2008 and the pluggin is not compatible (does not work)
with Visual Studio 2008. Apparently there are no plans to make such a plugin
either because the project site seems to indicate no further updates are being
done.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|