[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1770
  • Last Modified:

BC30451: Name 'Response' is not declared??

What in the world is going on?  I published my website in VS2005, and now all of a sudden I get this error:

BC30451: Name 'Response' is not declared

Where Response is the beginning of a line... Response.write("...").  Works fine if I just run the site on my local server uncompiled.

Thanks!
0
mvarner2000
Asked:
mvarner2000
  • 6
  • 4
1 Solution
 
REA_ANDREWCommented:
what language are you designing in?
0
 
REA_ANDREWCommented:
also what are you desgning in ? a class? a .cs code behind file, an inline page script block?
0
 
mvarner2000Author Commented:
Writing in VB.NET.

The particular line I'm receiving the error on is part of a .master page that is fairly basic.  There is no code behind page to it.

Dim RandomClass As New Random()
Dim RandomNumber As Integer
RandomNumber = RandomClass.Next(1, 6)
Response.Write(RandomNumber & ".jpg")

Bottom line is the error.  The rest of the page is static except for two ContentPlaceHolders.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
REA_ANDREWCommented:
are you including the assembly System.Web ?
0
 
mvarner2000Author Commented:
Yep.  I've included all of the following:

imports System
imports System.Configuration
imports System.Collections
imports System.Collections.Generic
imports System.Data
imports System.Data.SqlClient
imports System.IO
imports System.Web
imports System.Web.Security
imports System.Web.UI
imports System.Web.UI.WebControls
imports System.Web.UI.WebControls.WebParts
imports System.Web.UI.HtmlControls
0
 
REA_ANDREWCommented:
does the script work with a database or external data source? if not paste the whole code so I can test the whole thing for you
0
 
mvarner2000Author Commented:
<%@ import "System" %>
<%@ import "System.Configuration" %>
<%@ import "System.Collections" %>
<%@ import "System.Collections.Generic" %>
<%@ import "System.Data" %>
<%@ import "System.Data.SqlClient" %>
<%@ import "System.IO" %>
<%@ import "System.Web" %>
<%@ import "System.Web.Security" %>
<%@ import "System.Web.UI" %>
<%@ import "System.Web.UI.WebControls" %>
<%@ import "System.Web.UI.WebControls.WebParts" %>
<%@ import "System.Web.UI.HtmlControls" %>
<%@ Master Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
      <title>WORKING</title>
      <link rel="stylesheet" href="css/css.css" type="text/css" />      
      <script type="text/javascript" src="scripts/menu.js"></script>
      <script type="text/javascript" src="scripts/menus.js"></script>
</head>
<body>
<div id="container">
    <%
        Dim RandomClass As New Random()
        Dim RandomNumber As Integer
        RandomNumber = RandomClass.Next(1, 6)
        Response.Write("<img src=""images/mainlogo" & RandomNumber & ".jpg"" alt=""Football Friday Nights"" id=""mainLogo"" />")
    %>
      
      <div id="menu">
            <div style="float:right">
                <div class="tab0" onclick="location.href='index.aspx';">
                        <strong style="border-bottom:solid 1px #ff6000">Home</strong>
                  </div>
                  <div class="tab1" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu1, '125px')" onmouseout="delayhidemenu()">
                        <strong style="border-bottom:solid 1px #ff6000">Big South</strong>
                  </div>
                  <div class="tab2" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu2, '152px')" onmouseout="delayhidemenu()">
                        <strong style="border-bottom:solid 1px #ff6000">Southern Piedmont</strong>
                  </div>
                  <div class="tab3" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu3, '125px')" onmouseout="delayhidemenu()">
                        <strong style="border-bottom:solid 1px #ff6000">Indy NCHSAA</strong>
                  </div>
                  <div class="tab4" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu4, '125px')" onmouseout="delayhidemenu()">
                        <strong style="border-bottom:solid 1px #ff6000">Features</strong>
                  </div>
                  <div class="tab5"><a href="http://www.gastongazette.com" style="border-bottom:solid 1px #ff6000;color:white;font-weight:bold">The Gaston Gazette</a></div>
                  <div class="clear"> </div>
            </div>
      </div>

      <div class="clear"> </div>
      
      <div id="content">
            <form id="Form1" runat="server">
            <div style="float:left;width:170px;margin-left:5px">
                  <asp:contentplaceholder id="pc1" runat="server">
                  </asp:contentplaceholder>
            </div>
                  
            <div style="float:left;width:730px;margin-left:10px;padding-left:10px;border-left:solid 1px #dddddd">
                  <asp:contentplaceholder id="pc2" runat="server">
                  </asp:contentplaceholder>
            </div>
            </form>            
      </div>

      <div class="clear"> </div>

      <div id="footer" style="margin-top:10px;padding-bottom:20px">
            <div style="text-align:center;font-size:.9em;font-family:arial">
                  <a href="http://www.gastongazette.com">The Gaston Gazette</a> | <a href="http://www.shelbystar.com">The Shelby Star</a> | <a href="">Privacy Policy</a> | <a href="mailto:webfeedback@link.freedom.com">Contact Us</a>
            </div>
            <div style="text-align:center;font-size:.9em;font-family:arial">
                  Site Design by <a href="mailto:zak_keown@link.freedom.com">Zak Keown</a> at <a href="http://www.gastongazette.com">The Gaston Gazette</a>
            </div>
      </div>
