473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Proper Way to add tbxXXX.Text to URL

Thank you in advance for any and all assistance. It is greatly appreciated.

What is the proper way to add textboxes to a URL so that the the text is
part of the URL? is it a "+" sign or the "&" ampersign?

https://secure.plimus.com/jsp/valida...ion=REGISTER--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
Sep 12 '06 #1
4 2715
"eSolTec, Inc. 501(c)(3)" <es*****@noemail.nospamschrieb:
What is the proper way to add textboxes to a URL so that the the text is
part of the URL? is it a "+" sign or the "&" ampersign?

https://secure.plimus.com/jsp/valida...ion=REGISTER--
If the URL is stored as a string, you can use the '&' operator:

\\\
Dim Url As String = ...
Url &= "bla"
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Sep 12 '06 #2
Herfried,

Thank you for your quick response. What would cause a textbox not to display
it's contents as the concatenated information. All I'm seeing is the URL
which is converted to a string and then = tbxLicense.Text and not the
contents of the textbox? HELP
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
"Herfried K. Wagner [MVP]" wrote:
"eSolTec, Inc. 501(c)(3)" <es*****@noemail.nospamschrieb:
What is the proper way to add textboxes to a URL so that the the text is
part of the URL? is it a "+" sign or the "&" ampersign?

https://secure.plimus.com/jsp/valida...ion=REGISTER--

If the URL is stored as a string, you can use the '&' operator:

\\\
Dim Url As String = ...
Url &= "bla"
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Sep 12 '06 #3
Michael,
You need to build a string expression, it appears that you have a single
string.

Something like:
Dim url As String = _
"https://secure.plimus.com/jsp/validateKey.jsp?productId=" _
& tbxUser.text & "&key=" & tbxLicense.text & _
"&action=REGISTER--"

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"eSolTec, Inc. 501(c)(3)" <es*****@noemail.nospamwrote in message
news:03**********************************@microsof t.com...
| Herfried,
|
| Thank you for your quick response. What would cause a textbox not to
display
| it's contents as the concatenated information. All I'm seeing is the URL
| which is converted to a string and then = tbxLicense.Text and not the
| contents of the textbox? HELP
| --
| Michael Bragg, President
| eSolTec, Inc.
| a 501(C)(3) organization
| MS Authorized MAR
| looking for used laptops for developmentally disabled.
|
|
| "Herfried K. Wagner [MVP]" wrote:
|
| "eSolTec, Inc. 501(c)(3)" <es*****@noemail.nospamschrieb:
| What is the proper way to add textboxes to a URL so that the the text
is
| part of the URL? is it a "+" sign or the "&" ampersign?
|
|
https://secure.plimus.com/jsp/valida...ion=REGISTER--
| >
| If the URL is stored as a string, you can use the '&' operator:
| >
| \\\
| Dim Url As String = ...
| Url &= "bla"
| ///
| >
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
| >
| >

Sep 12 '06 #4
Hello Michael,

If what you want is to embed some text string(get from a TextBox's Text
property) into an existing url string, you can use string concatenate like:

================
Dim url As String = "http://www.test.org/site1/default.aspx"
url = url & "?param1=" & TextBox1.Text
==================
#for VB.NET, you should use "&" char to concatenate string while in C#, you
should use "+"
You can also use String.Format method to create template based string text.
e.g.

========================
Dim urltmp As String =
"http://www.asp.net/default.aspx?param1={0}&param2={1}"
Dim url As String = String.Format(urltmp, TextBox1.Text, TextBox2.Text)
========================

In addition, if the text you want to append into url querystring will
contains some particular characters (such as "&", "+", or wide chars...), I
suggest you use HttpUtility.UrlEncode method to encode it before append
them into url.

#HttpUtility.UrlEncode Method
http://msdn2.microsoft.com/en-us/lib...y.urlencode.as
px

e.g.

====================
Dim urltmp As String =
"http://www.asp.net/default.aspx?param1={0}&param2={1}"
Dim url As String = String.Format(urltmp,
HtmlUtility.UrlEncode(TextBox1.Text), HtmlUtility.UrlEncode(TextBox2.Text))
====================

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: T. Kaufmann | last post by:
Hi there, I have some lines of code in a Tkinter programm - I want to list every single file of a zip-archive in a Text widget: fp = os.popen("%s %s" % ('unzip -vl ', 'anyarchiv.zip', 'r')...
1
by: Vlajko Knezic | last post by:
Not so sure what is going on here but is something to do with the way UTF8 is handled in Perl and/or LibXML The sctript below: - accepts a value from a form text field; - ...
14
by: Viken Karaguesian | last post by:
Hello all, It stinks being a newbie! One thing that I'm not sure about with CSS is: where is the "proper" place to put font attibutes? This has me a little confused. Take the below style sheet...
3
by: m.ramana | last post by:
Given a string it should convert it to a proper text. Example: if you passed a string 'Cat in the hat', I want 'Cat In The Hat' Curious about few things, Does sql have Instr OR Split(like VB)...
1
by: RC | last post by:
I have an Access 2002 database with many tables and forms (but just to keep things simple, let's say the DB has one Table "Table1" and one Form "Form1"). I have managed to cobble together so much...
0
by: bj | last post by:
hello is there any chance to get proper char width for class derived from user control - im working over text editing control, so i need proper width of every character for currently selected...
7
by: John A Grandy | last post by:
does anyone know of an intrinsic .NET function , or font , or other mechanism , to do "proper-case all-caps" ... ? so, for a name like "Arnold Schwarzenegger" ... .... I want it entirely in...
0
drhowarddrfine
by: drhowarddrfine | last post by:
The Doctype or DTD Many coders get confused by all the talk of doctypes and how they affect browsers and the display of their web pages. This article will get right to the point about doctypes...
4
by: bbawa1 | last post by:
It is giving me error that input string is not in proper format. What's wrong. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.