Solved

Changing an aspx file not to use a compiled dll

Posted on 2010-11-19
6
709 Views
Last Modified: 2012-05-10
Sorry in advance.  I am a newbie...

I have an aspx file fhe page I am working on (confirmorder.aspx) which was previously using a compiled DLL.

I dont have access to all the compiled code but I do have access to the aspx.vb file for this page. (confirmorder.aspx.vb).
So far II have basically removed the inherits and added an Assembly directive so it will use the compiled DLL which contains other variables used on the page.  

The developer who created the compiled DLL (who isnt available) told me to :
use this directive <%@ Assembly Name="BoxCommerce" %> below the @ Page directive, public partial class and inherits are not required and remove handles from page_load.

How can I force the aspx page to use the aspx.vb instead of the compiled VB please?
At present, the page throws an error because the value is stored in the aspx.vb file which isnt being read for some reason...?:
BC30451: Name 'basketSubTotal' is not declared.

Thanks
*********BEFORE, the top of the aspx page was:*********



<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/main.Master" CodeBehind="confirmorder.aspx.vb" Inherits="Test.confirmorder" EnableViewState="false" 

    title="Test - Confirm Order" %>



*********Now, I've changed the aspx page to read (at the top):*********



<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/main.Master" CodeBehind="confirmorder.aspx.vb" EnableViewState="false" 

    title="Test - Confirm Order" %>

<%@ Assembly Name="TestCommerce" %>    



*********BEFORE, the top of the aspx.vb file was:*********



Imports Dovetail.Realex.Realauth



Partial Public Class confirmorder

    Inherits System.Web.UI.Page

    Protected basketSubTotal As String = FormatNumber(0, 2)

    Protected total As String = FormatNumber(0, 2)

    Protected deliveryOption As String = ""

    Protected deliveryPrice2 As String = "0.00" 'additional delivery charges

    Protected deliveryPrice1 As String = "0.00" 'productshipping

    Private dtShopper As DataTable = Nothing

    Private orderID As Integer = 0



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load





*********I removed some of it so it read:*********



Imports Dovetail.Realex.Realauth



Partial Public Class confirmorder

    Inherits System.Web.UI.Page

    Protected basketSubTotal As String = FormatNumber(0, 2)

    Protected total As String = FormatNumber(0, 2)

    Protected deliveryOption As String = ""

    Protected deliveryPrice2 As String = "0.00" 'additional delivery charges

    Protected deliveryPrice1 As String = "0.00" 'productshipping

    Private dtShopper As DataTable = Nothing

    Private orderID As Integer = 0



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



Imports Dovetail.Realex.Realauth



    Protected basketSubTotal As String = FormatNumber(0, 2)

    Protected total As String = FormatNumber(0, 2)

    Protected deliveryOption As String = ""

    Protected deliveryPrice2 As String = "0.00" 'additional delivery charges

    Protected deliveryPrice1 As String = "0.00" 'productshipping

    Private dtShopper As DataTable = Nothing

    Private orderID As Integer = 0



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

Open in new window

0
Comment
Question by:tingleweb
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34174883
I believe you need something like:

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/main.Master" CodeBehind="confirmorder.aspx.vb" EnableViewState="false" CodeFile="confirmorder.aspx.vb" Inherits="class_name_goes_here" title="Test - Confirm Order" %>
 

0
 

Author Comment

by:tingleweb
ID: 34175024
Thanks Paul
My comments below...

At the moment, the error is :

Type 'DataTable' is not defined.
***********Should my aspx page now read at the top:***********



<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/main.Master" CodeFile="confirmorder.aspx.vb" Inherits="confirmorder" EnableViewState="false" title="Test - Confirm Order" %>

<%@ Assembly Name="TestCommerce" %> 



***********and my aspx.vb now read at the top:***********





Partial Public Class confirmorder

    Protected basketSubTotal As String = FormatNumber(0, 2)

    Protected total As String = FormatNumber(0, 2)

    Protected deliveryOption As String = ""

    Protected deliveryPrice2 As String = "0.00" 'additional delivery charges

    Protected deliveryPrice1 As String = "0.00" 'productshipping

    Private dtShopper As DataTable = Nothing

    Private orderID As Integer = 0



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

Open in new window

0
 

Author Comment

by:tingleweb
ID: 34175144
now it says


Compiler Error Message: BC30456: 'Title' is not a member of 'ASP.confirmorder_aspx'.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34175212
Remove the title value:

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/main.Master" CodeFile="confirmorder.aspx.vb" Inherits="confirmorder" EnableViewState="false" %>

As to the datatable, I can't comment because I don't see what it's referring to.  It must be something in the codebehind.
0
 

Author Comment

by:tingleweb
ID: 34175272
It now says

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

Source Error:

Line 1:  
Line 2:  Partial Public Class confirmorder
Line 3:      Protected basketSubTotal As String = FormatNumber(0, 2)
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 34175308
Try:

...
Partial Public Class confirmorder
  Inherits System.Web.UI.Page

  Protected basketSubTotal As String = FormatNumber(0, 2)
...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Class Library Dynamics For Connectstring Information 2 21
Duplicate a row 2 46
Asp.net mvc foreach 3 34
error on the asp.net page 1 33
AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

20 Experts available now in Live!

Get 1:1 Help Now