string and less then symbol

T

Tony M

having trouble posting question so I apologies if it's repeated.

vs 2005 - webforms - vb .net

I'm trying to learn how to post a form (ie send info to PayPal)
When I use the strings below (partial code), paypal returns an error to me.

I tried (from a sample paypal class),

oPayPalForm = "<input type='hidden' name='quantity_" + nItemCount + " '
value=\" & strQuantity + " \ >"
and
oPayPalForm = Chr(60) & "input type='hidden' name='quantity_" + nItemCount +
" ' value=\" & strQuantity + " \ >"


neither way works, so I'm trying to figure out why.

Both statements return a char length of 52, but I cannot display the
contents in a label. ie (label1.text = oPayPal) displays nothing.

It's the < char. if I remove it I can see the string, when I add it back
nothing is displayed.

So I'm not sure what the resulting form post looks like?

The original sample (class) used stringbuilder and the same problems exist.


Thanks
 
T

Tony M

Much easier way to ask.
label1.text = "<"
displays
<
Label1.text = "<i "
Label1.text += " K"
displays nothing
As soon as you add anything (char) to "<" nothing is displayed?
What the heck am I doing wrong?

Thanks
 
T

Tony M

It works correct if I put a space after the <


Tony M said:
Much easier way to ask.
label1.text = "<"
displays
<
Label1.text = "<i "
Label1.text += " K"
displays nothing
As soon as you add anything (char) to "<" nothing is displayed?
What the heck am I doing wrong?

Thanks
 
R

rowe_newsgroups

having trouble posting question so I apologies if it's repeated.

vs 2005 - webforms - vb .net

I'm trying to learn how to post a form (ie send info to PayPal)
When I use the strings below (partial code), paypal returns an error to me.

I tried (from a sample paypal class),

oPayPalForm = "<input type='hidden' name='quantity_" + nItemCount + " '
value=\" & strQuantity + " \ >"
and
oPayPalForm = Chr(60) & "input type='hidden' name='quantity_" + nItemCount +
" ' value=\" & strQuantity + " \ >"

neither way works, so I'm trying to figure out why.

Both statements return a char length of 52, but I cannot display the
contents in a label. ie (label1.text = oPayPal) displays nothing.

It's the < char. if I remove it I can see the string, when I add it back
nothing is displayed.

So I'm not sure what the resulting form post looks like?

The original sample (class) used stringbuilder and the same problems exist.

Thanks

Are you trying to display rendered html in the label or just the
string? If the later you need to look into the Server.HtmlEncode and
Server.HtmlDecode methods to prevent the string from being parsed as
html.

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top