2

次の問題があります。ASP の登録データにカスタム フィールドを追加したいと考えています。私は次の方法でこれを行いました。

 Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As       System.EventArgs) Handles CreateUserWizard1.CreatedUser
    ' create an empty profile
    Dim p As ProfileCommon = ProfileCommon.Create(CreateUserWizard1.UserName, True)



    ' fill profile with values from CreateUserStep
    p.LastName = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtLastName"), TextBox).Text

    p.Name = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtName"), TextBox).Text

    p.BirthDate = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtBirthDate"), TextBox).Text

    p.PostCode = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtPostCode"), TextBox).Text

    p.RegNr = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtRegNr"), TextBox).Text


    MsgBox(p.LastName)
    MsgBox(p.Name)
    MsgBox(p.BirthDate)
    MsgBox(p.PostCode)
    MsgBox(p.RegNr)

    ' save profile
    p.Save()
End Sub

また、web.config ファイルに適切なプロパティを作成しました。メッセージボックスでデータをキャッチすると、正しいデータが表示されます。

しかし、データベース内のテーブルがいっぱいになりません。デフォルトのユーザー名、パスワードなどのみが入力されます。aspnet_profile テーブルに新しいフィールドを作成しました。しかし、何も起こりません。

この問題の理由を知っている人はいますか?プロフィール情報が DB に保存されないのはなぜですか。

前もって感謝します!

敬具

4

0 に答える 0