如何使用配置文件在ASP.NET?

编程入门 行业动态 更新时间:2024-10-09 21:18:48
本文介绍了如何使用配置文件在ASP.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试学习asp档案管理。但我在下面加XML名字,姓氏等。但我不能写个人资料。如果我尝试写配置文件属性。卓尔我的编辑简介:错误1名资料并不在当前的背景下存在C:\\ Documents和Settings \\ ykaratoprak \\桌面\\安全\\ WebApp_profile \\ WebApp_profile \\ Default.aspx.cs 18 13 WebApp_profile我如何能做到?

i try to learn asp Profile management. But i added below xml firstName,LastName and others. But i cannot write Profile. if i try to write Profile property. drow my editor Profile : Error 1 The name 'Profile' does not exist in the current context C:\Documents and Settings\ykaratoprak\Desktop\Security\WebApp_profile\WebApp_profile\Default.aspx.cs 18 13 WebApp_profile How can i do that?

<authentication mode="Windows"/> <profile> <properties> <add name="FirstName"/> <add name="LastName"/> <add name="Age"/> <add name="City"/> </properties> </profile> protected void Button1_Click(object sender, System.EventArgs e) { Profile.FirstName = TextBox1.Text; Profile.LastName = TextBox2.Text; Profile.Age = TextBox3.Text; Profile.City = TextBox4.Text; Label1.Text = "Profile stored successfully!<br />" + "<br />First Name: " + Profile.FirstName + "<br />Last Name: " + Profile.LastName + "<br />Age: " + Profile.Age + "<br />City: " + Profile.City; }

推荐答案

要在你所描述的方式使用配置文件需要一个网站项目。你的问题意味着你有一个Web应用程序项目。

To use Profiles in the manner you describe requires a Web Site project. Your question implies that you have a Web Application project.

在Web应用程序项目中使用的配置文件是比至于是不是为您生成动态的ProfileCommon类网站更多的工作。

Using profiles in a Web Application project is a little more work than with a Web Site as the dynamic ProfileCommon class is not generated for you.

下面是一些参考资料,以帮助您理解的差异。

Here are some references to help you understand the differences.

weblogs.asp/anasghanem/archive/2008/04/12/the-differences-in-profile-between-web-application-projects-wap-and-website.aspx

这是一个工具,可以使用Web应用程序的配置文件更加容易。

And here is a tool that can make using profiles in Web Applications easier.

weblogs.asp/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx

更多推荐

如何使用配置文件在ASP.NET?

本文发布于:2023-11-07 15:32:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566828.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   配置文件   NET   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!