c# - Run .aspx page, which is 'Added as Link' -
i created project in visual studio named 'myproject', , added .aspx file named 'mypage.aspx'.
now, created project in same solution named 'newproject'. added 'mypage.aspx' 'myproject', new project, using add link option.


now if make 'newproject' startup project, , 'mypage' 'newproject' startpage, says the resource cannot found.
how achieve this?
edit: consider mypage myproject fetching displaying value database 'abc'. connection string database 'abc' defined in web.config of myproject want created project, wherin want same functionality of mypage, if want fetch data database 'xyz' , not database 'abc'. shall adding connection string 'xyz' in newproject
you need add project reference 'myproject' newproject through add reference.
if using iis 7 or iis 7.5 can use
<system.webserver> <defaultdocument> <files> <clear /> <add value="mypage.aspx" /> </files> </defaultdocument> </system.webserver> http://www.iis.net/configreference/system.webserver/defaultdocument
or can try in global.ascx
public class global : system.web.httpapplication { protected void application_beginrequest(object sender, eventargs e) { if (request.url.absolutepath.endswith("/")) { server.transfer(request.url.absolutepath + "mypage.aspx"); } } }
Comments
Post a Comment