Solved

copied ASP.net project giving is not declared errors everywhere

Posted on 2010-08-24
14
342 Views
Last Modified: 2013-11-07
Please bear with me; I’m a generalist and not a web developer. I have to enhance ASPX code that I didn’t write and  know nothing about… of course the developer is no longer her and there are no comments whatsoever.
I copied over the entire project from the server, brought the project into VS 2008 and the main problem is everything is not declare, event the functions in the VB files. I added System.Web.Extensions to my reference it helped some. I just have no clue as to why every label and function is undeclared in the aspx.vb files.

Here’s one of the ASPX page :
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="RAList.aspx.vb" Inherits=".RAList" MasterPageFile="~/RA.Master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH" runat="Server">

    <script type="text/javascript">
    function ChangeBlurColor(Field) {
        var i1 = window.document.getElementById(Field);
        i1.style.backgroundColor = "FFFFFF";
    }
    function ChangeAltBlurColor(Field) {
        var i1 = window.document.getElementById(Field);
        i1.style.backgroundColor = "FFFF99";
    }
</script>

    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <div>
                <asp:Table ID="tblNav" runat="server" style="width: 7.65in">
                    <asp:TableRow>
                        <asp:TableCell HorizontalAlign="Center">
                            <a href="../cfm_Members/pg_login.cfm?">Logout</a> &nbsp;&nbsp;
                            <a href="javascript:OpenSiteMap()">Site Map</a> &nbsp;&nbsp;
                            <a href="../cfm_Members/pg_Home.cfm?">Home</a> &nbsp;&nbsp;
                            <asp:HyperLink ID="HyperLink1" NavigateUrl="javascript:OpenListHelp()" runat="server">Help</asp:HyperLink>
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
                <table style="width: 7.65in; height: 1px;">
                    <tr>
                        <td align="center">
                            <asp:Label ID="lblTitle" runat="server" Font-Bold="True" Font-Size="Large" Text="Return Authorization Requests"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:GridView ID="grdHeader" runat="server" AllowPaging="True"
                                AutoGenerateColumns="False" AutoGenerateSelectButton="True"
                                BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
                                CellPadding="2" ForeColor="Black" PagerSettings-Mode="NumericFirstLast"
                                PageSize="5">
                                <PagerSettings Mode="NumericFirstLast" />
                                <FooterStyle BackColor="Tan" />
                                <Columns>
                                    <asp:BoundField DataField="ReturnAuthorizationHeaderUID" HeaderText=""
                                        ShowHeader="False">
                                        <ControlStyle Width="0px" />
                                        <FooterStyle Width="0px" />
                                        <HeaderStyle Width="0px" />
                                        <ItemStyle Width="0px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="RANumber" HeaderText="RA Number" />
                                    <asp:BoundField DataField="RADate" HeaderText="RA Date" />
                                </Columns>
                                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
                                    HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#CC9900" ForeColor="GhostWhite" />
                                <HeaderStyle BackColor="Tan" Font-Bold="True" />
                                <AlternatingRowStyle BackColor="PaleGoldenrod" />
                            </asp:GridView>
                            <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Large" Text="List of current RA's"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            &nbsp;</td>
                    </tr>
                </table>
                <table style="width: 7.65in">
                    <tr>
                        <td align="center">
                            <asp:GridView ID="grdDetail" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan"
                                BorderWidth="1px" CellPadding="2" ForeColor="Black" AllowPaging="True" AutoGenerateColumns="False">
                                <FooterStyle BackColor="Tan" />
                                <Columns>
                                    <asp:BoundField DataField="SerialNumber" HeaderText="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serial #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        ReadOnly="True">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ItemNumber" HeaderText="&nbsp;&nbsp;&nbsp;Item #&nbsp;&nbsp;&nbsp;"
                                        ReadOnly="True">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Brand" HeaderText="Brand" ReadOnly="True">
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Model" HeaderText="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Model&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        ReadOnly="True">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                    </asp:BoundField>
                                </Columns>
                                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#CC9900" ForeColor="GhostWhite" />
                                <HeaderStyle BackColor="Tan" Font-Bold="True" />
                                <AlternatingRowStyle BackColor="PaleGoldenrod" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
                <table style="width: 7.76in">
                    <tr>
                        <td align="center">
                            <asp:Label ID="lblErrorMessage" runat="server" Text="Error Message" CssClass="ErrorMessage"
                                Height=".20in"></asp:Label>
                        </td>
                    </tr>
                </table>
                <table style="width: 7.65in">
                    <tr style="padding: 0px; margin: 0px">
                        <td align="center">
                            <asp:RadioButton ID="optAll" runat="server" AutoPostBack="True" Text="All RA's" GroupName="RAOptions"
                                Checked="True" />
                            <asp:RadioButton ID="optGood" runat="server" AutoPostBack="True" Text="Current Stocked Only"
                                GroupName="RAOptions" />
                            <asp:RadioButton ID="optDamaged" runat="server" AutoPostBack="True" Text="Damaged/Defective Only"
                                GroupName="RAOptions" />
                            <asp:RadioButton ID="optNonStocked" runat="server" AutoPostBack="True" Text="Special Order Only"
                                GroupName="RAOptions" />
                            <asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" Text="A/C Only"
                                GroupName="RAOptions" />                                
                        </td>
                    </tr>
                </table>
                <table style="width: 7.76in">
                    <tr style="padding: 0px; margin: 0px">
                        <td id="tdValidate" align="center" style="padding: 0px; margin: 0px">
                            <asp:Button ID="btnView" runat="server" BackColor="#FFCC66" Text="View Selected RA"
                                Width="350px" />
                        </td>
                    </tr>
                    <tr style="padding: 0px; margin: 0px">
                        <td align="center" style="padding: 0px; margin: 0px">
                            <asp:Button ID="btnGood" runat="server" BackColor="#FFCC66" Text="Create A Current Stock Models RA"
                                 Width="350px" />
                        </td>
                    </tr>
                    <tr style="padding: 0px; margin: 0px">
                        <td align="center" style="padding: 0px; margin: 0px">
                            <asp:Button ID="btnDamaged" runat="server" BackColor="#FFCC66" Text="Create A Damaged Defective Items DRA"
                                 Width="350px" />
                        </td>
                    </tr>
                    <tr style="padding: 0px; margin: 0px">
                        <td align="center" style="padding: 0px; margin: 0px">
                            <asp:Button ID="btnNonStock" runat="server" BackColor="#FFCC66" Text="Create A Non-WHSE Stocked Special Order Items NRA"
                                 Width="350px" />
                        </td>
                    </tr>
                    <tr style="padding: 0px; margin: 0px">
                        <td align="center" style="padding: 0px; margin: 0px">
                            <asp:Button ID="Button1" runat="server" BackColor="#FFCC66" Text="Create A/C CRA"
                                 Width="350px"  />
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

