Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2004, 10:00 AM
Authorized User
 
Join Date: Jan 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default folder name issue

I feel really silly asking, but I have to I guess. I have a folder containing all of the pages on a website. I wanted to rename the folder and filter through it eliminating unused pages. As a result, the main page has some weird style issues. When I copy the folder and rename it, the main page works fine. It's an exact copy of the folder and it's in the same location but doesn't produce the errors. Can anyone give me a reason why this would be happening? Much appreciated!
 
Old March 11th, 2004, 10:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hard to say, without seeing any pages or folder structure explained.

Is any of the pages referencing hardcoded path? e.g. a link to a stylesheet like /MyWebapplication/Styles/StyleSheet.css?

If that's the case, these kind of links will break when you rename MyWebapplication, for example.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 16th, 2004, 04:34 PM
Authorized User
 
Join Date: Jan 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I understand what you're saying. The thing that really trips me up though is the site works fine when the file is named anything but percent_pred_freeze. I can name it anything but that. It doesn't make any sense to me. The file structure is exactly the same and there are no hardcoded paths. This has happened to me in two different situations now. I must be doing something strange. I appreciate your comments.
 
Old March 16th, 2004, 04:55 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think your computer is haunted. This shouldn't happen.

Can you provide more details about setup etc? Maybe even post a page or two?

Maybe the Web server gets confused when you start moving folders. Are you using IIS? How did you define your application?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 17th, 2004, 12:15 PM
Authorized User
 
Join Date: Jan 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes we do use IIS. I'm not sure what you mean by how I define my application. And I am interested in your comment about confusing the web server by moving folders. I keep all the folders in the same place. I just added one and copied the files from the first to the new one for testing purposes. I haven't had trouble with this in the past but that doesn't mean it's okay to do.

Here's one page. I'd send more but they're so long. When I access this page from the "haunted" folder it won't even follow the redirect. Thanks again.

%@ LANGUAGE="VBSCRIPT" %>

<%if request("Excel") = "Yes" then
Response.ContentType ="application/vnd.ms-excel"
else
end if%>
<%
    if (len(request("freeze_date")) < 1) or _
        (len(request("fy")) < 1) then
            response.redirect("percent_pred_start.asp")
    end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en-us">
<head>
<META name="keywords" lang="en-us" content="percent pred, execution, stmc">
<title>PE View - Snapshot Site</title>
<link rel='stylesheet' type='text/css' href='r2_style.css'>
</head>
<body>

<%if request.form("submit") = "Output to Excel" then %>
<%param = "fy="&request("fy")&"&freeze_date="&request("freez e_date")
response.redirect "pp_excel.asp?"&param
end if%>

<%if request.form("submit2") = "Output to Excel Non 3x" then %>
<%param = "fy="&request("fy")&"&freeze_date="&request("freez e_date")
response.redirect "pp_non3x_excel.asp?"&param
end if%>

<%

set conntemp=server.createobject("adodb.connection")
conntemp.open "driver={microsoft odbc for oracle}; server=prod.world;dsn=prod;uid=nantob;pwd=capitals 12"
set cmdtemp = server.createobject("adodb.command")
set datacommand1 = server.createobject("adodb.recordset")

sqlstmt = "select fy, dodpe, sum_avail_pred, sum_total_pred, sum_avail_balance, "
sqlstmt = sqlstmt& " nvl(benchmark(fy, to_char(freeze_date,'MON'),'Cmt',substr(dodpe,1,4) )*100,0) benchmark, "
sqlstmt = sqlstmt& " sum_total_pred/sum_avail_pred * 100 percent_pred, "
sqlstmt = sqlstmt& " nvl(benchmark(fy, to_char(freeze_date,'MON'),'Cmt',substr(dodpe,1,4) )*100 - "
sqlstmt = sqlstmt& " (sum_total_pred/sum_avail_pred * 100),0) balance, freeze_date "
sqlstmt = sqlstmt& " from ("
sqlstmt = sqlstmt& " select fy, dodpe, nvl(sum(sum_avail_pred),0) sum_avail_pred, nvl(sum(sum_total_pred),0) sum_total_pred, "
sqlstmt = sqlstmt& " nvl(sum(sum_avail_balance),0) sum_avail_balance, max(freeze_date) freeze_date "
sqlstmt = sqlstmt& " from percent_pred_archive "
sqlstmt = sqlstmt& " where freeze_date = to_date('" & request("freeze_date")& "', 'mm-dd-yyyy hh:mi:ssam ') and "
sqlstmt = sqlstmt& " fy like '" & request("fy") & "' and "
sqlstmt = sqlstmt& " appn like '1319' and "
sqlstmt = sqlstmt& " trim(dept_exec_site) in ('31','32','33','34','35','36','4A','01FF','03A',' 00ST','03B','01PA','NSMA') and"
sqlstmt = sqlstmt& " dodpe not in ('0605861N','0603790N','0605502N') and "
sqlstmt = sqlstmt& " subhead not like 'W9%' and "
sqlstmt = sqlstmt& " substr(frc_title,1,3) <> '(c)' "
sqlstmt = sqlstmt& " group by fy, dodpe) "
sqlstmt = sqlstmt& " where sum_avail_pred <> 0 "

