Click here to Skip to main content
15,912,021 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friend,

i am writing a function where i need to pass the below string as parameter.

but i can't because if i set this value to vaiable then varible shows null value.
string is as below.
HTML
"<test>"

ASP
 dim strpev
   strpev="<test>"

response.write strprv


above code's output is null why?
is there any other way to set this value to variable? so i can pass this variable to asp funtion..

thanks in advance..
Posted
Updated 11-Jul-12 0:09am
v3

Check the name -> You mixup strpev and strprv

Put OPTION EXPLICIT as first line in every code file to make sure this is checked on execution.

Good luck!
 
Share this answer
 
Comments
ssd_coolguy 11-Jul-12 6:08am    
thanks for reply..
when i add option explicit in it..it's working fine... :)
thanks.. i was fighting for this since 1 hr.. :(
Espen Harlinn 11-Jul-12 11:00am    
5'ed!
ssd_coolguy 17-Jul-12 3:26am    
means i was trying :)
The output is not null, if you view the souce, you will see <test>, which is not displayed on the browser. To show "<" & ">", you need to use & lt; and & gt; (replace space between & and lt/gt) the folllowing:

VB
strprv ="<test>"
 
Share this answer
 
Comments
ssd_coolguy 11-Jul-12 6:06am    
thanks for reply..
yes.. you are right i can view it in view source. :) and when i replaced it with lt/gt.. then i am able to view it.. :)
HTML Encode it to use it as is, or else it is considered a tag.
Try:
VB
Dim strpev As String
strpev = "<test>"
 
Share this answer
 
Comments
ssd_coolguy 11-Jul-12 6:06am    
thanks for reply..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900