There seems to be an issue with my code where clicking on the button with id="cmdAddATM" causes the entire .aspx page to reload, even though no click function is associated with it. This problem is leading to some new complications in my project that are related to ajax/jquery.
File Name : AddEditATM.aspx.cs
namespace Monitoring_Tool
{
public partial class AddEditATM : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Generix.fillDropDown(ref litRegion, Generix.getData("dbo.Region", "REGION, Code", "", "", "Code", 1));
}
}
}
File : AddEditATM.aspx
<script language="javascript" type="text/javascript">
$(document).ready(function() {
showAddEditATMLoad();
});
</script>
<body>
// I am not providing the full syntax here but there is a button with the id "cmdAddATM"
</body>
External JS File :
function showAddEditATMLoad() {
//It's currently empty
}
My HTML Code:-
<table style="margin: 0px auto; width: 90%" runat="server">
<thead>
<tr>
<th colspan="4" align="center" class="ui-widget-header PageHeader">
ADD/EDIT ATM
</th>
</tr>
</thead>
<tbody style="vertical-align: bottom; border-style: solid; border-width: thick;">
<tr>
<td style="padding-left: 5px" colspan="2">
Enter ATM ID <input id="txtEditATM" name="txtEditATM" type="text" />
<button id="cmdEditATM">
EDIT ATM</button>
</td>
<td align="left" style="font-weight: bold" colspan="1">
OR
</td>
<td align="center" colspan="2">
<button id="cmdAddATM">
ADD ATM</button>
</td>
</tr>
</tbody>
</table>