Problems with url's when running web site from store only

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
I am working on a web site that is under construction and upgraded to 1.90 to 1.80.  After the initial 1.90 install, I have updated various files (our own user controls, stylesheet classes, Telerik controls, etc.).  Also, I did compile the entire solution.

Then I created a new web site in VS2010 from ONLY the store portion of the solution.  I have done this in the past to speed testing and development activites.  But this time, I am having problems with url's for both images and style sheets.

There are two different scenarios...


THE FIRST SCENARIO
The first is when I use a standard HTML image control (<img)...
For example:
(1) If I drag a graphic from the default /images folder and drop it on an .aspx file, I get something like the following:
<img src="../images/greenbutton.png" height="78px" width="212px" alt="Homes Online Network logo" />

When I display this page, the graphic does not display, and the properties of the graphic in IE8 shows an address of
"http://localhost:56331/images/greenbutton.png".

(2) If I change the above line of code in the .aspx file to:
<img src="images/greenbutton.png" height="78px" width="212px" alt="Homes Online Network logo" />
then I receive a "green underline error" from VS2010, but when the page is displayed the graphic displays perfectly and its properties in IE8 shows an address of "http://localhost:56331/nopComm190HON100WSO/images/greenbutton.png".



THE SECOND SCENARIO
The second scenario occurs when I use a .NET image control (<asp:Image)
In this scenario, the exact reverse occurs.  In other words, when VS2010 does NOT show an error, then the image shows perfectly and when VS2010 DOES show an error, then the graphic does not display.

QUESTIONS:

Now, I may not be the world's brightest light bulb, but something weird is happening here.  
What is going on that is messing up these paths?  I think this is the first time I have ever seen a difference in the paths required between a standard HTML control and a .NET control.

I am also having similar problems with some developed user controls that reference style sheets and do not find the style sheets when displayed.

Thanks in advance for the assistance.

Lynn
13 лет назад
Hi Lynn,

try referencing your image source like so:

<img src="<%=Page.ResolveUrl("~/root/to/yourImage.gif")%>"     />



You can reference the stylesheet in the same way but why not just put the additional stylesheet in your chosen theme folder ( beside styles.css ) and you won't have to reference it separately, it will be loaded along with the rest of the theme ?
13 лет назад
Haydie,

Thanks, I have made both of those changes and issues were resolved.  Now I have run into another problem with the same configuration (store only).  

I made some visual changes to the root.master (changing the div structures, adding additional graphics, etc.) but after making the changes the resulting displayed home page did not contain any of the changes.  I kept making small changes and restarting the application and the resulting output would NOT reflect the changes.  

Finally I removed an asp:Panel control from the master page that I was using to display a graphic and also removed all references from the asp:Panel from the code-behind file.  When I restarted the application, the home page started to display then the error occurred.  The code-behind page was displayed with the error highlighted (typical .NET debug display)....and the displayed code-behind file was from the full version of the nopCommerce 1.90 full solution that I had used as the source for the "store only" project.

Are there any instructions/manual pages/etc. for how to implement just the "store only" by itself?  This one really confused me.  The display portion of Root.Master was being used, but it was being used with the code-behind from another visual studio solution.

Do you have any idea why this happened?

Thanks in advance!

Lynn
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.