Sahil Jani

Sahil Jani

  • NA
  • 274
  • 154.6k

Not able to call Button Click event

May 25 2012 5:16 AM

Hi,

I have crated one control. Put some textbox and dropdown list as I required. I have created one button called submit. Which is not firing any event.
When I am click that submit button It is firing required field validation but after filling all the details it is not firing any events.

Need help ASAP.

I have pasted a control file here with :

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="RaiseOutboundRequest.ascx.vb"
    Inherits="AFT.Web.RaiseOutboundRequest" %>
<%@ Register Assembly="GMDatePicker" Namespace="GrayMatterSoft" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<script type="text/javascript" language="javascript">
    function CalculatePayment() {
        var txtPaidByCustomer = document.getElementById('<%=txtPaidByCustomer.ClientID%>');
        var txtPaidBySigma = document.getElementById('<%=txtPaidBySigma.ClientID%>');
        if (txtPaidByCustomer != null && txtPaidBySigma != null) {
            var paidByCustomer = txtPaidByCustomer.value;
            if (isNaN(paidByCustomer) || paidByCustomer <= 0 || paidByCustomer > 100)
                txtPaidBySigma.value = 100;
            else
                txtPaidBySigma.value = parseInt(100 - paidByCustomer);
        }
    }
    function RaiseOutboundRequestCounterControl() {
        var lblRaiseOutboundRequestCharCounter = document.getElementById('<%=lblRaiseOutboundRequestCharCounter.ClientID%>');
        return lblRaiseOutboundRequestCharCounter;
    }
    function ShowHideAirFreightRecoverDetails() {
        var ddlAirFreightChargeMethod = document.getElementById('<%=ddlAirFreightChargeMethod.ClientID%>');
        var ddlAirFreightChargeMethodText = ddlAirFreightChargeMethod.options[ddlAirFreightChargeMethod.selectedIndex].text;
        var trPaidByCustomer = document.getElementById('<%= trPaidByCustomer.ClientID%>');
        var trPaidBySigma = document.getElementById('<%= trPaidBySigma.ClientID%>');
        var trAttachCustomerBDVApproval = document.getElementById('<%= trAttachCustomerBDVApproval.ClientID%>');
        ShowHideAirFreightRecoveryMethod(ddlAirFreightChargeMethodText, trPaidByCustomer, trPaidBySigma, trAttachCustomerBDVApproval);
    }
    function ShowHideAttachCustomerBDVApprovalDetails() {
        var txtPaidByCustomer = document.getElementById('<%=txtPaidByCustomer.ClientID%>').value;
        var trAttachCustomerBDVApproval = document.getElementById('<%= trAttachCustomerBDVApproval.ClientID%>');
        ShowHideAttachCustomerBDVApprovalMethod(txtPaidByCustomer, trAttachCustomerBDVApproval);
    }   
