0

could be this is an HTML problem, but I'll take the help anywhere I can find it...

<%
@ Page Language = "VB" aspcompat=true Explicit="True" 
Dim src As String = " bet "
%>

<html>
<head ></head>
<body >

<form name=loc action=testsac.aspx method=get>
<table class=s0 width=100% cellpadding=1 cellspacing=1 align=center border=1>
  <tr class=s0 align=center>
    <td>
    Search For:
    <input class=s0 size=50 name=src  value=<%=src%>>
    <input class=s0 type=submit value=Search />
    <td></td>
  </tr>
</table>
</form>

</body>
</html>

on the screen, "bet" is the search string, but I want " bet "
any ideas?

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by jimib
0

Try this:

Dim src As String =  Chr(32) & "bet" & Chr(32)

Not sure if it will solve your problem, but it appears as though it is being trimmed (trim())...

0

Try this:

Dim src As String =  Chr(32) & "bet" & Chr(32)

Not sure if it will solve your problem, but it appears as though it is being trimmed (trim())...

No, really it's a variable, which may or may not contain the leading and trailing spaces. When you assign as the value of a textbox, it is automatically trimmed. I'm looking for some kind of way to override that and leave the blanks in there.

1

Okay I see your issue now...

<html>
<head ></head>
<body >

<form name=loc action=testsac.aspx method=get>
<table class=s0 width=100% cellpadding=1 cellspacing=1 align=center border=1>
  <tr class=s0 align=center>
    <td>
    Search For:
    <input class=s0 size=50 name=src  value="&nbsp;<%=src %>&nbsp;">
    <input class=s0 type=submit value=Search />
    <td></td>
  </tr>
</table>
</form>

</body>
</html>

It worked for me in Firefox 3.5

Edited by sinnerFA: n/a

Votes + Comments
The quotation marks are needed...
0

I solved this problem myself.
The answer is:

<input size=50 name=src  value="<%=src%>">

instead of

<input size=50 name=src  value=<%=src%>>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.