Hello,
I'm trying to make a single "page patch" to an existing ASP.NET website. All I want to do is comment-out some phone number validation code that I want the app to ignore, and recompile the dll to include this change. I've been told that one way this can be done is to "hotwire" the codebehind page by changing the this line of the .aspx page:
...so that "Codebehind=" reads "Src=", and so that the project name is stripped out of the inherits, so that "mywebsite.checkout_main" just reads "checkout_main". However, now I get a compilation error when I run the page with these changes:Code:<%@ Page Language="vb" AutoEventWireup="false" Codebehind="checkout_main.aspx.vb" Inherits="mywebsite.checkout_main"%>
Server Error in '/' Application.
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: BC30188: Declaration expected.
Source Error:
Line 5: Namespace mywebsite
Line 6:
***Line 7: Partial Class checkout_main *** [emphasis mine, this line was marked red by the error page]
Line 8: Inherits System.Web.UI.Page
Line 9: Protected WithEvents loginid As System.Web.UI.WebControls.TextBox
Here is the part of the codebehind page the error seems to be referencing:
When I change Src and Inherits back, things work ok, just not with the changes. I must be doing something very simple wrong... any advice would be greatly appreciated.Code:Imports System.Data.SqlClient Imports System.Web.Mail Namespace mywebsite Partial Class checkout_main Inherits System.Web.UI.Page Protected WithEvents loginid As System.Web.UI.WebControls.TextBox Protected WithEvents password As System.Web.UI.WebControls.TextBox Protected WithEvents password1 As System.Web.UI.WebControls.TextBox Protected WithEvents CompareFieldValidator1 As System.Web.UI.WebControls.CompareValidator Protected WithEvents hint_q As System.Web.UI.WebControls.DropDownList Protected WithEvents Hint_answeer As System.Web.UI.WebControls.TextBox Protected WithEvents Salutation As System.Web.UI.WebControls.DropDownList Dim myconnection As SqlConnection Dim mycommand As SqlCommand Dim chk_lib As New main() Dim retval As String Dim insertstr As String Dim b_addr As String Dim b_city1 As String Dim b_state1 As String Dim b_pn As String Dim ots As String


Reply With Quote
Bookmarks