Web Forms :: Use Page.ResolveUrl In Web.sitemap?

Feb 14, 2010

I want to use .sitemap file,but how to use Page.ResolveUrl in it. Because i have used UrlRewriting so it url are virtual.tell me if another way of doing this.

View 1 Replies


Similar Messages:

C# - ResolveUrl Without A Page

Feb 4, 2011

I am looking for a way to resolve a relative url the way you would with a page or control instance (MSDN Docs) such as:

Page.ResolveUrl("~/common/Error.aspx");

...but when I only have an HttpContext available to me, such as when I am in a HttpHandler.

Will I need to use a custom function, such as the one seen here?

Or is there a way to get at the underlying function used by the Page.

View 2 Replies

Web Forms :: Parser Error Message - XML Sitemap Config File Web.sitemap Could Not Be Loaded

May 11, 2010

We are getting this error message when we try to click the link in the menu to go to Report Server:

Source Error:
Line 31: <siteMapNode title="Reports" description="Reports">
Line 32:
Line 33: <siteMapNode url="https://ffxsqldgc01.ffx.co.fairfax.va.us/Reports/Pages/Folder.aspx?ItemPath=%2fDPZ&ViewMode=List" title="View Reports"
description="Click here to view the reports" />
Line 34: </siteMapNode>
Line 35:

I tried to add after the &, as it was suggested on one of the forum but it did not work. Any other ideas.

View 5 Replies

Web Forms :: Page Url In Web.sitemap

Feb 16, 2010

Im using url rewriting and i want to use web.sitemap, so how can give the url of page since it virtual?

View 2 Replies

Web Forms :: Set Page Title From Web.sitemap?

Feb 13, 2011

I have a some code that I have used to set the page title from the sitemap on my root.master. I also use very similar code to add a titlebar from sitemap on my nested.master. Im just getting starting to try to build classes and was wondering if there is a way to make this into a class and then referance it in each master/nested master?

Also it errors out if the is no Title attribute in the node, is there anyway to test if it exists first?

[Code]....

[Code]....

View 2 Replies

Web Forms :: Web.sitemap - Page Not Open In New Window

Mar 15, 2010

I have a web.site map that works fine with the exception of opening a page in a new window. The page opens, just not in a new window and I can't figure out what I am doing wrong.

<siteMapNode
url="Part3.aspx"
title="Part
III Practice Component"
description=""
<siteMapNode
url="InterviewLog.pdf"
title="Print
Version Guide and Log"
description=""
roles=""
target="_blank"
<siteMapNode
url="EnrollmentForm.pdf"
title="Enrollment
Form"
description=""
roles=""
target="_blank"
siteMapNode>

View 3 Replies

Web Forms :: SiteMap With Multiple Paths To Same Page?

Jul 20, 2010

I have a sitemap, and i'm using nested repeaters to display the parent and child nodes for my breadcrumbs.I have 3 pages: Home, Hub, and Search.Each of these pages can navigate to each other. In other words:

Home> Hub
Home> Search
Home> Hub > Search
Home> Search > Hub
Home > Default

The most common path would be "Home > Hub" and Home > Search > HubHowever, I can't seem to figure out how to show this on my breadcrumbs, since you can't have multiple ULR's in the Sitemap. Right now, you can only go "Home > Hub". If you go from "Search" to "Hub...it should show "Home > Search > Hub" in the breadcrumbs.

View 5 Replies

Web Forms :: Update Page After Editing Sitemap?

Sep 6, 2010

code to allow authorised users to add categories to a shopping catalog:

Sub editXml()
If txtNewCat.Text.Count > 0 Then
Dim sMap As New XmlDocument
sMap.Load(Server.MapPath("App_Data/Web.sitemap"))

[Code]....

trvCats is the ID of the treeview that displays the sitemap contents. Problem is the the trvCats.DataBind() line isnt running when run the code. The new entry is added to the sitemap file, no problems but the code seems to exit after the sMap.Save line so the user must refresh the page to see the updated TreeView. If I set a breakpoint on the trvCats.DataBind() line then it does run but if I remove the breakpoint then it doesn't.

