5
Answers

How to round off the value and disabled the textbox inASPNET

Hi I want to round off the value which is in textbox, once value enter in textbox and before cursor moving to next field and also at the same time have to disable the textbox once round off get finished
Eg if i enter 456.667 in textbox means before the cursor move to next field it round off the value 456.667 to 457. Here i tried On value change event function.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type ="text/javascript">
function tSpeedValue()
{
debugger;
var result = document.getElementById("<%=TextBox1.ClientID%>")
var result1 = result.tofixed(0);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" onchange="tSpeedValue"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" onchange="tSpeedValue1"></asp:TextBox>
</div>
</form>
</body>
</html>
Here what is my doubt is here i get the value and also rounded off the value. now my doubt is how to assign the round off value again to same textbox and also disable the textbox once round off. i have less knowledge in asp.net so only i ask this simple question as doubt. i tried my level best to explain the issue.Please any one understand my issue and help me to resolve this problem.
Answers (5)
0
Sujitha P

Sujitha P

NA 5 341 9y
Hi,
 
 
              Thanks for your reply.
              Actually my task is to create class library that contain user controls and i need to implement that dll into web application.
 
0
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 9y
0
Sujitha P

Sujitha P

NA 5 341 9y
Hi..
   
      Thanks for your reply..
      In this link they created a user control in a web application...but my task is to create a user control in a class library..Then i need to implement that dll into web application.
 
0
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 9y
Hi Sujitha,
 
This  is a long process to describe how to use. Please find below link:
 
0
Govinda Rajulu Yemineni

Govinda Rajulu Yemineni

NA 1.5k 233.1k 9y
Hi,
 
refer the below link
 
http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx