Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I have asp.net website,

In which i'm using anuglarJS.

Scenario

i have one Label for 'Price', n here i used ng-model to fetch its value, but unfortunately i'm not getting its value, may be bcoz of it's a label.

n i have text box for 'qty' n here i also used ng-model, its working.

n one label for TotalPrice n here i used ng-bind, n this one is also working.

The only thing is: ng-model is not working with label.

<asp:Label ID="lblprice" runat="server" Text="4" ng-model="ePrice"></asp:Label>
<asp:TextBox ID="txteqty" runat="server" ng-model="Qty" />
<asp:Label ID="lbletprice" runat="server" ng-bind="ePrice * Qty"></asp:Label>


how can i get the value of a label using AnuglarJS.

Can any one plz help me to solve this....


Thanks
Posted
Updated 18-Mar-15 7:23am
v3
Comments
sudevsu 18-Mar-15 12:59pm    
Probably solution is in your question only...

1 solution

Try this Code,
C#
<div ng-app="" ng-init="ePrice=5">



    <asp:Label ID="Label1" runat="server"  ng-bind="ePrice"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server" ng-model="Qty"></asp:TextBox>
    <asp:Label ID="Label2" runat="server" Text="" ng-bind="ePrice*Qty" ></asp:Label>
</div>
 
Share this answer
 
v2
Comments
abdul subhan mohammed 18-Mar-15 14:01pm    
what if i bind this 'lblprice' label dynamically. Then how??
King Fisher 18-Mar-15 14:19pm    
It will not work. ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900