Convert to character from ASCII values in Dropdownlist

Hi,

I want to bind data to asp dropdownlist.

and data in tables contains following data ...

aaaa&#153

bbbb&#174

cccc&#174 and so on.. 

my problem is when i bind it to dropdownlist i get item which contains ascii values...as it is.

I wanted to convert them to respective keyword....but not able to find any lead...

So suggest some links/ideals ....   


Regards
Amit
0
thakur_amit
6/27/2007 1:26:02 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

5 Replies
988 Views

Similar Articles

[PageSpeed] 59
Get it on Google Play
Get it on Apple App Store

Dont know but this might help

AscW(char)

 ChrW(char)

Eric

0
eseidel
6/27/2007 8:28:23 PM

 Hi Eric,

I tried you suggestion but still not getting result.

Let me know if have any other solution/suggestion. 

 


Regards
Amit
0
thakur_amit
6/28/2007 9:14:56 AM

any help? 


Regards
Amit
0
thakur_amit
6/28/2007 2:23:51 PM

Here is an example with 2 DropDownLists binded to the same ASCII values and after that only items from the first one have been converted to characters:

    protected void Page_Load(object sender, EventArgs e)
    {
        DropDownList DropDownList1 = new DropDownList();
        DropDownList DropDownList2 = new DropDownList();
        form1.Controls.Add(DropDownList1);
        form1.Controls.Add(DropDownList2);
       
        DropDownList1.Items.Add("«");
        DropDownList1.Items.Add("»");
        DropDownList1.Items.Add("¼");
        DropDownList2.Items.Add("«");
        DropDownList2.Items.Add("»");
        DropDownList2.Items.Add("¼");
        foreach (ListItem li in DropDownList1.Items)
        {
            li.Text = Server.HtmlDecode(li.Text);
        }
    }

0
kipo
6/28/2007 2:47:12 PM

It's seems that ascIIencoding class is exactly what you are after. To transform an ascii code to a char/or even string, i suggest you try:  ascIIencoding.getchars()  or ascIIencoding.getstring()

you may find more info. at : http://msdn2.microsoft.com/en-us/library/system.text.asciiencoding.aspx

Hope my suggestion helps


Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
Bo
7/3/2007 6:56:31 AM
Reply:

Similar Artilces:

How to get the ascii value of a character?
I have a sle on a window in which i type the characters alt+128, alt+129, alt+130 I would expect the ascii values to be respectively 128,129 and 130 However when I check the ascii value using ASC function I get the values 199, 252 and 233 Why? and how can I get the ascii value that I expected? Any help will be greatly appreciated. Arnoud Url: http://www.gloriant.be I noticed that when I type alt+0128, alt+0129 etc. and call the ASC function I do get the expected result. "Arnoud Oortwijk" <gloriant_NOSPAM@skynet.be> wrote in message news:jrN4Oqb2CH...

To get the actual character of a password string, when its Ascii value is greater than 101
Hello friends, I have a problem decrypting my password string to know the actual characters. I am using VB.Net 2005 and Sql Server 2000. I am performing following code to encrypt the password characters entered by the user: Dim str As String = "fgh"     'Just for example Dim str_new As String = "" Dim st As String For i As Int32 = 0 To str.Length - 1 st = Convert.ToChar(Asc(str.Chars(i)) + 25).ToString() str_new = str_new + st Next  'Finally, this "str_new" string is saved to sql server database table using a ...

DropDownList
<%@ Page Explicit="True" Language="VB" Debug="True" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <HTML> <Script Runat="Server"> Dim aConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" _ & server.mappath("Group17.mdb") Sub Page_Load(Sender As Object, E As EventArgs) Dim aConnection As OleDbConnection Dim aQuery, bQuery As String Dim aDataReader, bDataReader As O...

Get The Value Of DropdownList Box Display Value
I've a DW with a dropdown listbox. For some reason I would like to get the value of my Dropdown Listbox "display value". So can you tell me how...? Thanks Hi, What we do is creating a computed field containing a 'lookupdisplay()' call for that column. You can then access this computed field for getting the display value. HTH -- Met vriendelijke groet, - Eric Aling [TeamSybase], Cypres Informatisering bv, The Netherlands Eric's Home & PB Site @ http://utopia.knoware.nl/users/cypr115 sofian <sofianlutfi@hotmailcom> wrote in message...

How can I get a value from defined(third Value) from dropdownlist
I have a dropdown list and Query. query like this SELECT     ID, TypeTitle, TypeDef, definedFROM       Type I can get values from ID(first value) and TypeTitle(secord value)  when I select a item in the dropdown list using  functionPublic Sub DropDownList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList.SelectedIndexChanged How can I get a value from defined(third Value) from dropdownlist in same function Usually, you have DataTextField and DataValueField for a dropdownlis...

DropDownLists w/ Database Values - NOT Getting Values
I have a web form for entry and update purposes. On the form, I have some dropdownlists that allows the user to enter one of three options. When users need to update the values in the database, I would like the values from the database to be shown. I believe my logic is correct, but nothing is shown on Page_Load, i.e. the dropdownlists are blank! Here is part of my code: 'Only part of the code is shown for brevity Sub BindData() If Not IsPostBack Then ddlQuestion1.Items.Add(New ListItem("N/A", 1)) ddlQuestion1.Items.Add(New ListItem("Ye...