Also a smaller point is that the new node is automatically created with the xmlns attribute. Although this doesn't cause an error I would rather not have it if possible. Anyone got a suggestions how to get rid of it?

View 8 Replies

C# - Is It Possible To Override ResolveUrl

Dec 14, 2010

I use the following my .net applications to resolve the path to an image or css file or javascript file.

<%=ResolveUrl("~/Scripts/myscript.js")%>

<%=ResolveUrl("~/images/myimage.jpg")%>

All my pages and controls inherit from a base page or base user control.

I have tried but didnt succeed in overriding the ResolveUrl method so that I could include some custom logic in the files path.

how I might override the ResolveUrl method? Alternative is to create my own custom method that does similar but would prefer to work with ResolveUrl.

View 2 Replies

Sitemap Randomly Breaks Over Time / Could Not Find The Sitemap Node With URL '~/Default.aspx'

Aug 2, 2010

I've been having some production runtime errors that I don't fully understand. This has happened to us on a couple different ASP.NET 4.0 Web Sites (shudders - yes, I know - we're porting it to MVC but that's taking some time).

First of all, we have never been able to reproduce this issue in development/QA environments. Secondly, upon deployment, the issue seems to be non-existent. Sometimes the issue manifests within a day or two of deployment and other times the deployment will be live for a month without it manifesting at all. However, once it manifests, then ANY page viewed under the web site causes the error. Lastly, this problem seemed to only come up once we migrated to .NET 4.0. We started at 2.0, a year ago upped to 3.5, and recently upped to 4.0 with this solution and most child projects.

The error:

Could not find the sitemap node with URL '~/Default.aspx'.

A simplified version of our sitemap (with some names changed and uninteresting nodes removed) is as follows:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode roles="*" title="EG">
<siteMapNode url="~/../SM/Default.aspx" title="Welcome" description="" roles="*" />
<siteMapNode url="~/../SD/Default.aspx" title="SD" description="" roles="*" />
<siteMapNode url="~/../SMD/Default.aspx" title="SMD" description="" roles="*" />

[code]...

I have confirmed in all of the SiteMaps that there is a node with url="~/Default.aspx" with roles="*" (which includes public/anonymous access), so I am very confused as to why this problem occurs.

SiteMap does not have a node for Default.aspx. All of them do. SiteMap's Default.aspx node is not accessible for security reasons to the current user/role. They're all accessible to anonymous users and this problem even exists for super admin users. Passed-in URL contains querystrings (Default.aspx?abcd). I don't know if this is a problem (I sure would hope not) but once the problem manifests itself, I can handwrite the URL with no querystrings and the problem still exists.

SiteMap changes. It doesn't Service's permissions to the sitemap file. The sitemap works perfectly fine after a deployment, so unless permissions are changed in a way that IISRESET fixes, then this is not an issue. The worker process becomes globally corrupt. I don't think so. We have ~12 web sites all in the same app pool and the problem always stays confined within a single web site. Also, we have yet to have this happen to more than a single web site at a time although it has manifested itself in 4 different ones so far.

View 1 Replies

ResolveUrl In Static WebMethod?

Jun 23, 2010

How do you resolve a url like "../../images/test.png" to [URL] in a static asp.net web method?

View 2 Replies

SiteMap Change SiteMapProvider / Create Multiple Web.sitemap Files?

Jan 25, 2011

I've got a custom menu navigation built from a web.sitemap file, the first line of this would be something like:

SiteMapNodeCollection topLevelNodes = SiteMap.RootNode.ChildNodes;

However, now I want to be able to create multiple web.sitemap files, and then programmatically determine which web.sitemap file to use, but I can't seem to find out how to do this. I'm assuming I could either create one custom SiteMapProvider that can perform the logic to determine which web.sitemap file to load, or I have multiple providers, each one with the SiteMapFile property set to a specific *.sitemap file, and then switch providers programmatically before I access SiteMap.RootNode.

