473,696 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

building url newbie question - HELP:)

Hi - can someone PLEASE tell me what's wrong with the script below. In debug
I verified that 'registrant' has a value. I can't figure our how to build the
URL & this script generates the error "operator + cannot be applied to
operands of type string & method group". MANY THANKS

<a
href='https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant='" + registrant.ToSt ring + ">Confirm Registration</a></p>"
Jul 5 '08 #1
6 2284
On Sat, 05 Jul 2008 16:48:01 -0700, Chris D
<Ch****@discuss ions.microsoft. comwrote:
Hi - can someone PLEASE tell me what's wrong with the script below. In
debug
I verified that 'registrant' has a value. I can't figure our how to
build the
URL & this script generates the error "operator + cannot be applied to
operands of type string & method group". MANY THANKS
Put a pair of parens after "ToString". As in "registrant.ToS tring()".
Jul 6 '08 #2
Hi Peter - thanks for helping but the following :

sBody += "<a
href='https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant='" + this.registrant .ToString() + ">Confirm Registration</a></p>";

still comes back with the Url below yet Debug returns (String) 67 for
'registrant' & the project builds without error

https://dev.onlineforms.phsa.ca/Ccsp...tm?Registrant=

-----------------------------------------------------------------

"Peter Duniho" wrote:
On Sat, 05 Jul 2008 16:48:01 -0700, Chris D
<Ch****@discuss ions.microsoft. comwrote:
Hi - can someone PLEASE tell me what's wrong with the script below. In
debug
I verified that 'registrant' has a value. I can't figure our how to
build the
URL & this script generates the error "operator + cannot be applied to
operands of type string & method group". MANY THANKS

Put a pair of parens after "ToString". As in "registrant.ToS tring()".
Jul 6 '08 #3
On Sat, 05 Jul 2008 20:45:02 -0700, Chris D
<Ch****@discuss ions.microsoft. comwrote:
Hi Peter - thanks for helping but the following :

sBody += "<a
href='https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant='"
+ this.registrant .ToString() + ">Confirm Registration</a></p>";

still comes back with the Url below yet Debug returns (String) 67 for
'registrant' & the project builds without error
https://dev.onlineforms.phsa.ca/Ccsp...tm?Registrant=
I'm having a hard time really understanding your question. There's just
so little context and the question itself is hard to parse.

However, given that you've surrounded the text
"https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant="
with single-quotes, I'm not too surprised that that's what comes back as
the URL. The text you're trying to add to that is outside the
single-quotes and so wouldn't be considered part of the URL (you maybe
should consider yourself lucky you get any URL at all out of that :) ).

Perhaps changing the code to read:

sBody += "<a
href='https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant="
+
this.registrant .ToString() + "'>Confirm Registration</a></p>";

would work better.

Pete
Jul 6 '08 #4
Bingo!!!!! ... :-) You made my day Peter. Huge thanks ... Chris

"Peter Duniho" wrote:
On Sat, 05 Jul 2008 20:45:02 -0700, Chris D
<Ch****@discuss ions.microsoft. comwrote:
Hi Peter - thanks for helping but the following :

sBody += "<a
href='https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant='"
+ this.registrant .ToString() + ">Confirm Registration</a></p>";

still comes back with the Url below yet Debug returns (String) 67 for
'registrant' & the project builds without error
https://dev.onlineforms.phsa.ca/Ccsp...tm?Registrant=

I'm having a hard time really understanding your question. There's just
so little context and the question itself is hard to parse.

However, given that you've surrounded the text
"https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant="
with single-quotes, I'm not too surprised that that's what comes back as
the URL. The text you're trying to add to that is outside the
single-quotes and so wouldn't be considered part of the URL (you maybe
should consider yourself lucky you get any URL at all out of that :) ).

Perhaps changing the code to read:

sBody += "<a
href='https://dev.onlineforms .phsa.ca/Ccsp/CcspConfirmRegi stration.htm?Re gistrant="
+
this.registrant .ToString() + "'>Confirm Registration</a></p>";

would work better.

Pete
Jul 6 '08 #5
url = string.Format(" https://dev.blah.ca/blah?Registrant ={0}",
HttpUtility.Url Encode(registra nt));

01: It's neater to use string.Format
02: You need to use UrlEncode.
Pete

Jul 6 '08 #6

Thanks Peter - much, much cleaner than my string:) Have a good week ... c

"Peter Morris" wrote:
url = string.Format(" https://dev.blah.ca/blah?Registrant ={0}",
HttpUtility.Url Encode(registra nt));

01: It's neater to use string.Format
02: You need to use UrlEncode.
Pete

Jul 7 '08 #7

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

Similar topics

1
1302
by: Ye | last post by:
I have a HTML Help built in my project in visual C++ 6.0, when I transfered the project into .Net, the HTML help can not work. No response after I hit F1 or selected from the menu help. It worked in the visual 6.0, but it does not work in Visual C++ .Net Is there some difference to link a .chm HTML help file between 6.0 and the .Net Thanks in advance
0
1320
by: Knackerud | last post by:
Hi there, I'm building the simplest small web browser, using Visual C++ (2005 Express Edition), making a form, dragging over the WebBrowser from the toolbox, setting the initial URL, and everything else is being done in PHP, server-side. So I've managed to create an exe, which I've put up on the site, and it works for some users, but not others. I've tracked the difference down to - 'you need .net framework 2.0 installed for this to work'....
0
1011
jeffbroodwar
by: jeffbroodwar | last post by:
Hi, i'm currently working on a project that uses java and mysql database. can someone give me code & tutorial on how can i make java (using netbeans) read an xml file that contains the fields of the database in mysql. the goal of the project is to give flexibility to the database used by my system. it's a customer registration system that will allow customer's pick a particular field ex: name,address,ssn,etc. you see not all customer's have...
1
1321
by: pjawde | last post by:
i'm new to this oracle thing!!!! sorry if its a dumbass question but i simply want a menu button that will talk me to certain forms......... i have created the trigger when button pressed and just need to work out the code to go to the form called SHIPMENT help would be appreciated, thanks in advance, phil
2
2659
by: UnderCoverGuy | last post by:
Hello. I am trying to produce a SQL report query that determines the type (model) of system a user has and based off of that information, CASE selects to determine the amount of and type of memory needed to upgrade to 1GB. What I need to do is find a way to tally the information at the end of the report to produce a summary. I was thinking about trying a GROUP BY and SUM on that, but haven't been able to get it to work properly. Any thoughts...
0
830
by: 1druid1 | last post by:
Hi All Our programmer has just left the company for pastures new and I have been left to pick up the pieces, unfortuantly I have never used MS SQL or Visual Studios 2005, but I am now required to support our in house applications, at the moment we are far to busy for me to go on any courses, so I am looking for tutorials or guidance.. At the moment I have a form in VS2005 with three text fields, FName, SName, Age. IN SQL I have a database...
3
1411
by: jonathon | last post by:
Hi. I'm currently making a free medical revision site for medical students. A forum is critical to the development of my site. My sever has phpbb 2.01 which does not support subforums. Is there any way i can make my own custom froum from perl or php. I would greatly appreciate any help or guidance that any one can give. My website is http://www.usmlestudyguide.com. As you can see it is still under construction..
1
1435
by: dsoutherland | last post by:
I am so new to ASP I'm not sure I am breathing. A company one of my clients deals with provides information over the web. They provided the ASP code for a default web site that is used to communicate with them and I have installed it and coded a VB6 app to provide the interface. Here is the problem. The ASP gets an error "Exception occurred" message. When I respond to the error, the returned XML is not received. Also, the ASP stops via the...
3
1244
by: swinuser | last post by:
Hi, i'm VERY new to Access.... i don't even know how to ask... but when you first open an already created database and it only opens the 'switchboard' and doesn't give the option of the tables... don't kow what it's called.... but how do i apply that to the main page... insterad of it opening in access in an editable mode..??? any help would be fantastic
1
1011
by: blackdagger | last post by:
I was making a program, a simple passbook, but I'm kinda new to ADODB...I have a database in MS Access. In my program, I have to type in the account number then by pressing enter key, the name of the owner of the account number and their balance will appear on different textboxes...can anyone help me out??
0
8656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9140
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9005
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5848
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2304
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.