</script>
<table width="800px" align="center" class="tablebrdr">
    <tr class="heading">
        <td>
            <strong>Raise Outbound Request :</strong>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblMessage" runat="server" Visible="false"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Panel ID="pnlRaiseOutboundRequest" runat="server" Width="100%">
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tr runat="server" id="trRequestIdOnPage">
                        <td style="width: 200px;">
                            Request Id :
                        </td>
                        <td style="width: 300px;">
                            <asp:Label ID="lblRequestIdOnPage" runat="server"></asp:Label>
                        </td>
                        <td style="width: 275px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            Plant :
                        </td>
                        <td style="width: 300px;">
                            <asp:DropDownList ID="ddlPlant" runat="server" CssClass="search" Width="250px">
                            </asp:DropDownList>
                        </td>
                        <td style="width: 275px;">
                            <asp:RequiredFieldValidator ID="rfvPlant" runat="server" ErrorMessage="Select a plant"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="ddlPlant"
                                InitialValue="0" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Customer Name :
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlCustomer" runat="server" CssClass="search" Width="250px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvCustomer" runat="server" ErrorMessage="Customer name is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="ddlCustomer"
                                InitialValue="0" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            Ship To Address :
                        </td>
                        <td>
                            <asp:TextBox ID="txtShipmentAddress" CssClass="search" runat="server" onKeyUp="validateLimit(this,RaiseOutboundRequestCounterControl())"
                                Width="246px" TextMode="MultiLine" Rows="5"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvShipToAddress" runat="server" ErrorMessage="Ship To Address is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtShipmentAddress"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Country :
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlCountryList" runat="server" CssClass="search" Width="250px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvCountryList" runat="server" ErrorMessage="Country name is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="ddlCountryList"
                                InitialValue="0" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            ZIP Code :
                        </td>
                        <td>
                            <asp:TextBox ID="txtZipCode" runat="server" CssClass="search" Width="246px"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvZipCode" runat="server" ErrorMessage="Zip Code is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtZipCode"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Air Freight Charge Method :
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlAirFreightChargeMethod" runat="server" CssClass="search"
                                Width="250px" onchange="ShowHideAirFreightRecoverDetails();">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvAirFreightChargeMethod" runat="server" ErrorMessage="Select an air freight charge method"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="ddlAirFreightChargeMethod"
                                InitialValue="0" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            Customer Account With :
                        </td>
                        <td>
                            <asp:RadioButtonList ID="rbtnlCustomerAccountWith" runat="server" CssClass="search">
                                <asp:ListItem Text="SIGMA" Selected="False"></asp:ListItem>
                                <asp:ListItem Text="SEMCO Pune" Selected="False"></asp:ListItem>
                                <asp:ListItem Text="SEMCO Jaipur" Selected="False"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvCustomerAccountWith" runat="server" ErrorMessage="Please Select Customer Account With"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="rbtnlCustomerAccountWith"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr runat="server" id="trPaidByCustomer">
                        <td>
                            <asp:Label ID="lblPaidByCustomer" runat="server" Text="Paid by Customer (%) :"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPaidByCustomer" CssClass="search" runat="server" Width="246px"
                                MaxLength="3" onkeypress="return isInteger(event);" onBlur="CalculatePayment(); ShowHideAttachCustomerBDVApprovalDetails();"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvPaidByCustomer" runat="server" ErrorMessage="Paid by customer is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtPaidByCustomer"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="rvPaidByCustomer" runat="server" Type="Integer" ErrorMessage="Value must be >=0 and <=100"
                                MinimumValue="0" MaximumValue="100" ValidationGroup="RaiseOutboundRequestMandatory"
                                ControlToValidate="txtPaidByCustomer" Display="Dynamic" SetFocusOnError="true"></asp:RangeValidator>
                        </td>
                    </tr>
                    <tr runat="server" id="trPaidBySigma">
                        <td>
                            <asp:Label ID="lblPaidBySigma" runat="server" Text="Paid by SIGMA&nbsp; (%) :"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPaidBySigma" CssClass="search" runat="server" Width="246px" Enabled="false"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvPaidBySigma" runat="server" ErrorMessage="Paid by SIGMA is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtPaidBySigma"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="rvPaidBySigma" runat="server" Type="Integer" ErrorMessage="Value must be >=0 and <=100"
                                MinimumValue="0" MaximumValue="100" ValidationGroup="RaiseOutboundRequestMandatory"
                                ControlToValidate="txtPaidBySigma" Display="Dynamic" SetFocusOnError="true"></asp:RangeValidator>
                        </td>
                    </tr>
                    <tr runat="server" id="trAttachCustomerBDVApproval">
                        <td>
                            Customer/BDV Approval Documents :
                        </td>
                        <td>
                            <asp:FileUpload ID="fuCustomerApprovalDocuments" runat="server" CssClass="search"
                                Width="250px" />
                            <asp:LinkButton ID="lnkCustomerApprovalDocuments" runat="server" ToolTip="Click to open uploaded file"></asp:LinkButton>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvFUCustomerApprovalDocuments" runat="server" ErrorMessage="Attach Customer/BDV Approval Document"
                                Display="Dynamic" ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="fuCustomerApprovalDocuments"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr runat="server" id="trItemList">
                        <td>
                            Item List :
                        </td>
                        <td>
                            <asp:FileUpload ID="fuMultipleItemDetail" runat="server" CssClass="search" Width="250px" />
                            <asp:LinkButton ID="lnkMultipleItemDetail" runat="server" ToolTip="Click to open uploaded file"></asp:LinkButton>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvMultipleItemDetail" runat="server" ErrorMessage="Item details are required"
                                Display="Dynamic" ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="fuMultipleItemDetail"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Total Quantity :
                        </td>
                        <td>
                            <asp:TextBox ID="txtTotalQuantity" CssClass="search" runat="server" Width="246px"
                                onkeypress="return isInteger(event);"></asp:TextBox>
                            <asp:MaskedEditExtender ID="maskExtTotalQuantity" runat="server" Enabled="True" TargetControlID="txtTotalQuantity"
                                Mask="9,99,999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                OnInvalidCssClass="MaskedEditError" MaskType="Number" InputDirection="RightToLeft"
                                AcceptNegative="None" DisplayMoney="None" ErrorTooltipEnabled="true">
                            </asp:MaskedEditExtender>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvTotalQuantity" runat="server" ErrorMessage="Total quantity is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtTotalQuantity"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Gross Weight (Kg) :
                        </td>
                        <td>
                            <asp:TextBox ID="txtGrossWeight" CssClass="search" runat="server" Width="246px" onkeypress="return isInteger(event);"></asp:TextBox>
                            <asp:MaskedEditExtender ID="maskExtGrossWeight" runat="server" Enabled="True" TargetControlID="txtGrossWeight"
                                Mask="9,99,999.9999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                OnInvalidCssClass="MaskedEditError" MaskType="Number" InputDirection="RightToLeft"
                                AcceptNegative="None" DisplayMoney="None" ErrorTooltipEnabled="true">
                            </asp:MaskedEditExtender>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvGrossWeight" runat="server" ErrorMessage="Gross weight is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtGrossWeight"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr id="trEstimatedCostForAirFreight" runat="server">
                        <td>
                            Estimated Cost (Rs.) :
                        </td>
                        <td>
                            <asp:TextBox ID="txtEstimatedCost" CssClass="search" runat="server" Width="246px"
                                onkeypress="return isInteger(event);"></asp:TextBox>
                            <asp:MaskedEditExtender ID="maskExtEstimatedCost" runat="server" Enabled="True" TargetControlID="txtEstimatedCost"
                                Mask="9,99,999.99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                OnInvalidCssClass="MaskedEditError" MaskType="Number" InputDirection="RightToLeft"
                                AcceptNegative="None" DisplayMoney="None" ErrorTooltipEnabled="true">
                            </asp:MaskedEditExtender>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvEstimatedCost" runat="server" ErrorMessage="Estimated Cost is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtEstimatedCost"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr id="trddlReasonForAirFreight" runat="server">
                        <td>
                            Reason For Shipment :
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlReasonForAirFreight" runat="server" CssClass="search" Width="250px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvReason" runat="server" ErrorMessage="Select a reason for air shipment"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="ddlReasonForAirFreight"
                                InitialValue="0" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>                   
                    <tr>
                        <td valign="top">
                            Remark :
                        </td>
                        <td>
                            <asp:TextBox ID="txtRaiseOutboundRequestRemark" CssClass="search" runat="server"
                                onKeyUp="validateLimit(this,RaiseOutboundRequestCounterControl())" Width="246px"
                                TextMode="MultiLine" Rows="5"></asp:TextBox>
                            <div id="lblRaiseOutboundRequestCharCounter" runat="server">
                            </div>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="rfvRaiseOutboundRequestRemark" runat="server" ErrorMessage="Remark is required"
                                ValidationGroup="RaiseOutboundRequestMandatory" ControlToValidate="txtRaiseOutboundRequestRemark"
                                Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr id="trRaiseOutboundRequestOperationsButtons" runat="server" align="center">
                        <td colspan="3">
                            <table>
                                <tr align="center">
                                    <td>
                                        <asp:Button ID="btnRaiseOutboundRequestOperation" class="button" runat="server" CausesValidation="true"
                                            ValidationGroup="RaiseOutboundRequestMandatory" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnBack" class="button" runat="server" Text="Back" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnCancelRequest" class="button" runat="server" Text="Cancel Request"
                                            CausesValidation="false" OnClientClick="ConfirmRequestDelete();" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
    </tr>
</table>


Thanks & Regards,
Jani Sahil H.