View 2 Replies

Web Forms :: Hide A Link In The Sitemap - Yet Still Show The Breadcrumb On The Page?

Oct 1, 2010

We have a dynamic sitemap and all nodes in the sitemap display a breadcrumb. Is it possible to have the breadcrumb still showing, but make the link in the sitemap invisible or non-clickable? Reason for this is that... we dont want users to select some pages from the sitemap (becasue they need to conduct a search first to populate a datagrid) and clicking on the link will only take them to an empty page. I tried just removing the url, or having a blank title, but that didn't work.

View 14 Replies

Web Forms :: SiteMap & Master Page: Set Session Variables And Dynamic URL's

Jul 6, 2010

I have a web application that contains a MasterPage and a Web.sitemap file for the navigation. I am loading the navigation into an <asp:Repeater> control and I associating it with <asp:LinkButton>; something like this:

[Code]....

I have two issues:

Setting Session Variables: I'd like to set some session variables when any menu item is clicked.Dynamic Url: Once the Session variables are set, I'd like to set the url dynamically after the Session variable is set The thing is, I'd like to use the same aspx file for two different menu items, and I'd also like to set some session variables at the time of menu selection. I am aware that I cannot use the same url when I define the url in the web.sitemap file.

View 2 Replies

C# - ResolveURL Not Resolving In A User Control?

Mar 31, 2010

I'm trying to use ResolveUrl() to set some paths in the code behind of a custom ASP.NET user control. The user control contains a navigation menu. I'm loading it on a page that's loading a master page.

When I call ResolveUrl("~") in my user control it returns "~" instead of the root of the site. When I call it in a page I get the root path as expected. I've stepped through with the debugger and confirmed, ResolveUrl("~") returns "~" in my user control code behind.

Is there some other way I should be calling the function in my user control code behind to get the root path of the site?

View 4 Replies

MVC :: Razor And ResolveUrl / Getting Error CS0103

Aug 22, 2010

I have the following:

[Code]....

And I am trying to do the same with Razor:

[Code]....

But I keep having the error:

Compiler Error Message:

CS0103: The name 'ResolveUrl' does not exist in the current context

What am I doing wrong?

View 6 Replies

Web Forms :: Programmatically Reference .sitemap File That Isn't The Root Web.sitemap File?

Nov 4, 2010

How would I programatically reference a .sitemap file that is not the root web.sitemap file? I have a file called research.sitemap in a folder a level under root. I want to refernce this file in my code behind like his: SiteMapNode m1 = SiteMap.RootNode (but since this isnt web.sitemap in the root, I dont know how to get access to it).

View 1 Replies

Web Forms :: Sitemap Node - Seond Line Of Sitemap Node Won't Indent?

Mar 25, 2010

I have a second level node that goes onto two lines. The first line indents 15px as is set by the class for node level 2. The seond line kicks back to the same level as 1st level nodes. Here's what I mean:

Parent Node

Second node

line 2 of second node

I want it to be like this:

Parent Node

Second Node

line 2 of second node

View 4 Replies

Finding ResolveUrl/ResolveClientUrl Equivalents For Razor?

Feb 16, 2011

