The TRIMs may not be needed, esp. if the PHP code wasn't doing equivalent.
Ditto the use of Server.URLEncode.
But neither will hurt.
Hope you noticed the close resemblance of the code to AJAX in JavaScript. Microsoft actually was doing it like this way back in about 1997, long before AJAX came along.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Last edited by Old Pedant; 02-17-2012 at 09:32 PM..
Thank so mush for your clear help. Yes not really in need for Trim and Server.URLEncode but because it don't harm anyone so I leave it as is. Still a simple question is that code can be inserted in any asp or aspx file ? I want the code for both ASP 3.0 as well as ASP.NET ?
asp is very differnt than asp.net (.asp .aspx) asp uses vbscript and while it may be close to vb.net (aspx/asp.net) it still is different in a lot of ways... you also have more options in .net such as C# (and then there are the obscure ones like J# and F#) - vb will prob be the easiest for you since you are moving from vbscript (well provided that is what you are doing)
If you don't know how to write ASP.NET code, then you should avoid this stuff until you understand ASP.NET a *LOT* better. Even if this code worked with ASP.NET (and it could work, with only a few changes), what would you then do with the contents? With ASP.NET that won't be a simple answer.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
I was confused and thinking that ASP/ASP.NET is a single language. That true that it need serious knowledge and not translating like that, the situation is that I am working with php "You can see that the url is pointing to a php script" that I have experience with but this is a single process that must be run from server running ASP that is all the story
It would be awesome if someone post to me the code translation for both VB and C#.
Is it :
url = "http://externalwebsite.com/script.php?temp1=" & Server.URLEncode(var1) _SPACE &SPACE "temp2=" & Server.URLEncode(var2) OR
url = "http://externalwebsite.com/script.php?temp1=" & Server.URLEncode(var1)NOSPACE_&NOSPACE"temp2=" & Server.URLEncode(var2)
Hope you noticed the close resemblance of the code to AJAX in JavaScript. Microsoft actually was doing it like this way back in about 1997, long before AJAX came along.
Ajax was introduced by Microsoft in Internet Explorer 4 in 1997 - it was only the name Ajax that came along later. The activeX object that many people still test for in setting up Ajax calls was the way that IE4 through 6 provided for doing Ajax calls.
I was confused and thinking that ASP/ASP.NET is a single language. That true that it need serious knowledge and not translating like that, the situation is that I am working with php "You can see that the url is pointing to a php script" that I have experience with but this is a single process that must be run from server running ASP that is all the story
It would be awesome if someone post to me the code translation for both VB and C#.
Is it :
url = "http://externalwebsite.com/script.php?temp1=" & Server.URLEncode(var1) _SPACE &SPACE "temp2=" & Server.URLEncode(var2) OR
url = "http://externalwebsite.com/script.php?temp1=" & Server.URLEncode(var1)NOSPACE_&NOSPACE"temp2=" & Server.URLEncode(var2)
Thank You
I still don't know what you are trying to do... are you trying to do asp or aspx? you seem to contradict your definitions... C# does not exist in classic asp- it is (for all tense and purpose) vbscript which is extremely similar to vb but not exactly the same
Ajax was introduced by Microsoft in Internet Explorer 4 in 1997 - it was only the name Ajax that came along later. The activeX object that many people still test for in setting up Ajax calls was the way that IE4 through 6 provided for doing Ajax calls.
Yes, my only point was that the ActiveX object was available *SERVER SIDE* in 1997, for use in ASP, at the same time it appeared in MSIE. (microsoft.XMLHTTP was later refined to provide the msxml2.ServerXMLHTTP, but most of the usage remained the same.)
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Is it :
url = "http://externalwebsite.com/script.php?temp1=" & Server.URLEncode(var1) _SPACE &SPACE "temp2=" & Server.URLEncode(var2) OR
url = "http://externalwebsite.com/script.php?temp1=" & Server.URLEncode(var1)NOSPACE_&NOSPACE"temp2=" & Server.URLEncode(var2)
NEITHER.
When you put it all on one line, you REMOVE the underline characters.
VBScript uses an underline at the end of a line to mean that the code is continued on the next line.
Look, you clearly should *NOT* be doing this, even in ASP code. It's obvious that you don't know enough about ASP to even use the code I gave you in creating the rest of the page.
If you aren't willing to take the time to learn ASP (or ASP.NET) then hire somebody to do it for you.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Thank You for clarification about underline. I need this code that I have posted in the first post only to be converted into C# and Visual Basic. If I make programs by those languages then I will learn them so please just this code above, and I will not post further codes because this is the only code I am in need for translation.
Hi bro, regarding your code as well You know that the & symbol should be present in the url so I guess you forget the & to be included so the line should be "I suppose the url is in a single line okay"
I'm not going to attempt to translate that to VB.NET or C# until you can explain why you *possibly* would need it it *BOTH* those languages. Choose one. No reason to use both.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
There is no need for you to past to me the neither the C# or VB conversion of this source code. Fortunately I succeed to establish it my self after a little learning. I am glad for that so the only hard thing that remain for me and the last thing I can ask someone for help is to convert this code to Java Server Pages code. Unfortunately there is a few few documentation about JSP on the web in comparison to MS .NET.
Thank you for your help and hope to hear you.
PS : I wouldn't like to create a new topic in the JSP forum to not pollute the forums with the seem topic.