将 .ASCX 项目添加到站点地图

发布于 2024-09-15 19:17:51 字数 992 浏览 4 评论 0原文

有没有办法将 .ascx 文件添加到站点地图,以便根据上次访问的控件加载/卸载控件?问题是我有一个页面,其中包含一些相互放置的控件,我希望能够使用站点地图在它们之间跳转,而不是为它们创建一个新页面...这就是我的内容我试图将其放入站点地图中,但没有成功(请参阅产品列表、产品详细信息):

<siteMapNode url="Default.aspx" title="Home"  description="Home Page of _____">

    <siteMapNode url="UserFunctions/ChangePassword.aspx" title="Change Password"  description="Change Password" />
    <siteMapNode url="Setup/EditUsers.aspx" title="Edit Users"  description="Edit Users" />
    <siteMapNode url="Setup/EditOther.aspx" title="Edit Other"  description="Edit Other" />

    <siteMapNode url="DataEntry/EditPartners.aspx" title="Partners" description="Partners">
        <siteMapNode url="WebControls/Product List.ascx" title="Product List"  description="Product List" >
            <siteMapNode url="WebControls/ProductDetail.ascx" title="Product Detail" description="Product Detail" />
        </siteMapNode>
    </siteMapNode>

</siteMapNode>

Is there a way to add .ascx files to a sitemap such that it will load/unload the controls based on the last ones visited? The problem is i have a page that contains a few controls that get placed under one another, and i'd like to just be able to jump between them with the sitemap instead of creating a new page for them... this is what i'm trying to put into the sitemap without luck (see Product List, Product Detail):

<siteMapNode url="Default.aspx" title="Home"  description="Home Page of _____">

    <siteMapNode url="UserFunctions/ChangePassword.aspx" title="Change Password"  description="Change Password" />
    <siteMapNode url="Setup/EditUsers.aspx" title="Edit Users"  description="Edit Users" />
    <siteMapNode url="Setup/EditOther.aspx" title="Edit Other"  description="Edit Other" />

    <siteMapNode url="DataEntry/EditPartners.aspx" title="Partners" description="Partners">
        <siteMapNode url="WebControls/Product List.ascx" title="Product List"  description="Product List" >
            <siteMapNode url="WebControls/ProductDetail.ascx" title="Product Detail" description="Product Detail" />
        </siteMapNode>
    </siteMapNode>

</siteMapNode>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凝望流年 2024-09-22 19:17:51

不,用户控件仅存在于页面内;您可以引用product.aspx?category=,因此您可以在站点地图中定义一个查询字符串值,并根据该值动态加载正确的用户控件。这可以工作,但不能直接引用用户控件。

HTH。

No, a user control only lives within the page; you could have a reference to product.aspx?category=, so you'd define a querystring value in the sitemap, and dynamically load the correct user control based upon that value. That would work, but not referencing a user control directly.

HTH.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文