473,796 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server.HTMLEnco de

Simple but not working at this moment

I have to fill the HTML select control....

my values could be for example "test number 1"

sample code,

dim x
Data = "test number 1"

I am using

<Select>
<option value="<%Respon se.Write server.HTMLEnco de(Data)%>"><%R esponse.Write
server.HTMLEnco de(Data)%></option>
</Select>

as a result I can not see the longer black space between 2 words....I guess
HTMLEncode is not emitting &nbsp

any solution

thanks
Jul 22 '05 #1
4 4088
Its because of the control you are using... its rendering the &nbsp;

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"abcd" <ab**@abcd.co m> wrote in message
news:uO******** ******@tk2msftn gp13.phx.gbl...
Simple but not working at this moment

I have to fill the HTML select control....

my values could be for example "test number 1"

sample code,

dim x
Data = "test number 1"

I am using

<Select>
<option value="<%Respon se.Write
server.HTMLEnco de(Data)%>"><%R esponse.Write
server.HTMLEnco de(Data)%></option>
</Select>

as a result I can not see the longer black space between 2 words....I
guess HTMLEncode is not emitting &nbsp

any solution

thanks

Jul 22 '05 #2
DO you mean drop down list doesn not display &nbsp;
Curt_C [MVP] wrote:
Its because of the control you are using... its rendering the &nbsp;
"abcd" <ab**@abcd.co m> wrote in message
news:uO******** ******@tk2msftn gp13.phx.gbl...
Simple but not working at this moment

I have to fill the HTML select control....

my values could be for example "test number 1"

sample code,

dim x
Data = "test number 1"

I am using

<Select>
<option value="<%Respon se.Write
server.HTMLEnco de(Data)%>"><%R esponse.Write
server.HTMLEnco de(Data)%></option>
</Select>

as a result I can not see the longer black space between 2 words....I
guess HTMLEncode is not emitting &nbsp

any solution

thanks

Jul 22 '05 #3
Server.HtmlEnco de does not encode spaces. You will need to use the Replace
function to change spaces to &nbsp;.

Bob Lehmann

"abcd" <ab**@abcd.co m> wrote in message
news:up******** ******@TK2MSFTN GP15.phx.gbl...
DO you mean drop down list doesn not display &nbsp;
Curt_C [MVP] wrote:
Its because of the control you are using... its rendering the &nbsp;
"abcd" <ab**@abcd.co m> wrote in message
news:uO******** ******@tk2msftn gp13.phx.gbl...
Simple but not working at this moment

I have to fill the HTML select control....

my values could be for example "test number 1"

sample code,

dim x
Data = "test number 1"

I am using

<Select>
<option value="<%Respon se.Write
server.HTMLEnco de(Data)%>"><%R esponse.Write
server.HTMLEnco de(Data)%></option>
</Select>

as a result I can not see the longer black space between 2 words....I
guess HTMLEncode is not emitting &nbsp

any solution

thanks


Jul 22 '05 #4
abcd wrote:
Data = "test number 1"
...<option value="<%Respon se.Write
server.HTMLEnco de(Data)%>"><%R esponse.Write
server.HTMLEnco de(Data)%></option> </Select>

as a result I can not see the longer black space between 2 words....I
guess HTMLEncode is not emitting &nbsp

any solution


There is a client-side scripting solution you can put in an onload handler:

for (i=0; i<selObj.length ; i++) selObj[i].text = selObj[i].value


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #5

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

Similar topics

0
1567
by: Hraklhs | last post by:
Is it useful to ALWAYS use Server.HTMLEncode when writing data read from a db? Ex. Response.Write (Server.HTMLEncode(var)) instead of Response.Write var
4
10657
by: Andrea Williams | last post by:
I have a class that imports System.Web.UI.Page. The code below works: public string JScriptEncode(string strValue) { strValue = strValue.Replace(@"'", "\x27"); //' JScript encode apostrophes strValue = strValue.Replace(@"""", "\x22"); //' JScript encode double-quotes
3
4111
by: Michael Gaillez | last post by:
Hi, I'm dynamically loading an assembly into an ASP.NET application. In the control that I load from that dynamic assembly I've tried to use Server.HTMLEncode but this results in a serious performance loss. Is there anyone who knows why or is there an alternative for server.htmlencode method? Without the server.htmlencode the thingy works very fine. greetz
3
5752
by: Mark Rae | last post by:
Hi, The following is lifted straight from the MSDN help topic for HttpServerUtility.HtmlEncode Method --------------------------------------------------------------- The following example encodes a string for transmission by HTTP. It encodes the string named TestString, which contains the text "This is a <Test String>.", and copies it into the string named EncodedString as "This+is+a+%3cTest+String%3e.".
3
1759
by: TCB | last post by:
Hi, There are a couple of things that are bothering me, any help on these is greatly appreciated. This is using ASP.NET 2.0 1. I am sending email in my web app, using a simple form here is the code: Dim MyMailFrom As New Net.Mail.MailAddress("portal@xxx.com", "Portal XX.com") Dim MyMailTo As New Net.Mail.MailAddress("info@xxx.com")
4
4969
by: Fossie | last post by:
Can anyone help with Server.HtmlEncode encoding this? '<%# DataBinder.Eval(Container.DataItem, "CAT_ID", "pageview.aspx?tab=1&catid={0}") %> I've tried using similar to this: <%# Server.HtmlEncode(DataBinder.Eval(Container, "DataItem.Field1").ToString()) %> but get error message BC30455: Argument not specified for parameter '
1
14566
by: Marco Miltenburg | last post by:
While working on some multilingual code I found a rather strange thing happening with Server.HTMLEncode. While loading different languages I change the Codepage and Charset in ASP to reflect the language. This all works fine. However when I tried to use Charset UTF-8 with Codepage 65001 everywhere I found that HTMLEncode always translates all UTF-8 characters to &#xxxx. Example:
1
9524
by: burnsy2000 | last post by:
We are running ASP classic on IIS 5 on W2k SP4. We recently added <% Response.charset="utf-8"%to the top of all our pages (as suggested by validator.w3.org). A problem arose on a page which applies Server.HTMLEncode to a field that was inputted from the user. The problem is that when the user enters a phrase such as: My Fiancé The Server.URLEncode returns the value:
6
2334
by: teddysnips | last post by:
In my application I need to allow users to cut 'n' paste stuff from various sources, some of which might include dodgy characters such as "<". Natch, IE interprets these as potentially dangerous and provides a mechanism to encode/decode them. However I can't seem to get it to work: .... <asp:textbox id=txtDescription style="Z-INDEX: 102; LEFT: 111px; POSITION: absolute; TOP: 124px" tabIndex=29 runat="server" onblur="return...
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10236
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...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
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...
0
6793
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();...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
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
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.