So I've started using the <%: Url.Content(~/site/blah) %> syntax as standard for CSS, JScript and Image urls - solves a lot of issues indeed; and it's at least consistent beween WebForms and Razor pages (not all of my devs will be doing Razor, and yet they will still be working on this platform I've produced).

However, for something that I'm doing at the moment I could really do with a way to take a relative Url written in a Razor page and, at run time, resolve it to the correct server side file, before turning it back into an absolute Url for the client. Url.Content doesn't do anything with relative Urls.

So, basically, I want either an equivalent of ResolveUrl or ResolveClientUrl at the Razor level.

I would like this to enable terser (and more tolerant to renaming) resource paths in some of my MVC views, which can be a few folders further down from the root, and whose content folder would be more easily expressed as a relative path - so I could have:

folderfolderviewssharedlayout.cshtml
and
folderfoldercontentsite.css

(I've inferred the use of a layout page, also, to mirror the kind of issues that are addressed by ResolveUrl and the re-basing that WebForms does)

Using Url.Content as it is, I would need to specify the full path:

Url.Content("~/folder/folder/content/site.css")

But what I would like is

Url.Content("../../site.css")

And have that work, of course, regardless of how many paths there are in the current request's route.

Of course I can get this to work in WebForms, if I ditch the Url.Content call and just rely on url rebasing.

Is there any equivalent in Razor?

View 1 Replies

Forms Data Controls :: Using A Repeater To Build A Website's Site Map Page By Binding To The Web.sitemap File?

Jun 3, 2010

I've been using a repeater to build a website's site map page by binding to the web.sitemap file. For example, to display 2 levels of links:

[Code]....

So far, everything works well. However, in some cases, I do not want to display certain pages in the site map. I've added a custom attribute to each node (nodisplay= 'true').How can i check for this attibute, and avoid it from being displayed by in the repeater.

View 3 Replies

C# - How To Get The Name Of Sitemap File From Sitemap Provider

Oct 6, 2010

I am creating a CacheDependency on the file that my SiteMap provider uses. I would like to get the name of the file from my sitemap provider instead of hard coding it. Is there a way?

Edit

Duh, I forgot to mention: XmlSiteMapProvider that comes with ASP.NET

Edit 2

Reflector shows a private member field called _filename that isn't exposed in any way as far as I can tell.

View 1 Replies

C# - Use Web.sitemap To Control Page Access

Apr 1, 2010

I was setting up permissions for pages in a ASP.NET website with <location> tags in web.config, something similar to this:

<location path="Users.aspx">
<system.web>
<authorization>
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>

However, I also have a web.sitemap which basically contains the same information, i.e. which user roles can see/access which pages. A snippet from my web.sitemap:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="[URL]AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home">
... lots of nodes here ...
<siteMapNode url="users.aspx" roles="Administrator" title="users" description="Edit users" />
...
</siteMapNode>
</siteMap>

Is there some kind of nifty way of using web.sitemap only to configure access? The <location> tags are quite verbose, and I don't like having to duplicate this information.

View 3 Replies

Adding An Internal ASPX Page With Relative URL To CRM 4.0 Sitemap

Feb 8, 2011

I've added a subarea to my sitemap in CRM 4.0, and for absolute URLs it works as expected. However, for relative URLs it does not. The page in question is internal and is accessed through:

http://localhost/ISV/<orgName>/Account.aspx/ExternalDocumentList

However, I would prefer writing this in sitemap:

/ISV/<orgName>/Account.aspx/ExternalDocumentList

When this is expanded, CRM/IIS rewrites it to:

http://localhost/<orgName>/ISV/<orgName>/Account.aspx/ExternalDocumentList

For reference, here is the sitemap addition (which doesn't work):

<SubArea Id="custom_documentHistory" Url="/ISV/<orgName>/Account.aspx/ExternalDocumentList">
<Titles>
<Title LCID="1033" Title="Document History"/>
</Titles>
</SubArea>

How can I link to this page relatively?

View 1 Replies

ResolveUrl Path Receives Error: "Too Many Characters In Character Literal"?

Apr 1, 2010

I am trying to do a correct path javascript like this to an image but when compiling this code, I receive the error:

"Too many characters in character literal"

I have tried to figure it out but it seems correct but something might be wrong. I have to use ResolveUrl to go back to the rootdirectory.

[Code]....

View 2 Replies

Security :: SiteMap - Different Security Trimming For The Same Page?

Mar 3, 2011

I have a site map with a node and two inner nodes. The inner nodes have the same url but a different querystring parameter. I want the users with role "User" to see only the second of these links in their menu.

This is my siteMap:

[Code]....

This is the configuration of the web.config:

[Code]....

As a result, the users with role "User" can see only the second link (Search) which is fine, but they get an Access Denied when they navigate to it which is logic since they don't have access to that page, but it's not really fine for me.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved