Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Update panel is not working

$
0
0

Iam working with a page i need update panel to avoid page refresh when textbox changed event fire .but when update panel is there the another textbox is not getting value of the textchanged event coding. the page using master page and some javascripts. when update panel or master page hide it is working good. 

<tr>
<td colspan="2">Actual Programme fee(₹)
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>

<asp:TextBox ID="txtactualpfee" runat="server" Width="300px" AutoPostBack="true" OnTextChanged="txtactualpfee_TextChanged" ></asp:TextBox>
<asp:TextBox ID="txtdifferenc" runat="server" Width="300px" Enabled="false" placeholder="Difference in Programme fee"></asp:TextBox>

</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtactualpfee" EventName="TextChanged"/>
</Triggers>
</asp:UpdatePanel>
</td>

</tr>

<tr>

<td colspan="4">
<asp:GridView ID="grdtax" runat="server" Width="400px" CssClass="gridview" AutoGenerateColumns="False" DataKeyNames="taxid" ShowFooter="false" CellPadding="4" ForeColor="#333333" GridLines="none" OnRowDataBound="grdtax_RowDataBound" >

<Columns>

<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="lbldesc" runat="server" Text='<%# Bind("taxdesc") %>'></asp:Label>
<asp:HiddenField ID="taxper" runat="server" Value='<%# Bind("taxper") %>' />
</ItemTemplate>


</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<asp:TextBox ID="txttax" runat="server"></asp:TextBox>
</ItemTemplate>


</asp:TemplateField>
</Columns>


</asp:GridView>

</td>

</tr>
<tr id="igst_tr" runat="server" visible="false">
<td colspan="2">
<asp:Label ID="l_igst" runat="server" Text="IGST @ 18%"></asp:Label></td>
<td>
<asp:TextBox ID="txtigst" runat="server" Width="300px" > </asp:TextBox></td>
</tr>
<tr>
<td colspan="2">Total Credit Note Amount (₹)
</td>
<td>
<asp:TextBox ID="txttotal" runat="server" Width="300px"></asp:TextBox>
</td>

</tr>

code behind

protected void txtactualpfee_TextChanged(object sender, EventArgs e)
{
int fee1=int.Parse(txtIprogramfee.Text);
int fee2=int.Parse(txtactualpfee.Text);
int difference = fee1-fee2;
txtdifferenc.Text = difference.ToString();

if (!chkigst.Checked)
{

DateTime date = DateTime.ParseExact(txtdate.Text, "dd-MM-yyyy", CultureInfo.InvariantCulture);
grdtax.DataSource = new academicinvoiceSP().gettaxdetails(date);
grdtax.DataBind();

}
else
{
igst_tr.Visible = true;

float igst = 18;
float actualfee = float.Parse(txtactualpfee.Text);
float taxamount = actualfee * (igst / 100);
txtigst.Text = taxamount.ToString();

txttotal.Text = (actualfee + taxamount).ToString();
}}



Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>