sathish kumar

sathish kumar

  • NA
  • 117
  • 165.1k

My javascript with asp.net code is not running on IIS ??

Jun 27 2012 8:41 AM
Hi Friends..  I m first time involving in ASP.NET project deployment. I have problem with my javascript code.

 For calculation purpose i used javascript code.. But on IIS its not running...I dont know the reason.  Can anyone help me please... Its urgent ...

<%@ Page Language="C#" MasterPageFile="PharmacyMaster.master" AutoEventWireup="true" CodeFile="PoOrder.aspx.cs" Inherits="PoOrder" Title="Purchase Order"  %>
<asp:Content  ID="Content1" ContentPlaceHolderID="PharmacyContent" runat="server" >

<style type="text/css">
 
  .GridViewStyle

{

  font-family: Arial, Sans-Serif;

  font-size:small;

  table-layout: auto;

  border-collapse: collapse;

  border: #694489;

}

.HeaderStyle, .PagerStyle /*Common Styles*/

{

  background-image: url(Images/HeaderGlassBlack.jpg);

  background-position:center;

  background-repeat:repeat-x;

  background-color:#006699;

}
 </style>
 
  <script type="text/javascript">

  function calendarPicker(strField) {
  window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=190,resizable=yes');

  }
  function Numeric(key)
  {
  var keycode = (key.which) ? key.which : key.keycode;
  if (keycode > 65)
  {
  return false;
  }
  else
  {
  return true;
  }
  }

  function Calculate()
  {
  var Quantity = document.getElementById("txtRate").value;
  var Rate = document.getElementById("txtQty").value;
  if (Quantity == "")
  {
  Quantity = 0;
  }
  if (Rate == "")
  {
  Rate = 0;
  }

  var originalValue = (Quantity * Rate);
  var roundValue = Math.round(originalValue * Math.pow(10, 2)) / Math.pow(10, 2);
  document.getElementById("txtsubtotal").value = roundValue;

  var percentage = document.getElementById("txtVATpercent").value;

  var totalvat = (percentage / 100) * (roundValue);
  document.getElementById("txtVatTotal").value = totalvat;

  var totalAmount = (roundValue + totalvat);
  document.getElementById("txtTotalAmount").value = totalAmount;

  }

</script>

<form id="form1" runat="server">

 <asp:TextBox ID="txtsubtotal" runat="server" ForeColor="Green" Text="0.00"
  Height="20px" Width="69px" AutoPostBack="True" onblur= "Calculate();" ></asp:TextBox></td>
 
 
  <td class="Name">
  <asp:TextBox ID="txtVATpercent" runat="server" Width="63px" ForeColor="#000099"
  Height="20px" onblur= "Calculate();" OnKeyPress= "return Numeric(event)" 
  AutoPostBack="True" ></asp:TextBox>
 
 
 
  </td> 
  <td headers="VAT Total" class="Name">
  <asp:TextBox ID="txtVatTotal" runat="server" ForeColor="Green" Text="0.00"
  Width="69px" onblur= "Calculate();" AutoPostBack="True" Height="20px"></asp:TextBox>
  </td> 
  <td headers="Total Amount" class="Name">
  <asp:TextBox ID="txtTotalAmount" runat="server" ForeColor="Green" Text="0.00"
  Height="20px" Width="92px" onblur= "Calculate();" AutoPostBack="True" ></asp:TextBox></td>
 
  </form>

</asp:Content>


Above is my sample content page... is it right or i need to do any modification???