Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 http://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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...