Solved

Urgent: Need help modifying existing webform in VB, with additional new code provided in C# by vendor

Posted on 2006-06-16
7
379 Views
Last Modified: 2010-05-18
Hi All,

First, I am NOT a programmer by nature, but find myself in a situation where I need to modify an existing webform (hosted on our server) by next week that a previous programmer wrote. It is in VB. It may not be the best written code, but I have to use what I was given.  We are modifiying it so that it will call a script from a 3rd party vendor we work with to automatically create a helpdesk ticket in the vendors web-based application. The form now when filled out on the intranet site submits emails to the helpdesk, then they read it and add the info into a web based helpdesk app manually.  We are trying to get the form, when submitted, to run a script at the helpdesk app's server, which will take some visible & some hidden fields, create a new ticket and populate the data.

I am providing the original code, and the code & instructions the vendor gave me to add into the form.. He says that it is in C#, and that I may need to translate it to VB - and I am pretty much clueless on this one.  If anyone can help, I would greatly appreciate it.  

If I have inadvertently left out any important info, pls. let me know...

Thanks in advance for your consideration..

Below this line are the instructions from the vendor and then below that, the orig. code.

~~~~~~~~~INSTRUCTIONS FROM VENDOR BELOW~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Everything else looks good. Looks like you have all of the necessary hidden fields. You *might* need to add the attribute "runat=server" to each hidden field. I am not sure if that will be required or not. Testing will tell.
 
Upon submitting the form, you will need to direct the form to: http://[PATH]/wbSubmission.cfm. This is then where I take over and do everything I need to do.

Here is what you need to do to submit the form and pass the form variables to me:
 
**************************************************************************
private void Page_Load(object sender, System.EventArgs e)
{
 //write out Javascript block
 string scriptString = "<script language='javascript'>function postData(){ document.forms[0].action='http://[PATH]/wbSubmission.cfm'; document.forms[0].submit(); }  </script>";
 
 //register Javascript
 if(!this.IsClientScriptBlockRegistered("myJavascriptCode"))
 {
  this.RegisterClientScriptBlock("myJavascriptCode", scriptString);
 }

 //Assign Submit button to call Javascript
 Button1.Attributes["onclick"] = "javascript:postData();";
}
****************************************************************************
 
STEPS TO TAKE:
1. Copy of all the code into your Page_Load method.
2. Change "Button1" in the line that says " Button1.Attributes["onclick"] = "javascript:postData();";" to the name of your submit button.
3. Remove (comment out) your existing "Sub Button1_Click" method in your code. It is no longer needed.
4. The above syntax is for C#. I see your code is in VB, which I am not as familiar with. You might need to translate some of the syntax for VB.

*****************ORIG CODE BELOW***********************************************************