----------------------------------------------------------------------
Here’s the top of one of my  aspx.VB page
Option Explicit On
Option Strict On

Imports System.Data.SqlClient
Imports System.data
Imports System



Partial Public Class RAList

    Inherits System.Web.UI.Page
----------------------------------------------------------------------


Do I need another reference for this project? What am I missing…any ideas anyone?

Thanks
CJ
0
Comment
Question by:cin_champ
  • 7
  • 6
14 Comments
 
LVL 9

Expert Comment

by:wellhole
Comment Utility
Build the website. Turn off the warnings. Read the errors. Whatever references are being complained about, reference it. For example, this page requires the ajaxcontroltoolkit and the system.web.extensions references. The former is hopefully included in your project files as a dll binary. Otherwise, you have to google and download it.
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
Comment Utility
make sure you copy the whole projects
also make sure .net framework is installed on ur machine
and re build the solution
0
 

Author Comment

by:cin_champ
Comment Utility
Thanks to you both for you responses, but I'm still getting 147 errors. I've attached them in an xlsl file.

King2002,
Which  version of Framework should I have? and what exactly do I need to check? the machine I have is not the developer's machine...

Thanks
Cin
ASPneterrors.xlsx
0
 
LVL 9

Expert Comment

by:wellhole
Comment Utility
Your file type is too modern. I can't read it.
0
 

Author Comment

by:cin_champ
Comment Utility
PS: you can download a compatibility pack from Microsoft. But here's a .xls file
ASPneterrors.xls
0
 
LVL 9

Expert Comment

by:wellhole
Comment Utility
Absolutely, I can. I just don't want to. More software = more files = more registry = more slower.

See error #4 - Reference to a non-shared member requires an object reference.

Click it and see what that's about and add the necessary reference to your project. Recompile and do the next one.
0
 

Author Comment

by:cin_champ
Comment Utility
wellhole,

The error is on this line:
        ScriptManager.SetFocus("ctl00_CPH_txtItem1")

I'm searching online but have not found what to add to my project to get this to work...
Any idea?

Thanks
Cin
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:wellhole
Comment Utility
ScriptManager belongs to AjaxControlToolkit. I know my very first post asks you to reference that.
0
 
LVL 9

Expert Comment

by:wellhole
Comment Utility
Sorry, I could be wrong. Likely you have to reference something along the lines of System.Web, System.Web.UI, System.Web.Extensions.
0
 

Author Comment

by:cin_champ
Comment Utility
Wellhole,

In the project I added System.web. Still not working...

Yes I do I have AjaxControlToolkit.dll and AjaxControlToolkit.pdb. But do I  need to do anything else? Like register the dll or something?

I dont have System.Web.UI under references, could this be my problem?

Thanks Again
Cin
0
 

Author Comment

by:cin_champ
Comment Utility
Dear Experts,
On my machine I have :
Microsoft.NET\Framework\v2.0.50727

If I look in 'add remove programs' I have:
Microsoft net compact framework 2  SP2
Microsoft net compact framework 3.5
Microsoft net Framework 1.1
Microsoft net Framework 2.0 Service pack 2
Microsoft net Framework 3.0 Service pack 2
Microsoft net Framework 3.3 Service pack 1
Microsoft ASP.net  2.0 Ajax extensions 1.0

Am I missing some software? service pack?
Thanks
Cin

0
 

Author Comment

by:cin_champ
Comment Utility
Wellhole,

Got somewhere finally today. Started from scratch and downloaded an older Ajaxt tool kit and added the 2 references for System.Web.Extensions and System.Web.Extensions.Design. Got rid of most of my errors.

Just need a little more help with one more thing, there's a VB class (DataLayer) who's functions are used in almost every module, the project is not recongnizing them (no intellisense) . The file is in the folder do I need to do anything to get the functions  to be recongnize inside my project?  

PS: Just to remind you I copied the folder from the Live server and am trying to get it to run on my own machine to make some changes....

Thanks
Cin
0
 
LVL 9

Accepted Solution

by:
wellhole earned 250 total points
Comment Utility
Typically, to add a class to a .net web project you put the .vb file in the App_Code folder, hit refresh in the solution explorer, right click the file, select include in project, and rebuild the website.

Classes in the App_Code folder are accessible from any page on the website.
0
 

Author Closing Comment

by:cin_champ
Comment Utility
Wellhole,

I was finally able to build the site  I had to exclude the 2 web pages where I'm getting over 200 errors and will try to figure out what's wrong with those 2 pages tomorrow.

Thank You for your help!
Cin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now