asp.net - Problem with application path in IIS7 -
i trying add application live server. site in plain html. there 2 links go 2 application. go siteapp , go main app.
in wwwroot have added site folder name(lets saye mywebsite) , configured in iis7 dns ip address. works fine.
then added 2 more subfolder (siteapp & mainapp) 2 application written in vs 2008 , conver them application.
so when go www.mywebsite.com/mainapp/default.aspx - works fine if click button(forget password) in default.aspx- tries access www.mywebsite.com/forgetpass.aspx , fail. suppose go www.mywebsite.com/mainapp/forgetpass.aspx goes root reason.
if click normal href="www.mywebsite.com" link goes http://www.mywebsite.com/mainapp/www.mywebsite.com
i have tried catch in global.asax page no luck
code in globacl.asax
application("apppath") = configurationsettings.appsettings("applicationurl") if application("apppath") = "/" application("apppath") = system.configuration.configurationmanager.appsettings("applicationpath") end if if application("apppath") <> system.configuration.configurationmanager.appsettings("applicationpath") application("apppath") = system.configuration.configurationmanager.appsettings("applicationpath") end if
code in web.config
<add key="applicationurl" value="www.mywebsite.com/mainapp/"/>
i using iis7
any idea how can fix this?
all urls within page relative website. if yo have website in c:\inetpub\wwwroot, urls resolved based off path. try following:
<add key="applicationurl" value="/mainapp/"/>
Comments
Post a Comment