how to get SELECTED VALUE of parent dropdownlist to target dropdownlist using cascading
Hi All, I am using C# , asp.net2.0 , Ajax1.0 i am filling dropdownlist using cascading ajax extender. i taken help of ajax site and build a code to fill the control. my question is how do i get parent selected item value. my web service code to fill target value public CascadingDropDownNameValue[] GetProd(string knownCategoryValues , string category) {StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); //string subgrp ; //int sub1; //if (!kv.ContainsKey("Prod") || !Int32.TryParse(kv["Prod"], out sub1)) //// if (...

Cannot get value from dropdownlist
 I tried to use this.DropDownList1.SelectedValue this.DropDownList1.SelectedItem.ValueBut, none of those will get any value from my db...Does anyone know how to solve this problem??? ===c# code===  SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString); SqlCommand command = new SqlCommand("select ProductPicture, ProductName,ProductPrice from tblProduct where ProductCategoryID = " + this.DropDownList1.SelectedItem.Value, connection); SqlDataAdapter ada = new SqlDat...

how to get value in dropdownlist?
Hi, I having problem to get the selected value in dropdownlist in gridview, pls help!   It has error 'Object reference not set to an instance of an object.'  Below is the code:protected void Confirm_Click(object sender, System.EventArgs e) {foreach (GridViewRow gvr in GridView1.Rows) {DropDownList ddl = (DropDownList)gvr.FindControl("ddlApprove");if (ddl.SelectedItem.ToString ()=="Approve")            <--------------------------here the line which got error {Response.Write("true&q...

Converting classic to .NET 2 code, and .NET gets an error back from ADS?
 For future-proofing, our Internal Phone Directory is being moved onto our AD servers, and obviously we're using LDAP for queries.To get the phoneboook queries working, I adapted the current classic ASP code to use LDAP, and that works fine. However, we're wanting to move these pages to .NET, and that's where the problem comes in. Using the same basic logic from the Classic code (90% of its unchanged) to produce an LDAP query, I get the error  155 Unknown error (0x80005000)This is using the same website, and so the same credentials  - unless aspx pages run und...

used a c#.net to vb.net converter and am now getting a syntax error.
ok I used a cool utility at http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert some c#.net to vb.net and it spit out a bunch of code which almost works but I am getting a syntax error on this line Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) I tried it that way and also like Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) but either way gave the same error Compiler Error Message: BC30035: Syntax error. Source Error: Line 26: Line ...

Error converting characters into server's character set. Some character(s) could not be converted.
Error converting characters into server's character set. Some character(s) could not be converted. No changes made to database. UPDATE Ticket_detail SET problem = 'mecho Team, I have set up several table repdefs in our test environment (PROD_jam) to determine the benefit of having table repdefs in addition to a database repdef. After I set up one of the table repdefs I ran several updates on the primary table to verify whether the where-clause was smaller on the replicate database. When I reviewed the transaction in the outbound queue on the secondary rep server (T...

Getting values from dropdownlist
I've a query in gridiew. I'm having gridview which has two fields. One is boundfield and another is Templatefield. In that Templatefield, i've placed a placeholder. In the code-behind i'm dynamically binding the controls either dropdown or textbox to that placeholder. The value of dropdown differs for each row. how'll i get the values of dynamic controls in the code-behind file. I'm working in c# and Asp.net 2.0. if you are looping through all the rows in the grid view you could try:For Each item As GridViewRow In GridView1.Rows If item.RowType = DataControlRowTyp...

Default value for Dropdownlist that get's it's value from Database.
Hi, I am using an Object Data Souce to retrieve the value of a Dropdownlist from a table on MS SQL server 2005. I want to make a default value appear on the Dropdownlist intially, should i enter the default value into the database table or is that a better way of doing it? Any suggestions will be very much appreciated. E  No need for database just set sekected value after databingind protected void Page_Load(object sender, EventArgs e) { DataBind(); ListItem defaultItem = new ListItem("Select a Person", "-1"); th...

Web resources about - Convert to character from ASCII values in Dropdownlist - asp.net.getting-started

Tag Synonyms - Stack Overflow
Q&A for professional and enthusiast programmers

Accidental entities - what about the UI?
This post is a follow-up to my previous blog post " Accidental entities - you don't need that identity ". In that post, we followed a consultant ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Air Astana - Join Now
Thank you for considering membership of Nomad Club – Kazakhstan’s first Frequent Flyer Program. You could soon be on your way to earning free ...

Languages -> C# Articles, Tutorials, Examples: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Blog - Avisra
Avisra Web Development Home Blog Services Contact The Blog Latest Module Builder: How can we make it better? Sitefinity by Chris on July 2, 2013 ...

Online Booking Tool Support
This Online Booking Tool Support page might help you as you navigate through the process of booking travel through your OBT provided by CWT. ...

@Html and beyond
... ); } return string .Format( “{0}{1}” , me.Member.Name, id); } The Html building methods are quite simple. Building a dropdownlist for a ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Unit Testing DateTime.Now Without Isolation
public virtual void SeedWithYearsSince(DropDownList list, int year){ for (int index = year; index

Resources last updated: 2/8/2016 10:12:01 PM