Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debug mode works - but normal browsing fails 1

Status
Not open for further replies.

jacktripper

Programmer
Dec 5, 2001
124
US
This is really frustrating. I thought I had everything working great, but when I test it outside of debug mode in VS.Net, it all craps out.

I am trying to create a simple Intranet site to point to files on a shared drive. The database stores the location of the file on the drive as "\\shared_drive\file.txt". My gridview shows the file as a link, and it opens the file just fine -- IN DEBUG MODE.

I browse to the same site via IP Address, and my link is now " and the link fails.... UGH.

On top of this, when I add a new link to the database IN DEBUG MODE using a FileUpload control to find the path, it works and the whole path is stored. I try the same via IP Address, and it only stores the filename, and not the path at all.

What gives? Ideas? I am desperate. I told people it was working because I thought it was... Stupid debug mode...
 
It's not a problem with "debug mode", it's a problem with how you've created your code to work from a real web server. I'm not sure what your ASP.NET or HTML code is though, so as a complete guess I'd say you aren't adding the correct file protocol to the URL.

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
I am not sure why a website would behave differently at versus -- if I am access both sites while logged into the same server and the same directory on the server. I was thinking it might be an IIS setting or something in the .Net config.

I can add the "file://" to the front of the hyperlink URL, but that ends up doing nothing. The link itself doesn't fire at all.

Here are some code snippets, though, they are exactly the same....

Link that fails while browsing to the IP address of my server:
<a id="ctl00_gvDocuments_ctl07_HyperLink1" href="\\shared_drive\Clayton\Kofax error-030411.doc">\\shared_drive\Clayton\Kofax error-030411.doc</a>

Link that works while in debug IE launched from VS:
<a id="ctl00_gvDocuments_ctl07_HyperLink1" href="\\shared_drive\Clayton\Kofax error-030411.doc">\\shared_drive\Clayton\Kofax error-030411.doc</a>
 
it behaves differently because local development runs the site under your credentials on your box. the server and client are the same machine with your credentials. when deployed the server and client are physically different and security comes into play: authentication, impersonation, delegation.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
so I can maybe change the web.config file to authenticate and impersonate. Is that what you mean?
 
that may be part of it. My point was more that there will always be a difference with local development and a remote staging and/or production server. That's why it's a good practice to have a testing/staging environment that mimics the production environment as much as possible. You can work out deployment bugs in the staging environment before deploying to production.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Well, it is working for now! (I think)

This is strange, but I think it had to do with the site being a "Trusted Site". It is probably automatically "trusted" in debug mode...

I went in IE and reset all the settings. When I got to my site, it said it wasn't trusted and (more than likely) some javascript code was being blocked. I never saw that message before because it had been shut off by clicking "never show this message again".

I added the IP address to the list of trusted sites, and bingo, the FileUpload control is working and all the links go to the file location and not
I am going to have other people test it. It doesn't work with FireFox, but its a company Intranet so I don't care if it only works with IE.

Bizarre, though. Thanks for all the help...
 
definitely bizarre, as you shouldn't need to trust a site to upload a file.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top