带有动态站点地图的 ASP.NET Webforms 物理站点结构
我在尝试了解网站结构时遇到了一些困难。 我有一个相当大的 asp.net 站点,其中:
管理员可以看到用户列表,每个用户可以有许多帐户,每个帐户可以有许多项目。
我可以将其想象为编辑特定项目的面包屑路径。
User List > Mr Bob > Accounts > BOB77 > Items > Item32 > Edit
- User List = 所有用户
- Mr Bob = 管理员从用户列表中选择的用户
- Accounts = 用户帐户列表
- 12BOB = 管理员选择了名为 12BOB 的帐户
- Items = 帐户包含的项目列表
- Item32 =管理员选择的项目
- 编辑 = 管理员想要执行的操作
我可以想象如果使用带有 URL 的 ASP.NET MVC 会是什么样子,但我不确定如何使用 Webforms 来映射它,并且在物理文件系统。
这就是我对物理结构的猜测。这是否必须使用会话变量来实现我想要做的事情?
- /Users/User/Edit.aspx <- 用于编辑用户
- /Users/User/View.aspx <- 用于查看用户
- /Users/User/Accounts/Default.aspx <- 用于查看所有帐户
- /Users/ User/Accounts/Account/View.aspx <- 用于查看帐户
- /Users/User/Accounts/Account/Edit.aspx <- 用于编辑帐户
- /Users/User/Accounts/Account/Items/Default.aspx < ;- 用于查看帐户中的所有项目
- /Users/User/Accounts/Account/Items/Item/Edit.aspx <- 用于编辑项目
在哪里可以阅读有关 Web 应用程序中此类设置的更多信息?或者,有人可以向我指出具有这种布局的可用项目的方向吗?
谢谢
I am having a little difficulty trying to wrap my head around site structures.
I have quite a large asp.net site, for which:
Admins can see a user list, Each user can have many accounts, and for each account can have many items.
I can picture this as a breadcrumb trail of editing a particular item.
User List > Mr Bob > Accounts > BOB77 > Items > Item32 > Edit
- User List = All the users
- Mr Bob = A user the administrator has selected from the User List
- Accounts = A list of the user's accounts
- 12BOB = The administrator has selected the account named 12BOB
- Items = A list of the items an account contains
- Item32 = The item that the administrator selected
- Edit = The action that the administrator wants to do
I can picture how this would look like if it was using ASP.NET MVC with the URL, but I am unsure how to map this out using Webforms, and in the physical filesystem.
This is what I have thought up about how I am guessing the physical structure would look like. Will this have to use session variables to achieve what I am trying to do?
- /Users/User/Edit.aspx <- for editing a user
- /Users/User/View.aspx <- for viewing a user
- /Users/User/Accounts/Default.aspx <- for viewing all accounts
- /Users/User/Accounts/Account/View.aspx <- for viewing an account
- /Users/User/Accounts/Account/Edit.aspx <- for editing an account
- /Users/User/Accounts/Account/Items/Default.aspx <- for viewing all items in an account
- /Users/User/Accounts/Account/Items/Item/Edit.aspx <- for editing an item
Where can I read more about this kind of setup in a web application? Or, can someone point me in the direction of an available project that has this kind of layout?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来很简单,但是当您想要布置逻辑结构并且考虑该结构的每个元素时,它就变得非常不清楚。
这是我想出的 url 格式。这使用查询字符串而不是会话变量。
查询字符串用作参数。
使用这种格式,我能够创建一个站点地图提供程序,它解释查询字符串的值并替换该页面的节点名称。
如果您遇到与我类似的情况,我希望这对您有所帮助。
This seems simple, but when you want to lay out the logical structure and you're considering every element to the structure, it becomes very unclear.
This is the url format I came up with. This uses query strings instead of Session variables.
Query strings are used as parameters.
Using this format I was able to make a sitemap provider which interpreted the values of the querystring and replaced the names of nodes for that page.
I hope this helps you, if you are in a similar situation to what I was.