电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

11.6.1 Wrox United中的配置文件[3]


发布日期:2021/3/31
 

)也需要将代码添加到FanClubaspxvb文件从而btnSaveChanges和btnCancelChanges按钮将具有事件处理程序在每次单击这些按钮时将运行相应的代码右击FanClubaspx并且选择View Code命令然后添加如下突出显示的方法到FanClubaspxvb文件

Partial Class FanClub

Inherits SystemWebUIPage

Private Sub Page_Load(ByVal sender As Object ByVal e As SystemEventArgs) Handles MeLoad

If Not PageIsPostBack Then

DisplayProfileProperties()

End If

End Sub

Sub btnCancelChanges_Click(ByVal sender As Object ByVal e As SystemEventArgs)

DisplayProfileProperties()

End Sub

Sub btnSaveChanges_Click(ByVal sender As Object ByVal e As SystemEventArgs)

ProfileName = CType(FCLoginViewFindControl(txtName) TextBox)Text

ProfileAddress = CType(FCLoginViewFindControl(txtAddress) TextBox)Text

ProfileCity = CType(FCLoginViewFindControl(txtCity) TextBox)Text

ProfileCounty = CType(FCLoginViewFindControl(txtCounty) TextBox)Text

ProfilePostCode = CType(FCLoginViewFindControl(txtPostCode) TextBox)Text

ProfileCountry = CType(FCLoginViewFindControl(txtCountry) TextBox)Text

ProfileMailings = CType(FCLoginViewFindControl(chkMailing) CheckBox)Checked

ProfileEmail = CType(FCLoginViewFindControl(txtEmail) TextBox)Text

ProfileMemberName = CType(FCLoginViewFindControl(txtAlias) TextBox)Text

ProfileTheme = CType(FCLoginViewFindControl(ThemeList) DropDownList)SelectedValue

ServerTransfer(SiteMapCurrentNodeUrl)

End Sub

Sub FCLoginView_ViewChanged(ByVal sender As Object ByVal e As SystemEventArgs)

DisplayProfileProperties()

End Sub

Private Sub DisplayProfileProperties()

Dim NameBox As TextBox = CType(FCLoginViewFindControl(txtName) TextBox)

If Not (NameBox Is Nothing) Then

CType(FCLoginViewFindControl(txtName) TextBox)Text = ProfileName

CType(FCLoginViewFindControl(txtAddress) TextBox)Text = ProfileAddress

CType(FCLoginViewFindControl(txtCity) TextBox)Text = ProfileCity

CType(FCLoginViewFindControl(txtCounty) TextBox)Text = ProfileCounty

CType(FCLoginViewFindControl(txtPostCode) TextBox)Text = ProfilePostCode

CType(FCLoginViewFindControl(txtCountry) TextBox)Text = ProfileCountry

CType(FCLoginViewFindControl(chkMailing) CheckBox)Checked = ProfileMailings

CType(FCLoginViewFindControl(txtEmail) TextBox)Text = ProfileEmail

CType(FCLoginViewFindControl(txtAlias) TextBox)Text = ProfileMemberName

CType(FCLoginViewFindControl(ThemeList) DropDownList)SelectedValue = ProfileTheme

End If

End Sub

End Class

)再次运行站点并且作为Lou登录密码为lou@转到Fan Club的主页您将看到页面底部中的内容

)现在输入一些细节并且单击Save Changes按钮如果注销并且再次登录将看到己经保存该信息

[] [] [] [] [] []

上一篇:鲜花预定系统:登录和退出[2]

下一篇:11.6.1 Wrox United中的配置文件[1]