<%@ Page Language="VB" smartnavigation="true" %>
<script runat="server">
 
    Sub Button1_Click(sender As Object, e As EventArgs)
   
   
    if Session("Sentbool") = "true" then
   
    response.redirect("confirmation.aspx?msg=Your request has been sent already. If you do not receive a ticket number within 24 hours, please contact the helpdesk at [HELPDESK EMAIL HERE] or Dialcomm *[numbers here]")
   
    else
   
    Try
   
    ' Build a MailMessage
    Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
    Dim orderstring As String
   
    'Body of email is built here
    orderstring = "Agent, " & "<br>"
    orderstring = orderstring & "This is a automated generated request for a [COMPANY HERE] Blackberry order, Do not reply back to this e-mail." & "<br>"
    orderstring = orderstring & "<b>Date Submitted:</b>" & Now() & "<br>"
    orderstring = orderstring & "<hr>" & "<br><br><br>"
   
    orderstring = orderstring & "<b>First Name:</b>" & TxtBxFirstName.text & "<br>"
    orderstring = orderstring & "<b>Last Name:</b>" & TxtBxLastName.text & "<br>"
    orderstring = orderstring & "<b>E-mail:</b>" & TxtBxEmail.text & "<br>"
    orderstring = orderstring & "<b>Telephone#:</b>" & TxtBxphone.text & "<br>"
    orderstring = orderstring & "<b>SSO#:</b>" & TxtBxSSO.text & "<br>"
    orderstring = orderstring & "<b>Site Location:</b>" & TxtBxSite.text & "<br>"
   
    orderstring = orderstring & "<hr>" & "<br>"
   
    orderstring = orderstring & "<b>Submitted By:</b>" & TxtBxSubByName.text & "<br>"
    orderstring = orderstring & "<b>Submitters Email:</b>" & TxtBxSubByEmail.text & "<br>"
    orderstring = orderstring & "<b>Submitters Phone:</b>" & TxtBxSubByPhone.text & "<br>"
    orderstring = orderstring & "<b>Submitters SSO#:</b>" & TxtBxSubBySSO.text & "<br>"
   
    orderstring = orderstring & "<hr>" & "<br>"
   
    'If rdBntCoverage.SelectedIndex > -1 Then
    orderstring = orderstring & "<b>Blackberry Coverage Type:</b>" & rdBntCoverage.SelectedItem.text & "<br>"
    'end if
   
    'If rdBntpagercover.SelectedIndex > -1 Then
    'orderstring = orderstring & "<b>Pager Coverage Type:</b>" & rdBntpagercover.SelectedItem.text & "<br>"
    'end if
   
    orderstring = orderstring & "<b>Vendor:</b>" & DrpDwnVendor.selectedItem.text & "<br>"
   
   
    orderstring = orderstring & "<b>Desired Area Code:</b>" & TxtBxareacode.text & "<br>"
    orderstring = orderstring & "<hr>" & "<br>"
   
   
    orderstring = orderstring & "<b>Manager's Name:</b>" & TxtBxMgrName.text & "<br>"
    orderstring = orderstring & "<b>Manager's E-mail:</b>" & TxtBxMgrEmail.text & "<br>"
   
    orderstring = orderstring & "<b>Functional Direct Report's Name:</b>" & TxtBxFDRName.text & "<br>"
    orderstring = orderstring & "<b>Functional Direct Report's Email:</b>" & TxtBxFDREmail.text & "<br>"
   
   
    'orderstring = orderstring & "<b>Billing Option:</b>" & rdiobtnBillling.SelectedItem.text & "<br>"
    'orderstring = orderstring & "<b>Billing(indv)Address:</b>" & txtBxBillingAddress.text & "<br>"
   
    orderstring = orderstring & "<hr>" & "<br>"
    orderstring = orderstring & "<b>Shipping Address:</b>" & Txtbxshipping.text & "<br>"
    orderstring = orderstring & "<b>Telephone number for FEDEX shipping:</b>" & Txtbxfedexnumber.text & "<br>"
    orderstring = orderstring & "<hr>" & "<br>"
    orderstring = orderstring & "<b>Comments:</b>" & txtBoxComments.text & "<br>"
   
   
    'Checks to make sure that all fields met the validation rules from controls
    If Page.isValid then
   
   
    'Setup email parameters here
    mailMessage.From = "NAME@ADDRESS.COM"
    mailMessage.To = "NAME@ADDRESS.COM"
    mailMessage.bCC = "NAME@ADDRESS.COM"
    mailMessage.Subject = "COMPANY NAME:Request for Blackberry Device:web-auto-generated"
    mailMessage.BodyFormat = System.Web.Mail.MailFormat.Html
    mailMessage.Body = orderstring
    'System.Web.Mail.SmtpMail.SmtpServer = "SMTP SERVER ADDRESS HERE"
    'System.Web.Mail.SmtpMail.SmtpServer = "SMTP IP ADDRESS HERE"
    'uses the local smtp server and the the smtp uses a smarthost to send the mail
    System.Web.Mail.SmtpMail.SmtpServer = "localhost"
    System.Web.Mail.SmtpMail.Send(mailMessage)
   
   
    Session("Sentbool") = "true"
   
    'dim pobj
    'for each pobj in Page  //have to look into the Page Object to get this working
    '    pobj.enabled = false
    '    Next
    'end for
   
    End if
   
   
    Catch exp as Exception
   
    Session("Sentbool") = "false"
    Response.redirect("confirmation.aspx?msg=There was and error sending the request: " & exp.Message  & " Please Try Again Later. If you have further difficulties, please contact the helpdesk at [HELPDESK EMAIL HERE] or Dialcomm *[NUMBERS HERE")
    'lblErrormsg.Text = "There was and error Sending the mail: " & exp.Message & " Please Try Again Later:"
   
    'Catch abuse as System.Web.HttpRequestValidationException
    'Session("Sentbool") = "false"
    'Response.redirect("confirmation.aspx?msg=There was and error sending the request: " & abuse.Message  & " Please Try Again Later. If you have further difficulties, please contact the helpdesk at [HELPDESK EMAIL HERE]")
   
   
    End Try
   
   
    if Session("Sentbool") = true then
    Response.redirect("confirmation.aspx?msg=Your request has been sent. If you do not receive a ticket number within 24 hours, please contact the helpdesk at [HELPDESK EMAIL HERE] or Dialcomm *[NUMBERS HERE]")
    end if
   
    end if
   
   
    End Sub
    '''Session("Sentbool") = "false"
    '
    ''private sub page_load(byVal sender as System.object, Byval e as System.EventArgs)
   
    'lblErrormsg.text = Session("Sentbool")
   
    ''if Session("Sentbool") = "true" then
   
    ''response.redirect("confirmation.aspx?msg=ERROR: Only one request per session is allowed, and your previous request has already been submitted. If you need to send an additional request, please close Internet Explorer, re-open it, and come back to the order page and submit another order.  Multiple orders cannot be placed during the same session.  If you require further assistance,  please contact the helpdesk at [HELPDESK EMAIL HERE] or Dialcomm *[NUMBERS HERE]")

    ''end if
   
    ''End sub
   
    private sub page_init(byVal sender as System.object, Byval e as System.EventArgs)
    '//Expiration Headers
    'Response.AddHeader("cache-control", "private")
    'Response.AddHeader("pragma", "no-cache")
    'Response.ExpiresAbsolute = ("January 1, 1990 00:00:01")
    'Response.Expires=0
    End sub
   
    'Event Handlers
    'Sub DrpDwnLstBuisness_SelectedIndexChanged(sender As Object, e As EventArgs)
    'if DrpDwnLstBuisness.selectedItem.value="Other" then
    'lblBus.visible=true
    'TxtBxBusiness.visible=true
    'RequiredFieldValidator13.enabled=true
    'else
    'lblBus.visible=false
    'TxtBxBusiness.visible=false
    'RequiredFieldValidator13.enabled=false
    'end if
    'End Sub
   
    'Sub rdiobtnBillling_SelectedIndexChanged(sender As Object, e As EventArgs)
    'if rdiobtnBillling.SelectedItem.Text="Individual Billing" then
    '    RequiredFieldValidator14.Enabled=true
    'else
    '    RequiredFieldValidator14.enabled=false
    'end if
   
    'End Sub
   
    'Sub rdBntCoverage_SelectedIndexChanged(sender As Object, e As EventArgs)
    'rdBntpagercover.SelectedIndex = -1
   
    'End Sub
   
    'Sub rdBntpagercover_SelectedIndexChanged(sender As Object, e As EventArgs)
    'rdBntCoverage.SelectedIndex = -1
    'End Sub
   
    Sub DrpDwnVendor_SelectedIndexChanged(sender As Object, e As EventArgs)
   
    End Sub
 
</script>
<html>
<head>
    <title>Blackberry Order Form</title>
    <link href="css/forms.css" type="text/css" rel="Stylesheet" />
</head>
<body>
    <h2>&nbsp;Blackberry New Account Order Form&nbsp;-&nbsp;[CLIENT FULL NAME HERE]
    </h2>
    <table width="100%" align="top" border="0">
        <tbody>
            <tr>
                <td>
                    <p>
                        1) If you have problems with the form below please send requests directly to <a href="mailto:[HELPDESK EMAIL HERE]">[HELPDESK EMAIL ADDRESS HERE</a>
                        <br />
                        2) All submissions received after hours will be answered in the order that they were
                        received starting the following business day.
                        <br />
                        3) [COMPANY NAME] Helpdesk hours are 8:00AM and 8:00PM EST from Monday ~ Friday excluding holidays.<br />
                        4) If you do not receive confirmation notification or a service request number by
                        the close of business, please contact the Help Desk.
                        <br />
                        5) All fields are required.
                        <br />
                        6) Netscape is not a supported browser for this form.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <form method="post" runat="server">
                        <asp:ValidationSummary id="ValidationSummary1" runat="server"></asp:ValidationSummary>
                        <table class="mainT" height="100%" width="100%" border="0" heigth="100%">
                            <tbody>
                                <input type="hidden" value="[CLIENT SHORT NAME HERE]" name="client" />
                                <input type="hidden" value="Telecommunications" name="department" />
                                <input type="hidden" value="BlackBerry" name="supportArea" />
                                <input type="hidden" value="New" name="issue" />
                                <input type="hidden" value="[ASSIGNED TO GROUP NAME HERE]" name="assignedToGroup" />
                                <input type="hidden" value="TxtBxSSO" name="uniqueFieldIdentifier" />
                                <input type="hidden" value="caller" name="roles" />
                                <input type="hidden" value="caller" name="mypageLayout" />
                                <input type="hidden" value="Submitted By,Email,Phone Number,SSO,Blackberry Coverage,Vendor,Area Code Desired,Managers Name,Managers Email,Functional Reports Name,Functional Reports Email,Shipping Address,Telephone Number for FEDEX shipping,Comments" name="problemLabels" />
                                <input type="hidden" value="TxtBxSubByName,TxtBxSubByEmail,TxtBxSubByPhone,TxtBxSubBySSO,rdBntCoverage,DrpDwnVendor,TxtBxareacode,TxtBxMgrName,TxtBxMgrEmail,TxtBxFDRName,TxtBxFDREmail,Txtbxshipping,Txtbxfedexnumber,txtBoxComments" name="problemFields" />
                                <tr>
                                    <td colspan="4" height="20">
                                        <p>
                                            <asp:Label id="Label5" runat="server" cssclass="steps" width="100%" font-bold="True">Step
                                            1 of 6 : Information about requestor:</asp:Label><strong><font color="maroon"></font></strong>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblTextBox" runat="server">First Name:</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxFirstName" runat="server" MaxLength="50"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ControlToValidate="TxtBxFirstName" Display="Dynamic" ErrorMessage=" First Name is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblLastName" runat="server">Last Name:</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxLastName" runat="server" MaxLength="50"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="TxtBxLastName" Display="Dynamic" ErrorMessage="Last Name is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblEmal" runat="server">Email:</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxEmail" runat="server" MaxLength="75" Width="229px"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ControlToValidate="TxtBxEmail" ErrorMessage="E-mail is required"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ControlToValidate="TxtBxEmail" Display="Dynamic" ErrorMessage="Email not a valid format" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="Lblphonenum" runat="server">Full Telephone #:</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxphone" runat="server" MaxLength="15"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator4" runat="server" ControlToValidate="TxtBxphone" Display="Dynamic" ErrorMessage="Telephone is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblSSO" runat="server">SSO#:</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxSSO" runat="server" MaxLength="11" Width="97px"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator5" runat="server" ControlToValidate="TxtBxSSO" Display="Dynamic" ErrorMessage="SSO Number is required"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" ControlToValidate="TxtBxSSO" Display="Dynamic" ErrorMessage="Please enter in a valid SSO #" ValidationExpression="\d{9}"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="Label4" runat="server">Site Location (City,State/Country):</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxSite" runat="server" MaxLength="50"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator11" runat="server" ControlToValidate="TxtBxSite" Display="Dynamic" ErrorMessage="Site Location is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label14" runat="server" cssclass="steps" width="100%" font-bold="True">Step
                                        2 of 6 : Submitters Contact Information:</asp:Label></td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label15" runat="server">If you are submitting this form on behalf of
                                        someone else, please enter your own contact information here:</asp:Label></td>
                                </tr>
                                <tr>
                                    <td colspan="1">
                                        <asp:Label id="Label16" runat="server" width="216px">Submitted By (First & Last Name):</asp:Label></td>
                                    <td>
                                        <asp:TextBox id="TxtBxSubByName" runat="server" Width="215px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:Label id="Label18" runat="server" width="99px">Phone Number</asp:Label></td>
                                    <td>
                                        <asp:TextBox id="TxtBxSubByPhone" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="1">
                                        <asp:Label id="Label17" runat="server">Email:</asp:Label></td>
                                    <td colspan="1">
                                        <asp:TextBox id="TxtBxSubByEmail" runat="server" Width="215px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:Label id="SubmittedBySSO" runat="server" width="107px">SSO#</asp:Label></td>
                                    <td>
                                        <asp:TextBox id="TxtBxSubBySSO" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label1" runat="server" cssclass="steps" width="100%" font-bold="True">Step
                                        3 of 6 : Information about request:</asp:Label></td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;<asp:Label id="Label12" runat="server">Select Blackberry Coverage</asp:Label></td>
                                    <td colspan="3">
                                        <asp:DropDownList id="rdBntCoverage" runat="server">
                                            <asp:ListItem Value="0">Select Coverage</asp:ListItem>
                                            <asp:ListItem Value="Blackberry Only - U.S. Coverage">Blackberry Only - U.S. Coverage</asp:ListItem>
                                            <asp:ListItem Value="Blackberry Only - U.S. + International Coverage">Blackberry Only - U.S. + International Coverage</asp:ListItem>
                                            <asp:ListItem Value="Blackberry w/ Cell phone - U.S. + International Coverage">Blackberry w/ Cell phone - U.S. + International Coverage</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;<asp:Label id="Label11" runat="server">Select Vendor</asp:Label></td>
                                    <td colspan="3">
                                        <asp:DropDownList id="DrpDwnVendor" runat="server" OnSelectedIndexChanged="DrpDwnVendor_SelectedIndexChanged">
                                            <asp:ListItem Value="Cingular">Cingular</asp:ListItem>
                                            <asp:ListItem Value="Sprint">Sprint</asp:ListItem>
                                            <asp:ListItem Value="Verizon">Verizon</asp:ListItem>
                                        </asp:DropDownList>
                                        &nbsp;<asp:Label id="lblvendorcoverage" runat="server" width="289px" font-size="XX-Small">Cingular
                                        provides both domestic and international service. Sprint & Verizon provide domestic
                                        service only.</asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;<asp:Label id="Label13" runat="server">Area Code Desired</asp:Label></td>
                                    <td colspan="3">
                                        <asp:TextBox id="TxtBxareacode" runat="server" MaxLength="10" Width="63px"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator6" runat="server" ControlToValidate="TxtBxareacode" Display="Dynamic" ErrorMessage=" Area code is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label2" runat="server" cssclass="steps" width="100%" font-bold="True">Step
                                        4 of 6 : Approval Information</asp:Label></td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label8" runat="server" width="100%" font-bold="True" font-size="X-Small" height="61px">This
                                        request will be sent to your manager, the Functional Direct Report to [MGR NAME HERE]
                                        and the Senior Executive management person designated by your business. Please make
                                        sure all email addresses are accurate. NOTE: Your request will not be processed until
                                        all three approvals are received. It is your responsibility to track the approval
                                        request email that will be sent, to ensure your Blackberry order is processed.</asp:Label></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblMgrName" runat="server">Manager's Name:</asp:Label></td>
                                    <td colspan="4">
                                        <asp:TextBox id="TxtBxMgrName" runat="server" MaxLength="75"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator7" runat="server" ControlToValidate="TxtBxMgrName" Display="Dynamic" ErrorMessage=" Manager's Name is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblMgrEmail" runat="server">Manager's Email:</asp:Label></td>
                                    <td colspan="4">
                                        <asp:TextBox id="TxtBxMgrEmail" runat="server" MaxLength="50"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator8" runat="server" ControlToValidate="TxtBxMgrEmail" Display="Dynamic" ErrorMessage=" Manager's email is required"></asp:RequiredFieldValidator>
                                        <br />
                                        <asp:RegularExpressionValidator id="RegularExpressionValidator4" runat="server" ControlToValidate="TxtBxMgrEmail" Display="Dynamic" ErrorMessage="Please enter in valid e-mail address" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="LblFDRInst" runat="server" width="100%" font-bold="True" font-size="X-Small" height="19px">Please
                                        provide the name and email address of the functional direct report to [MGR NAME HERE]</asp:Label></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblFDRName" runat="server">Functional Direct Report's Name:</asp:Label></td>
                                    <td colspan="4">
                                        <asp:TextBox id="TxtBxFDRName" runat="server" MaxLength="75"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator9" runat="server" ControlToValidate="TxtBxFDRName" Display="Dynamic" ErrorMessage=" Functional Direct Report's Name is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label id="LblFDREmail" runat="server">FunctionalDirect Report's Email:</asp:Label></td>
                                    <td colspan="4">
                                        <asp:TextBox id="TxtBxFDREmail" runat="server" MaxLength="50"></asp:TextBox>
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator10" runat="server" ControlToValidate="TxtBxFDREmail" Display="Dynamic" ErrorMessage=" Functional Direct Report's email is required"></asp:RequiredFieldValidator>
                                        <br />
                                        <asp:RegularExpressionValidator id="RegularExpressionValidator6" runat="server" ControlToValidate="TxtBxFDREmail" Display="Dynamic" ErrorMessage="Please enter in valid e-mail address" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label3" runat="server" cssclass="steps" width="100%" font-bold="True">Step
                                        5 of 6 : Billing Information</asp:Label></td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        All Blackberry charges must be placed on the employee's [COMPANY NAME HERE] MasterCard <strong>(the
                                        exception is Verizon, which is electronically billing to [COMPANY NAME HERE] Corp.)</strong> We will
                                        email you the contact telephone number so that you may provide your information directly
                                        to the vendor.</td>
                                </tr>
                                <tr>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label6" runat="server" cssclass="steps" width="100%" font-bold="True">Step
                                        6 of 6 : Shipping Information</asp:Label></td>
                                </tr>
                                <tr>
                                    <td valign="top" colspan="1">
                                        Shipping Address for the device:&nbsp;<br />
                                        <br />
                                    </td>
                                    <td colspan="4">
                                        &nbsp;<asp:TextBox id="Txtbxshipping" runat="server" MaxLength="500" Width="266px" Height="94px" TextMode="MultiLine"></asp:TextBox>
                                        <br />
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator16" runat="server" ControlToValidate="Txtbxshipping" Display="Dynamic" ErrorMessage=" Shipping address is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="1">
                                        Telephone # for FEDEX Shipping:</td>
                                    <td colspan="4">
                                        <asp:TextBox id="Txtbxfedexnumber" runat="server"></asp:TextBox>
                                        <br />
                                        <asp:RequiredFieldValidator id="RequiredFieldValidator17" runat="server" ControlToValidate="Txtbxfedexnumber" Display="Dynamic" ErrorMessage="Phone number for FEDEX shipping is required"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label id="Label7" runat="server" cssclass="steps" width="100%" font-bold="True">Comments:</asp:Label></td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <asp:TextBox id="txtBoxComments" runat="server" MaxLength="500" Width="100%" Height="94px" TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="middle" width="25" colspan="1">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Submit Request"></asp:Button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </form>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>


0
Comment
Question by:dhrozen
  • 2
  • 2
7 Comments
 
LVL 32

Expert Comment

by:jhance
Comment Utility
Why do you need to translate it to VB.NET?  Unless you need to have both VB.NET and C# on the same ASPX page (which can't be done) you can mix VB.NET and C# ASPX files in the same web.
0
 
LVL 2

Author Comment

by:dhrozen
Comment Utility
jhance,

I don't know.. that apparently is what the 3rd party vendor guy is telling me.. those were his instructions; that I probably needed to translate the portion of code that he wrote in C# above into VB, since the rest of the code (the orig. form code above) is in VB. They won't be 2 separate files.. he wants me to incorporate his code into my aspx form. Again, since I'm not a programmer, so I am not sure on how to do this correctly.

Thanks!
D
0
 
LVL 1

Accepted Solution

by:
ewsgreg earned 500 total points
Comment Utility
Here is the code block in VB.  I had to do one funky thing with the scriptString, Vusial Studio didn't like the </script> tag even though it was in quotes, so I split if up and concatenated it.  I would put this at the top of the code, just after the <script runat="server"> tag.  Make sure you put in whatever the http address is in the scriptString variable, replace [PATH] with the address.  You do already have a server side Button1_Click event, I don't think it will interfere with the client side event in the code block.  The client side should fire first.  I hope this at least helps you to get started on it.

      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            'write out Javascript block
            Dim scriptString As String = "<script language='javascript'>function postData(){ document.forms[0].action='http://[PATH]/wbSubmission.cfm'; document.forms[0].submit(); } </" & "script>"
 
            'register Javascript
            If Me.IsClientScriptBlockRegistered("myJavascriptCode") Then
                  Me.RegisterClientScriptBlock("myJavascriptCode", scriptString)
            End If

            'Assign Submit button to call Javascript
            Button1.Attributes("onclick") = "javascript:postData();"
      End Sub
0
 
LVL 1

Expert Comment

by:ewsgreg
Comment Utility
One more thing, I edited this in VS 2005, I think the Protected Sub on the first line works in all version of vb.net.  If it generates any errors, try either removing the work Protected or changing it to Private.
0
 
LVL 2

Author Comment

by:dhrozen
Comment Utility
ewsgreg...
Thanks a million..  I will try this out tomorrow and let you know how it works!

D
0

Featured Post

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

Join & Write a Comment

Suggested Solutions

This is about my first experience with programming Arduino.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 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

15 Experts available now in Live!

Get 1:1 Help Now