ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,451 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Line 73:
Line 74: 'Compute Final Price
Line 75: Dim ItemPrice As String = TryCast(GridView1.Rows(e.RowIndex).FindControl("Price"), TextBox).Text.ToString
Line 76: hfFinalPrice.Value = hfItemQuanGrid.Value * ItemPrice
Line 77:
You did not provide the error... Your code tries to multiple a string named ItemPrice by an unknown value (hfItemQuanGrid.Value). Convert ItemPrice and perhaps hfItemQuanGrid.Value to a numeric type using the TryParse() method.
Imports System.Data
Module Program
Sub Main(args As String())
Dim ItemPrice As String = "1.23"
Dim Price As Decimal
If (Decimal.TryParse(ItemPrice, Price)) Then
Console.WriteLine("TryParse was successful. The price is " & Price)
Else
Console.WriteLine("Unable to convert " & ItemPrice & " to a decimal")
End If
End Sub
End Module