开发者

how do I convert textbox value to string?

开发者 https://www.devze.com 2023-04-07 21:12 出处:网络
I know this is simple but i am lost as to how to approach it. Iam a new newbie. Please have it on me as i am new here.

I know this is simple but i am lost as to how to approach it. Iam a new newbie. Please have it on me as i am new here.

I have a textbox field called ClientsBalance.

This开发者_运维技巧 balance can is usually in money order with a set amount. The client is also allowed to pay by Debit Cards.

Here goes:

Dim paymentType As TextBox
otherPyment As String = "Debit Card"

If paymentType.Text <> "1250" Then
  paymentType = "OtherPayment"
else
   paymentType = gridview1.FindControl("paymentType" & CStr(1))
end if

Everything was working before the validation.

Now, I get the following error:

Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.TextBox'

Is there a way I can cast this line:

paymentType = "OtherPayment" ??

Thank you so much experts.


you need to say

paymentType.Text = "OtherPayment".

You just left out the ".Text"


Try changing this:

paymentType = "OtherPayment"

To this:

paymentType.Text = "OtherPayment"
0

精彩评论

暂无评论...
验证码 换一张
取 消