473,407 Members | 2,326 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,407 software developers and data experts.

javascritp problem... handling special char.

hello...

i've got a javascript problem...
my url is created dynamically something like

DeptDetail2.aspx?SubOrgNm=" + SubOrgNm + "&OrgId=" + OrgId + "&SubOrgId=" +
SubOrgId

my problem is that when e.g. suborgnm have the special char of "&" it does
not save this value.. e.g my value would be like this "M&M" it only save M

how can i solve this problem? thanks

Nov 19 '05 #1
1 1215
Hi Asha,

You need to escape the name to prevent the reserved characters from getting
on the querystring. Use Server.UrlEncode() as shown below?

Dim SubOrgNm As String = "M&M"
Dim OrgId As Integer = 5
Dim SubOrgId As Integer = 10
Response.Redirect("DeptDetail2.aspx?SubOrgNm=" +
Server.UrlEncode(SubOrgNm) + "&OrgId=" + OrgId.ToString + "&SubOrgId=" +
SubOrgId.ToString)

It creates something that looks like this:

DeptDetail2.aspx?SubOrgNm=M%26M&OrgId=5&SubOrgId=1 0

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto
"Asha" <As**@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
hello...

i've got a javascript problem...
my url is created dynamically something like

DeptDetail2.aspx?SubOrgNm=" + SubOrgNm + "&OrgId=" + OrgId + "&SubOrgId="
+
SubOrgId

my problem is that when e.g. suborgnm have the special char of "&" it does
not save this value.. e.g my value would be like this "M&M" it only save M

how can i solve this problem? thanks


Nov 19 '05 #2

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

Similar topics

0
by: Muffinman | last post by:
Hi, I've written a program which downloads a number of pages from a certain website. However, it seems to have a problem with special characters. I believe that the following piece of code is...
0
by: thomasamillergoogle | last post by:
I am building a xml file to store a single TCP/IP raw packet. I need to store "special characters" on the file I am working on. When I say "special characters" i am talking about tabs,...
0
by: noor | last post by:
Hi I'm working on linked server which uses db2oledb. When I tried simple select query it didn't ran because the queries condition was based on column having special character. Query was like that...
1
by: Asha | last post by:
hello how does javascript handle char like &? i have a dynamically build link and javascript cant handle values like &? why is taht?
4
by: Kivanc Toker | last post by:
Hi, I've got a problem with displaying texts with turkish characters. There is a website administration system, which is developed using ASP (VBScript) and ADO. This system is being used for...
1
by: EricRybarczyk | last post by:
I am starting a rewrite of an existing Classic ASP web site in ASP.NET 2.0. The existing ASP application has several types of users, each with a separate login process (separate login page,...
3
by: neil | last post by:
Hi, I'm not sure whether this is a known or documented issue (I could'nt turn anything up, but maybe I'm not looking hard enough), but I seem to be have a problem encrypting and decrypting...
0
by: Tom Bennart | last post by:
Hi, my application reads names of jpg files from an existing Access database to convert the image files (change resolution, ratio etc.). Many file names contain german special characters (umlaut)...
2
by: eboy98 | last post by:
if i have a dictionary name number ....and i want to ask the list whether a particular key already exists. {'octal': '1234567', 'binary': '10100101', 'decimal': '1234567890', 'hexadecimal':...
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: 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
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,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.