How do you dynamically rename a node in a ASP.NET sitemap? - asp.net

On our site, we have our sitemap in this order:
SiteName > SelectedProject > Path > To > Page
Where SiteName takes you to the very root page which is primarily to select a project and SelectedProject takes you to the project's homepage.
Currently, in the Web.sitemap file, SelectedProject has a static name. How can I rename it to the name of the selected project, which can be obtained from Session("PRJ")?
I'd strongly prefer any code behind to be given in VB.NET, not C#. Thanks a lot in advance!

first is you site map coming from the database or is it fully static???
if you want it to make it dynamic you have to make a new table and store all your data there!!
but if that file is static then i think you can use this code:
theNameOfYourSitemapControl.selectedNode.Text ="thenameoftheproject"

Related

How to Read the Tridion Page URL from the publication using Core Services?

I have a list of Tridion page URL's in an excel sheet, which should be unpublished on Click of a button for which I am developing a custom page. How do I read the URL from the publication.? For example, the URL looks like "https://www.example.com/us/en/abc/cde/index.html" (us/en - country/language; abc- folder in structure group, cde- subfolder in abc, index.html is the page) Now index.html should be unpublished.
If I understand you correctly, you have the URL of a page and you want to find the corresponding page in Tridion. First the bad news: The core service (the CM API) does not support a 'find by url'. The quick and dirty approach would be to use the CD API to retrieve the page. This will give you Page back which has an ID property. You can then use the core service to unpublish the page.
You can also do it with a pure core service approach but it's a bit more work and it's slow. It goes like this:
Start from the top level directory (in your example 'us')
List all structure groups inside the root using a filter like this:
var filter = new OrganizationalItemItemsFilterData()
{
ItemTypes = new ItemType[] { ItemType.Page },
IncludePathColumn = true
};
Use Linq to find the one with the top-level directory you're after
Move to the next directory and repeat with the child structure group you found

IIS with VBNet Aspx, how to setup/config a site (programmatically or not) to have a folder

I have IIS, using Aspx with VBNet.
I have a site ex. mystockmarketeg.com
I have many pages of the assets of the market, e.g. I use the ? and cod=THEASSET to change the page I want to display e.g.:
mystockmarketeg.com?myinsidepage.aspx?cod=ASSET1
mystockmarketeg.com?myinsidepage.aspx?cod=ASSET2
mystockmarketeg.com?myinsidepage.aspx?cod=ASSET3
Just changing the cod parameter I can access different pages.
But I think this doesn't perform very well on google.
So I want to have a url like this:
mystockmarketeg.com/ASSET1
mystockmarketeg.com/ASSET2
mystockmarketeg.com/ASSET3
Is there a way programatically in ASPX VBNEt or changing some property on ISS to do it without the need to create folders and putting the index page on each folder?
Configure ASP.NET Routing to achieve this result. Note that if you have hyperlinks with dynamic URLs, the URLs should be generated using <%$RouteUrl:...parameters...%>.
See also a detailed ASP.NET Routing description.

I want a completely separate page from my Wordpress-installation

I have a wordpress-driven project and want to add 1 single page to that project, that has entirely nothing to do with wordpress at all, but just consists of plain html - no links from the one to the other; nothing. This page shall be accessible via abc.com/folder while the original wordpress-project is still all over abc.com
What would be the best way to do this? Just add the folder and page, or do I also need to do something on the htaccess-file?
thanks
Just create that folder and name your html index.html inside that folder. This way that html file can be accessed via abc.com/folder

how to show images from ftp folder with folder names and images names in asp.net c#

I am beginner in asp.net development. I am creating an web application where I am required to show images from folder along with folder name. Such that one list containing folder names when one folder name is selected its file names are displayed (images names) and also in image viewer images are displayed one by one on button click. then so on for next folders.
Any suggestion, code or useful link will be highly appreciated.
Thanks in advance.
Here is what you want
You can use Jquery tree view with Asp.net
http://www.programmingsolution.net/useful-js/jquery-treeview.php
For jquery try this
http://jquery.bassistance.de/treeview/demo/
Check this ready to use control with lesser effort I suppose. http://www.obout.com/Obout.Ajax.UI/FileManager/

Uploading and downloading files from a list type

I am using an ASP.NET FileUpload to upload files to the server. How to upload it to the rootfolder of my project. I want to add the files to a collection or list of files to be shown on the webpage in the form of gridview. Each file should have a link to itself in the list So that it could be downloaded by the click-if desired. The gridview will also have a delete column so that I can delete any of the corresponding file-as desired. Can anyone help me to achieve this easily-without javascript or ajax
There are two ways to do it:
Simple way: create a sub-folder where you'll place your files and use DirectoryInfo.EnumerateFiles to list them.
Complex (but better) way: create a sub-folder where you'll save your files, outside of the web site, when a file is uploaded write an entry into a database, specifying the file's name (and maybe some other useful informations, e.g. size, type, etc), in your page you list the database entries, and when a user clicks on one of the links you serve the files through an ASHX handler. This way you have access control on who can download the files, and can track statistics.

Resources