strsql_cy = "select nvl(p.notes,0) notes from percent_pred_notes_blackerby p where p.fy = " & request("fy") & " and p.type='PE' and p.freeze_date >= to_date('" & datevalue(request("freeze_date")) & "','mm/dd/yy')"

'response.write sqlstmt
'response.write strsql_cy
set datacommand1 = conntemp.execute(sqlstmt)
set datacommand2 = conntemp.execute(strsql_cy)
%>
<%if datacommand1.eof = false then%>
<%if request("excel") <> "yes" then%>
<table class="a" summary = "percent pr'ed data">

<tr>
<td><h4 class="h4_text">% PR'ed by PE's summed core - FY <%=request("fy")%></h4>
<br>
<p class="P_red"> data snapshot: <%=datacommand1("freeze_date")%></p></td>

    </tr>
    </table>
     <a href="all_pes_core_select.asp?Excel=Yes&fy=<%=requ est("fy")%>&freeze_date=<%=request.form("freeze_da te")%>" title"output to excel">output to excel</a>
         <p class=margin>

     <%else
     end if%>
     </p>
     <p>
    <a href="percent_pred_start.asp" title"back to start">back to start</a>
    <br>
    <br>
    <%if request.form("freeze_date") = "" and request("fy")= "" then%>
        <a href="tina_percent_br_core_select.asp?fy=<%=reques t.form("fy")%>&freeze_date=<%=request.form("freeze _date")%>" title"go to dept view">go to dept view</a>
        <%freeze = request.form("freeze_date")%>
    <%elseif request.form("freeze_date") <> "" and request("fy")= "" then%>
        <a href="tina_percent_br_core_select.asp?fy=<%=reques t("fy")%>&freeze_date=<%=request("freeze_date")% >" title"go to dept view">go to dept view</a>
        <%freeze = request.form("freeze_date")%>
    <%else%>
        <a href="tina_percent_br_core_select.asp?fy=<%=reques t("fy")%>&freeze_date=<%=request("freeze_date")% >" title"go to dept view">go to dept view</a>
        <%freeze = request.form("freeze_date")%>
    <%end if%>
    <br>
<p>

<table summary="All PEs Pred summary" cellpadding="5" cellspacing="1" border="0" align="center">
      <tr>
       <th id="header1" scope="col" >PE</th>
      <th id="header2" scope="col">AVAIL TO PR</th>
      <th id="header3" scope="col">TOTAL PRED</th>
      <th id="header4" scope="col">BALANCE</th>
      <th id="header5" scope="col">% PRED</th>
      <th id="header6" scope="col">BENCH %</th>
      <th id="header7" scope="col">UNDER %</th>
      </tr>

    <% do while not datacommand1.eof%>
    <% avail_total = avail_total + cdbl(datacommand1("sum_avail_pred"))
       pred_total = pred_total + cdbl(datacommand1("sum_total_pred"))
       avail_bal_total = avail_bal_total + cdbl(datacommand1("sum_avail_balance"))
      %>
            <tr>

    <td headers="header1" class="whiteleft"><%response.write datacommand1("dodpe")%>
</td>

    <td headers="header2" class="whiteright"><%response.write formatnumber(datacommand1("sum_avail_pred"),0)%>
</td>
    <td headers="header3" class="whiteright"><%response.write formatnumber(datacommand1("sum_total_pred"),0)%>
</td>
    <td headers="header4" class="whiteright"><%response.write formatnumber(datacommand1("sum_avail_balance"),0)% >
</td>
    <td headers="header5" class="whitecenter"><%response.write formatnumber(datacommand1("percent_pred"),1)%>
</td>
    <td headers="header6" class="whitecenter"><%response.write formatnumber(datacommand1("benchmark"),1)%>
