Below is my .aspx page
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CHEWGB.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<style type="text/css">
body {
background-color: none;
}
.control-label {
color: black;
font-weight: 600;
font-size: 17px;
text-align: center;
font: bolder;
}
.submitBtn {
padding: 10px 20px 11px !important;
font-size: 21px !important;
background-color: orange;
font-weight: bold;
text-shadow: 1px 1px #F36C8C;
color: black;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
border: 1px solid #F36C8C;
cursor: pointer;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.submitBtn:hover {
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
</style>
<table style="background-color: none; border-collapse: separate; border-spacing: 20px; font: bold; font-size:larger">
<tr>
<td align="center">
<asp:Label ID="Label1" runat="server" CssClass="control-label" Text="Enter Number : " BackColor="Aquamarine"></asp:Label>
</td>
<td align="center">
<asp:TextBox ID="txtNumber" runat="server" autocomplete="off"></asp:TextBox>
</td>
<td align="center">
<asp:Button ID="submtBtn" CssClass="submitBtn" runat="server" Text="Submit" OnClick="submtBtn_Click" Style="float: right;" />
</td>
</tr>
</table>
<div id="dvProgressBar" style="float: left; visibility: hidden;">
<img src="loading.gif" />
Generating Pdf, please wait...
</div>
<br style="clear:both" />
<link href = "Css/jquery-ui.css" rel = "stylesheet"/>
<script src = "Scripts/jquery-1.10.2.js"></script>
<script src = "Scripts/jquery-ui.js"></script>
<script src = "Scripts/jquery.timepicker.min.js"></script>
<script src = "Scripts/jquery.ui.timepicker.min.js"></script>
<link href = "Css/jquery.timepicker.css" rel = "stylesheet"/>
<link href = "Css/jquery.ui.timepicker.css" rel = "stylesheet"/>
<script type="text/javascript">
function ShowProgressBar() {
document.getElementById('dvProgressBar').style.visibility = 'visible';
}
function HideProgressBar() {
document.getElementById('dvProgressBar').style.visibility = "hidden";
}
</script>
</asp:Content>
Below is my code Behind function
protected void submtBtn_Click(object sender, EventArgs e)
{
submtBtn.Text = "Please Wait...";
Page.ClientScript.RegisterStartupScript(this.GetType(), "showloadingIcon", "ShowProgressBar()", true);
some codes to generate pdf using itextsharp
Page.ClientScript.RegisterStartupScript(this.GetType(), "hideloadingIcon", "HideProgressBar()", true);
submtBtn.Text = "Submit";
}
The issue here is when i change the submtBtn text in code behind function it is not working and javascript function call for loading icon is also not working in code behind function.
What I have tried:
submtBtn.Text = "Please Wait...";
Page.ClientScript.RegisterStartupScript(this.GetType(), "showloadingIcon", "ShowProgressBar()", true);
some codes to generate pdf using itextsharp
Page.ClientScript.RegisterStartupScript(this.GetType(), "hideloadingIcon", "HideProgressBar()", true);