spring中的配置文件 11.6.1 Wrox United中的配置文件[4]
11.6.1 Wrox United中的配置文件[4]
操作回顾
![spring中的配置文件 11.6.1 Wrox United中的配置文件[4]](http://img.zhputi.com/uploads/ab48/ab48a52a6afd836591a001f5d36694be8810.jpg)
Web config文件包含在Wrox United应用程序中使用的每个配置文件属性的定义 这些包括用户的姓名 地址和电子邮件地址 通过FanClub aspx页面中的代码控制在配置文件中存储每个用户的数据的功能
当用户通过单击Save Change按钮更新他们的配置文件时 运行下面的代码
Sub btnSaveChanges_Click(ByVal sender As Object ByVal e As System EventArgs)
Profile Name = CType(FCLoginView FindControl( txtName ) TextBox) Text
Profile Address = CType(FCLoginView FindControl( txtAddress ) TextBox) Text
Profile City = CType(FCLoginView FindControl( txtCity ) TextBox) Text
Profile County = CType(FCLoginView FindControl( txtCounty ) TextBox) Text
Profile PostCode = CType(FCLoginView FindControl( txtPostCode ) TextBox) Text
Profile Country = CType(FCLoginView FindControl( txtCountry ) TextBox) Text
Profile Mailings = CType(FCLoginView FindControl( cMailing ) CheckBox) Checked
Profile Email = CType(FCLoginView FindControl( txtEmail ) TextBox) Text
Profile MemberName = CType(FCLoginView FindControl( txtAlias ) TextBox) Text
Profile Theme = CType(FCLoginView FindControl( ThemeList ) DropDownList) SelectedValue
Server Transfer(SiteMap CurrentNode Url)
End Sub
这段代码看起来非常杂乱 而这是因为一个非常合理的原因 己经选择使用LoginView控件 只在页面的一个视图上显示这些控件 下面是只存储姓名的语法
Profile Name = CType(FCLoginView FindControl( txtName ) TextBox) Text
用于从本质上表示TextBox Text的语法意味着 查找称为tastName的控件 当找到它时 将其视为TextBox控件 然后获取存储在它的Text属性中的数据 并且将该值存储在配置文件中 根据Mailings配置文件属性的类似语法显示了这种细微的区别
Profile Mailings = CType(FCLoginView FindControl( cMailing ) CheckBox) Checked
这一次中 情况是找到称为cMailing的控件 将其视为CheckBox控件 并且设置配置文件的Mailings属性为CheckBox的Checked属性的值
在已经使用数据填充配置文件后 代码将调用Server Transfer方法 该方法将在请求指定的页面时运行代码
Server Transfer(SiteMap CurrentNode Url)
Server Transfer()方法停止当前页面的执行 并且在指定的页面上运行内容 在这种情况下 希望再次重新加载当前页面 从而刷新页面的当前视图
lishixinzhi/Article/program/net/201311/15698相关文章
- Spring 源码(八)循环依赖
- Spring 源码(九)@Autowired注解实现原理(Spring Bean的自动装配)
- Spring Boot 2.X(十五):集成 Swagger2 开发 API 文档(在线+离线)
- 七言春联大全带横批图 《春》对联 关于《春》的对联
- tx注入器 Spring中DI设置器注入
- centos8部署django centos 6.6怎么部署vnc
- ssm配置事务 Spring中的四种声明式事务的配置
- spring中的配置文件 11.6.1 Wrox United中的配置文件[6]
- 用户控件和子窗体 10.6.3 Wrox United News用户控件[2]
- 《春天里》和国企MBO
爱学记

微信收款码
支付宝收款码