Click here to Skip to main content
15,914,780 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: master pages Pin
Mark Greenwood10-Apr-07 17:53
Mark Greenwood10-Apr-07 17:53 
Questionconnecting to sql sever Pin
ciacia10-Apr-07 10:33
ciacia10-Apr-07 10:33 
AnswerRe: connecting to sql sever Pin
Quinten.Miller10-Apr-07 19:23
Quinten.Miller10-Apr-07 19:23 
QuestionPOSTING TO DIFFERENT PAGE Pin
MAGICIANMERLIN10-Apr-07 9:38
MAGICIANMERLIN10-Apr-07 9:38 
AnswerRe: POSTING TO DIFFERENT PAGE Pin
kubben10-Apr-07 12:10
kubben10-Apr-07 12:10 
QuestionCaching DataSet for lifetime of Webapp Pin
Cfer8310-Apr-07 8:49
Cfer8310-Apr-07 8:49 
AnswerRe: Caching DataSet for lifetime of Webapp Pin
kubben10-Apr-07 9:01
kubben10-Apr-07 9:01 
QuestionA question about altering VB Codebehind files Pin
Nostromo7710-Apr-07 8:40
Nostromo7710-Apr-07 8:40 
Hello,

I'm trying to make some minor changes to the validation code of a checkout page in an ASP.NET webapp. The original builder of the site stripped out the VB codebehind files, leaving just the .aspx files, .dll, and so on in the FTP site.

I have recently recieved from the site-builder all of the original source code, so now I don't have to try to decompile it in Reflector. I have dumped the original checkout_main.aspx.vb source file into the FTP site, and it shows up nested behind its respective .aspx page.

