WAP and ASPWebProfileGenerator

I have an exception when I use this code

private WebProfile Profile

{

get { return
new WebProfile(Context.Profile); }

}

protected void CreateUserWizard1_CreatedUser(object sender,
EventArgs e)

{

Profile.Entreprise = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("tbx_Entreprise")).Text;

}

The Context.Profile.IsAnonymous property is true and I have an System.Configuration.Provider.ProviderException

 

public virtual void SetPropertyValue(string propertyName, object propertyValue) {
this._profileBase.SetPropertyValue(propertyName, propertyValue);

How to create an empty profile for tne newly created user?

Thanks

 

 

 

 

 

 

 

Does the following work?

<div dir=ltr align=left>

WebProfile p = new
WebProfile(WebProfile.Create(userName, true));
p.SomeProperty = someValue;

</div>

I just have faced the same problem and use your code

WebProfile p = new WebProfile(WebProfile.Create(userName, true));
p.SomeProperty = someValue;

it just works fine.

thanks a lot.

Leave a Reply