Statik ve dinamik dosyalarda göreli ve mutlak URL adresinin nasıl kullanılacağını tam olarak anlamak istiyorum.Web sitesinin kökünün temel URL'si (mutlak/göreli url)
~ :
/:
.. : in a relative URL indicates the parent directory
. : refers to the current directory
/: always replaces the entire pathname of the base URL
// : always replaces everything from the hostname onwards
Bu örnek, sanal dizin olmadan çalışırken kolaydır. Ama sanal dizinde çalışıyorum.
Relative URI Absolute URI
about.html http://WebReference.com/html/about.html
tutorial1/ http://WebReference.com/html/tutorial1/
tutorial1/2.html http://WebReference.com/html/tutorial1/2.html
/ http://WebReference.com/
//www.internet.com/ http://www.internet.com/
/experts/ http://WebReference.com/experts/
../ http://WebReference.com/
../experts/ http://WebReference.com/experts/
../../../ http://WebReference.com/
./ http://WebReference.com/html/
./about.html http://WebReference.com/html/about.html
Sanal dizin üzerinde çalışmakta olan projemde olduğu gibi, aşağıdaki siteyi simüle etmek istiyorum.
Bunlar benim aspx ve .Ascx klasörü vardır
http://hostAddress:port/virtualDirectory/MainSite/ASPX/default.aspx
http://hostAddress:port/virtualDirectory/MainSite/ASCX/UserCtrl/login.ascx
http://hostAddress:port/virtualDirectory/AdminSite/ASPX/ASCX/default.aspx
Bunlar benim JS Dosyalar (aspx ve ascx dosyaları ile hem kullanıma tabi) şunlardır: Bu benim statik web sayfası
http://hostAddress:port/virtualDirectory/MainSite/JavascriptFolder/jsFile.js
http://hostAddress:port/virtualDirectory/AdminSite/JavascriptFolder/jsFile.js
olduğunu
adres (bazı resimleri göstermek ve bazı js işlevlerinin içinde çalışmak istiyorum):http://hostAddress:port/virtualDirectory/HTMLFiles/page.html
Bu benim resim ekranım er
http://hostAddress:port/virtualDirectory/Images/PNG/arrow.png
http://hostAddress:port/virtualDirectory/Images/GIF/arrow.png
i yazmaya ve benim ASPX dosyası görüntü dosyanın bağ ı
aspxImgCtrl.ImageUrl = Server.MapPath("~")+"/Images/GIF/arrow.png";
yazmak Fakat gerektiğini istiyorsanız ben yolunu sert kodlu veya javascript dosyadan, yazmak isterseniz url ne tür Adres olmalı?