I am using Visual Studio.net to create asp.net web pages. the problem i am having is that if i use different folders for my code and upload it, everything is fine. but the code to reference the folders when run locally through Debug will produce an error. How can you use Studio to develop asp.net apps and be able to debug them?
an example of what i mean. in my root folder, i have a default.aspx form that has a button that when clicked, will execute the code
Page.Response.Redirect(@"\folder1\default.aspx");
folder1 is a folder that i created in the root directory. so when i upload to my site, this code knows to execute www.mysite.com\folder1\default.aspx.
but locally this gives an error because it is executing
http://localhost/MyProjectName/default.aspx
and when i click the button to redirect it would execute
http://localhost/folder1/default.aspx
of course i could change the redirect code to be
Page.Response.Redirect(@"\MyProjectName\folder1\default.aspx");
but then i would have to change this every time i upload.
so what am i supposed to do?
an example of what i mean. in my root folder, i have a default.aspx form that has a button that when clicked, will execute the code
Page.Response.Redirect(@"\folder1\default.aspx");
folder1 is a folder that i created in the root directory. so when i upload to my site, this code knows to execute www.mysite.com\folder1\default.aspx.
but locally this gives an error because it is executing
http://localhost/MyProjectName/default.aspx
and when i click the button to redirect it would execute
http://localhost/folder1/default.aspx
of course i could change the redirect code to be
Page.Response.Redirect(@"\MyProjectName\folder1\default.aspx");
but then i would have to change this every time i upload.
so what am i supposed to do?