</div>
</body>
</html>
0
 
REA_ANDREWCommented:
this works now

<%@ Master Language="VB" %>

<%@ import Namespace = "System" %>
<%@ import Namespace = "System.Configuration" %>
<%@ import Namespace = "System.Collections" %>
<%@ import Namespace = "System.Collections.Generic" %>
<%@ import Namespace = "System.Data" %>
<%@ import Namespace = "System.Data.SqlClient" %>
<%@ import Namespace = "System.IO" %>
<%@ import Namespace = "System.Web" %>
<%@ import Namespace = "System.Web.Security" %>
<%@ import Namespace = "System.Web.UI" %>
<%@ import Namespace = "System.Web.UI.WebControls" %>
<%@ import Namespace = "System.Web.UI.WebControls.WebParts" %>
<%@ import Namespace = "System.Web.UI.HtmlControls" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
     <title>WORKING</title>
     <link rel="stylesheet" href="css/css.css" type="text/css" />    
     <script type="text/javascript" src="scripts/menu.js"></script>
     <script type="text/javascript" src="scripts/menus.js"></script>
</head>
<body>
<div id="container">
    <%
        Dim RandomClass As New Random()
        Dim RandomNumber As Integer
        RandomNumber = RandomClass.Next(1, 6)
        Response.Write("<img src=""images/mainlogo" & RandomNumber & ".jpg"" alt=""Football Friday Nights"" id=""mainLogo"" />")
    %>
     
     <div id="menu">
          <div style="float:right">
              <div class="tab0" onclick="location.href='index.aspx';">
                    <strong style="border-bottom:solid 1px #ff6000">Home</strong>
               </div>
               <div class="tab1" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu1, '125px')" onmouseout="delayhidemenu()">
                    <strong style="border-bottom:solid 1px #ff6000">Big South</strong>
               </div>
               <div class="tab2" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu2, '152px')" onmouseout="delayhidemenu()">
                    <strong style="border-bottom:solid 1px #ff6000">Southern Piedmont</strong>
               </div>
               <div class="tab3" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu3, '125px')" onmouseout="delayhidemenu()">
                    <strong style="border-bottom:solid 1px #ff6000">Indy NCHSAA</strong>
               </div>
               <div class="tab4" onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu4, '125px')" onmouseout="delayhidemenu()">
                    <strong style="border-bottom:solid 1px #ff6000">Features</strong>
               </div>
               <div class="tab5"><a href="http://www.gastongazette.com" style="border-bottom:solid 1px #ff6000;color:white;font-weight:bold">The Gaston Gazette</a></div>
               <div class="clear"> </div>
          </div>
     </div>

     <div class="clear"> </div>
     
     <div id="content">
          <form id="Form1" runat="server">
          <div style="float:left;width:170px;margin-left:5px">
               <asp:contentplaceholder id="pc1" runat="server">
               </asp:contentplaceholder>
          </div>
               
          <div style="float:left;width:730px;margin-left:10px;padding-left:10px;border-left:solid 1px #dddddd">
               <asp:contentplaceholder id="pc2" runat="server">
               </asp:contentplaceholder>
          </div>
          </form>          
     </div>

     <div class="clear"> </div>

     <div id="footer" style="margin-top:10px;padding-bottom:20px">
          <div style="text-align:center;font-size:.9em;font-family:arial">
               <a href="http://www.gastongazette.com">The Gaston Gazette</a> | <a href="http://www.shelbystar.com">The Shelby Star</a> | <a href="">Privacy Policy</a> | <a href="mailto:webfeedback@link.freedom.com">Contact Us</a>
          </div>
          <div style="text-align:center;font-size:.9em;font-family:arial">
               Site Design by <a href="mailto:zak_keown@link.freedom.com">Zak Keown</a> at <a href="http://www.gastongazette.com">The Gaston Gazette</a>
          </div>
     </div>
</div>
</body>
</html>
0
 
REA_ANDREWCommented:
did it work for you?
0
 
mvarner2000Author Commented:
It moved me on to another error, but yeah.  I don't know why, but yeah.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now