</td>
    <td headers="header7" class="whitecenter">
    <%if cdbl(datacommand1("balance")) > 5 then%>
    <b><%response.write formatnumber(datacommand1("balance"),1)%></b>
    <%elseif cdbl(datacommand1("balance")) < 0 then%>
    <%response.write "0"%>
    <%else%>
    <%response.write formatnumber(datacommand1("balance"),1)%>
    <%end if%>
</td>
       </tr>

    <%datacommand1.movenext%>
<%loop%>
<tr>
<td headers="header1" class="whiteleft"><b>Totals:</b>
</td>

    <td headers="header2" class="whiteright"><b><%response.write formatnumber(avail_total,0)%></b>
</td>
    <td headers="header3" class="whiteright"><b><%response.write formatnumber(pred_total,0)%></b>
</td>
    <td headers="header4" class="whiteright"><b><%response.write formatnumber(avail_bal_total,0)%></b>
</td>
    <td headers="header5" class="whitecenter"><b><%response.write formatnumber((cdbl(pred_total)/cdbl(avail_total))*100,1)%></b>
</td>
    <td colspan=2 class="whitecenter">
</td>
</tr>
    </table>

    <br>
    <br>

  <h4 class="h4_text"> 08 notes:
    <br>
    <a href="edit_next_notes_pe.asp?fy=<%response.write request("fy")%>&freeze_date=<%response.write freeze%>">edit</a>
    <pre>
    <%
        if not datacommand2.eof then
            response.write datacommand2("notes")
        else
            response.write "no notes for this entry"
        end if
    %>
    </pre>
    <%else
   response.write "no data found"
   end if%>

    <%datacommand1.close
    datacommand2.close
    set datacommand1 = nothing
    set datacommand2 = nothing
    %>
    <%conntemp.close
    set conntemp = nothing%>

</h4>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="a" summary="page footer">
  <tr>
    <td width="10%" valign="top" >

      <IMG id=IMG1 height=33 alt ="logo" src="onrsmall.gif" width=71 >&nbsp;
    </td>
    <td width="100%" valign="top">

      <div align="left"><b>Author:</b> <A href="mailto:[email protected]">Smith</a><br >
        <b>Maintained By:</b> <A href="mailto:[email protected]">Webdesk</A><br >
        <b>Modified:</b>18 December 2003</div></td>
  </tr>
</table>
<map name="MapMap">
  <area shape="RECT" coords="147,58,203,70" href="#content" tabindex="1" alt="skip to main content - access key is K" title="skip to main content - access key is K" accesskey="k">
  <area shape="RECT" coords="4,5,141,75" href="/default.htm" tabindex="3" alt="Main Page - Access Key is H" title="Main Page - Access Key is H" accesskey="h">
</map>

</body>
</html>
 
Old March 17th, 2004, 12:34 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What I was referring to is the way your folders are marked a s Virtual Directories / applications at the IIS level.

Suppose you have this:

C: + <dir> Inetpub
    + <dir> wwwroot
        global.asa
        default.asp
      + <dir> YourApp
        global.asa
        default.asp
      + <dir> CopyOfYourApp


Suppose that YourApp is marked as a Virtual Directory (VD) in IIS. That means that that folder and its child folders all belong to the same application (share the same session and application state). This will become a problem if your global.asa stores important information in the Session_OnStart or Application_OnStart events. Even if CopyOfYourApp has those files, they won't fire because the folder isn't marked as an applicaton.

If you create a copy of YourApp, but don't mark it as a virtual directory, CopyOfYourApp will share session and application state with the wwwroot folder, not with YourApp.

You can see in IIS whether a folder is a VD by looking at its icon. If it has a box with a green arrow flying out, it's a VD.
If YourApp is a VD, but CopyOfYourApp isn't, open the Properties for CopyOfYourApp, and click the Create button on the Directory tab.

If that doesn't help, I am pretty much stumped about your problem. If you copied the entire folder, including style sheets etc, I can't see a reason why there should be a difference.


Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
The main Issue on Browse folder in Web application vishnu108mishra ASP.NET 2.0 Professional 1 December 18th, 2007 12:33 AM
App_Code folder shared on only 1 folder? rpeters83 ASP.NET 2.0 Professional 1 September 1st, 2006 10:53 PM
remove folder carelfrik Access VBA 1 December 7th, 2005 08:53 AM
Making a folder virtual folder on button click in CsharpHelp C# 0 October 26th, 2005 05:57 AM
images folder Lee jonesy Dreamweaver (all versions) 7 September 12th, 2004 01:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.