I have made the minor changes (just commenting out some validation code so it doesn't function), but the webpage doesn't seem to recognize the changes. "Building" the codebehind page fails, and several errors show up in VS2005: almost every "name" on the codebehind page is "not declared". Does this mean that the source page is referencing some other VB page that is missing, and therefore cannot compile into a new dll? Should I replace each and every sourcecode file into the FTP site before it can recompile with changes?

Thanks for any help. I have copied the code below, with my changes in strikethrough font.



Imports System.Data.SqlClient<br />
Imports System.Web.Mail<br />
<br />
<br />
Namespace petstorewebsite<br />
<br />
Partial Class checkout_main<br />
    Inherits System.Web.UI.Page<br />
    Protected WithEvents loginid As System.Web.UI.WebControls.TextBox<br />
    Protected WithEvents password As System.Web.UI.WebControls.TextBox<br />
    Protected WithEvents password1 As System.Web.UI.WebControls.TextBox<br />
    Protected WithEvents CompareFieldValidator1 As System.Web.UI.WebControls.CompareValidator<br />
    Protected WithEvents hint_q As System.Web.UI.WebControls.DropDownList<br />
    Protected WithEvents Hint_answeer As System.Web.UI.WebControls.TextBox<br />
    Protected WithEvents Salutation As System.Web.UI.WebControls.DropDownList<br />
    Dim myconnection As SqlConnection<br />
    Dim mycommand As SqlCommand<br />
    Dim chk_lib As New main()<br />
    Dim retval As String<br />
    Dim insertstr As String<br />
    Dim b_addr As String<br />
    Dim b_city1 As String<br />
    Dim b_state1 As String<br />
    Dim b_pn As String<br />
    Dim ots As String<br />
#Region " Web Form Designer Generated Code "<br />
<br />
    'This call is required by the Web Form Designer.<br />
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
<br />
    End Sub<br />
<br />
    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init<br />
        'CODEGEN: This method call is required by the Web Form Designer<br />
        'Do not modify it using the code editor.<br />
        InitializeComponent()<br />
    End Sub<br />
<br />
#End Region<br />
<br />
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        myconnection = New SqlConnection(ConfigurationSettings.AppSettings("DSN_PET"))<br />
        myconnection.Open()<br />
        Session("login_session") = Session.SessionID<br />
        If Session("user_name") = "" Then<br />
            user_name.Text = "Guest"<br />
            myprofile.Text = "| <a href=index.aspx class=styleclass>Login</a>"<br />
        Else<br />
            user_name.Text = Session("user_name")<br />
            If Session("login") = "Retailer" Then<br />
                myprofile.Text = "| <a href=edit_retailer_info.aspx class=styleclass>My Profile</a> | <a href=logout.aspx class=styleclass>Logout</a>"<br />
            ElseIf Session("login") = "International" Then<br />
                myprofile.Text = "| <a href=edit_interantional_info.aspx class=styleclass>My Profile</a> | <a href=logout.aspx class=styleclass>Logout</a>"<br />
<br />
            End If<br />
        End If<br />
        ' price1.Text = Session("price_pay")<br />
    End Sub<br />
    Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Unload<br />
        myconnection.Close()<br />
    End Sub<br />
<br />
    Private Sub submit_ag_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles submit_ag.Click<br />
        'If Trim(loginid.Text) = "" Then<br />
        '    message.Text = "Please Specify  Loginid"<br />
        '    message.Style("color") = "Red"<br />
        '    message.Font.Bold = True<br />
        '    Exit Sub<br />
        'End If<br />
        'If chk_lib.chksearch1(Trim(loginid.Text)) = False Then<br />
        '    message.Text = "loginid length should be 5 characters"<br />
        '    message.Style("color") = "Red"<br />
        '    message.Font.Bold = True<br />
        '    Exit Sub<br />
<br />
        'End If<br />
        'If Trim(password.Text) = "" Then<br />
        '    message.Text = "Please Specify Password"<br />
        '    message.Style("color") = "Red"<br />
        '    message.Font.Bold = True<br />
        '    Exit Sub<br />
        'End If<br />
        'If Trim(password1.Text) = "" Then<br />
        '    message.Text = "Please Re Entre Password"<br />
        '    message.Style("color") = "Red"<br />
        '    message.Font.Bold = True<br />
        '    Exit Sub<br />
        'End If<br />
<br />
        'If Trim(Hint_answeer.Text) = "" Then<br />
        '    message.Text = "Please Specify  Hint Answer"<br />
        '    message.Style("color") = "Red"<br />
        '    message.Font.Bold = True<br />
        '    Exit Sub<br />
        'End If<br />
        If Trim(fname.Text) = "" Then<br />
                message.Text = "Please specify  your name"<br />
            message.Style("color") = "Red"<br />
            message.Font.Bold = True<br />
            Exit Sub<br />
        End If<br />
        Session("fname_12") = fname.Text<br />
        If Trim(address.Text) = "" Then<br />
                message.Text = "Please specify your street address"<br />
            message.Style("color") = "Red"<br />
            message.Font.Bold = True<br />
            Exit Sub<br />
        End If<br />
        Session("address") = address.Text<br />
        If Trim(city.Text) = "" Then<br />
                message.Text = "Please specify your city"<br />
            message.Style("color") = "Red"<br />
            message.Font.Bold = True<br />
            Exit Sub<br />
        End If<br />
        Session("city") = city.Text<br />
        If Trim(pin.Text) = "" Then<br />
                message.Text = "Please specify your zip code"<br />
            message.Style("color") = "Red"<br />
            message.Font.Bold = True<br />
            Exit Sub<br />
        End If<br />
        Session("pin") = pin.Text<br />
        If Trim(phone.Text) = "" Then<br />
                message.Text = "Please specify your phone number"<br />
            message.Style("color") = "Red"<br />
            message.Font.Bold = True<br />
            Exit Sub<br />
        End If<br />
<br />
            If Trim(pin.Text) <> "" Then<br />
                If chk_lib.chknum(Trim(pin.Text)) = False Then<br />
                    message.Text = "Your zip code must be entered as a number (i.e. '01913')"<br />
                    message.Style("color") = "Red"<br />
                    message.Font.Bold = True<br />
                    Exit Sub<br />
                End If<br />
            End If<br />
<br />
            'If Trim(phone.Text) <> "" Then<br />
            'If chk_lib.chknum(Trim(phone.Text)) = False Then<br />
            'message.Text = "Phone must have numeric entry "<br />
            'message.Style("color") = "Red"<br />
            'message.Font.Bold = True<br />
            'Exit Sub<br />
            'End If<br />
            'End If<br />
            'If Trim(Phone_w_b.Text) <> "" Then<br />
            'If chk_lib.chknum(Trim(Phone_w_b.Text)) = False Then<br />
            'message.Text = "Phone must have numeric entry "<br />
            'message.Style("color") = "Red"<br />
            'message.Font.Bold = True<br />
            'Exit Sub<br />
            'End If<br />
            'End If<br />
            'If Trim(cell_no.Text) <> "" Then<br />
            'If chk_lib.chknum(Trim(cell_no.Text)) = False Then<br />
            'message.Text = "Cell No must have numeric entry "<br />
            'message.Style("color") = "Red"<br />
            'message.Font.Bold = True<br />
            'Exit Sub<br />
            'End If<br />
            'End If<br />
<br />
            If term.Checked = False Then<br />
<br />
                message.Text = "It is required that you read and accept our Terms & Conditions"<br />
                message.Style("color") = "Red"<br />
                message.Font.Bold = True<br />
                Exit Sub<br />
            End If<br />
<br />
<br />
            Dim country1 As String = "country"<br />
            Dim state1 As String = Replace(Trim(state.SelectedItem.Text), "'", "''")<br />
            Dim city1 As String = Replace(Trim(city.Text), "'", "''")<br />
            Dim b_country1 As String = "country1"<br />
            If b_state12.SelectedItem.Text <> "" Then<br />
                b_state1 = Replace(Trim(b_state12.SelectedItem.Text), "'", "''")<br />
            Else<br />
                b_state1 = ""<br />
            End If<br />
            If b_city.Text <> "" Then<br />
                b_city1 = Replace(Trim(b_city.Text), "'", "''")<br />
            Else<br />
                b_city1 = ""<br />
            End If<br />
            Dim fnm As String = Replace(Trim(fname.Text), "'", "''")<br />
<br />
            Dim addr As String = Replace(Replace(Trim(address.Text), "'", "''"), vbCrLf, "<br>")<br />
            If b_address.Text <> "" Then<br />
                b_addr = Replace(Replace(Trim(b_address.Text), "'", "''"), vbCrLf, "<br>")<br />
            Else<br />
                b_addr = ""<br />
            End If<br />
            Dim pn As String = Replace(Trim(pin.Text), "'", "''")<br />
            If b_pin.Text <> "" Then<br />
                b_pn = Replace(Trim(b_pin.Text), "'", "''")<br />
            Else<br />
                b_pn = ""<br />
            End If<br />
            Dim tl As String = "t1"<br />
            Dim mob As String = "mob"<br />
            Dim eml As String<br />
            Dim gu As String = "w"<br />
            Dim promotional1 As String<br />
            If promotional.Checked = True Then<br />
                promotional1 = "Y"<br />
            Else<br />
                promotional1 = "N"<br />
            End If<br />
            If Trim(email.Text) = "" Then<br />
                message.Text = "Please Specify Email Address"<br />
                message.Style("color") = "Red"<br />
                message.Font.Bold = True<br />
                Exit Sub<br />
            End If<br />
<br />
<br />
            If chk_lib.chk_email(Trim(email.Text)) = False Then<br />
                message.Text = "Please correct the format of your email address (i.e. 'jane@mailserver.com')"<br />
                message.Style("color") = "Red"<br />
                message.Font.Bold = True<br />
                Exit Sub<br />
            Else<br />
                eml = Replace(Trim(email.Text), "'", "''")<br />
            End If<br />
            Session("email_id_user") = eml<br />
            If state.SelectedItem.Text <> "Select State in the U.S" Then<br />
                ots = ""<br />
<br />
            Else<br />
                If state.SelectedItem.Text = "Select State in the U.S" Then<br />
                    state1 = "Other"<br />
                    ots = Replace(Trim(other_st.Text), "'", "''")<br />
                    Session("other_st") = ots<br />
                End If<br />
            End If<br />
<br />
            'If state.SelectedItem.Text = "Select State in the U.S" Then<br />
            '    If Trim(b_firstname.Text) = "" Then<br />
            '        message.Text = "Please Specify Delivery Addrss Name"<br />
            '        message.Style("color") = "Red"<br />
            '        message.Font.Bold = True<br />
            '        Exit Sub<br />
            '    End If<br />
            '    If Trim(b_lastname.Text) = "" Then<br />
            '        message.Text = "Please Specify Delivery Addrss Last Name"<br />
            '        message.Style("color") = "Red"<br />
            '        message.Font.Bold = True<br />
            '        Exit Sub<br />
            '    End If<br />
            '    If Trim(b_address.Text) = "" Then<br />
            '        message.Text = "Please Specify Delivery Addrss "<br />
            '        message.Style("color") = "Red"<br />
            '        message.Font.Bold = True<br />
            '        Exit Sub<br />
            '    End If<br />
            '    If Trim(b_emailid.Text) = "" Then<br />
            '        message.Text = "Please Specify Delivery Addrss Email Id "<br />
            '        message.Style("color") = "Red"<br />
            '        message.Font.Bold = True<br />
            '        Exit Sub<br />
            '    End If<br />
            '    If Trim(b_phone.Text) = "" Then<br />
            '        message.Text = "Please Specify Delivery Addrss Phone Number "<br />
            '        message.Style("color") = "Red"<br />
            '        message.Font.Bold = True<br />
            '        Exit Sub<br />
            '    End If<br />
            '    If Trim(b_city.Text) = "" Then<br />
            '        message.Text = "Please Specify Delivery Addrss city Name "<br />
            '        message.Style("color") = "Red"<br />
            '        message.Font.Bold = True<br />
            '        Exit Sub<br />
            '    End If<br />
            'End If<br />
            Session("state_belongs") = state.SelectedItem.Text<br />
            Session("country") = Country123.SelectedItem.Text<br />
            Replace(Trim(b_emailid.Text), "'", "''")<br />
            Dim st As Integer = 1<br />
            insertstr = "insert into customer_detail (name,email_id,address,city,state,zip,b_address,b_city,b_state,b_zip,phone_no_home,phone_no_work_bus,mobile_no,status,date_of,amount,payment_status,promotional,lname,country,other_state,b_fname,b_lastname,b_phone,b_email,workorbusiness,session_id) values('"<br />
            insertstr = insertstr & fnm & "','" & eml & "','" & addr & "','" & city1 & "','" & state1 & "','" & pn & "','" & b_addr & "','" & b_city1 & "','" & b_state1 & "','" & b_pn & "','" & phone.Text & "','" & Phone_w_b.Text & "','" & cell_no.Text & "'," & st & ",'" & Now().Date & "','0','0','" & promotional1 & "','" & Replace(Trim(Lname.Text), "'", "''") & "','" & Country123.SelectedItem.Text & "','" & ots & "','" & Replace(Trim(b_firstname.Text), "'", "''") & "','" & Replace(Trim(b_lastname.Text), "'", "''") & "','" & Replace(Trim(b_phone.Text), "'", "''") & "','" & Replace(Trim(b_emailid.Text), "'", "''") & "','0','" & Session("login_session") & "')"<br />
            mycommand = New SqlCommand(insertstr, myconnection)<br />
            mycommand.ExecuteNonQuery()<br />
<br />
            insertstr = "delete from shoppingcarts where date_of< '" & Now().Date.ToShortDateString & " '"<br />
            mycommand = New SqlCommand(insertstr, myconnection)<br />
            mycommand.ExecuteNonQuery()<br />
            ''''''''''''''''''''''''''''''option_of_product_buying<br />
            ' Response.Redirect("creditcard_detail.aspx")<br />
            Response.Redirect("option_of_product_buying.aspx")<br />
        End Sub<br />
<br />
<br />
<br />
End Class<br />
<br />
End Namespace

AnswerRe: A question about altering VB Codebehind files Pin
Sathesh Sakthivel10-Apr-07 17:04
Sathesh Sakthivel10-Apr-07 17:04 
GeneralRe: A question about altering VB Codebehind files Pin
Nostromo7710-Apr-07 20:34
Nostromo7710-Apr-07 20:34 
QuestionSalam , Where roles are saved ? Pin
Mohammed Amine10-Apr-07 8:28
Mohammed Amine10-Apr-07 8:28 
AnswerRe: Salam , Where roles are saved ? Pin
Abolfazl Sheikhloo10-Apr-07 20:11
Abolfazl Sheikhloo10-Apr-07 20:11 
AnswerRe: Salam , Where roles are saved ? Pin
MinhajuddinK5-May-07 20:02
MinhajuddinK5-May-07 20:02 
QuestionSimple cast error Pin
Sam Heller10-Apr-07 5:04
Sam Heller10-Apr-07 5:04 
AnswerRe: Simple cast error Pin
Sam Heller10-Apr-07 5:08
Sam Heller10-Apr-07 5:08 
GeneralRe: Simple cast error Pin
badgrs10-Apr-07 5:30
badgrs10-Apr-07 5:30 
QuestionWebResource Pin
reza toorani10-Apr-07 4:19
reza toorani10-Apr-07 4:19 
Questionfileuploader control + asp.net 2.0 Pin
ritu432110-Apr-07 3:22
ritu432110-Apr-07 3:22 
AnswerRe: fileuploader control + asp.net 2.0 Pin
varshavmane10-Apr-07 3:30
varshavmane10-Apr-07 3:30 
QuestionHow to write C# code in VB Pin
varshavmane10-Apr-07 3:19
varshavmane10-Apr-07 3:19 
AnswerRe: How to write C# code in VB Pin
kubben10-Apr-07 5:36
kubben10-Apr-07 5:36 
AnswerRe: How to write C# code in VB Pin
Dave Doknjas10-Apr-07 18:08
Dave Doknjas10-Apr-07 18:08 
GeneralRe: How to write C# code in VB Pin
varshavmane10-Apr-07 18:19
varshavmane10-Apr-07 18:19 
QuestionMaintain value across postbacks ? Pin
digsy_10-Apr-07 2:50
digsy_10-Apr-07 2:50 
AnswerRe: Maintain value across postbacks ? Pin
varshavmane10-Apr-07 3:03
varshavmane10-Apr-07 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.