Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 910891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:06:49+00:00 2026-05-15T17:06:49+00:00

Ok so I’ve got my Drop down list databound to an sql data source,

  • 0

Ok so I’ve got my Drop down list databound to an sql data source, now I need to change the data in a few of the fields before it gets displayed. I’ve been messing with this all morning and I can’t find anything useful, this is what I’ve got so far and it’s clearly not working…

Protected Sub ddlBookType_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlBookType.DataBound
    'ddlBookType.Items.Insert(0, "Any")
    Dim i As Integer
    For i = 0 To ddlBookType.Items.Count - 1
        If ddlBookType.Items(i).Attributes.Equals("mod_cook") Then
            ddlBookType.Items(i).Text.Replace("mod_cook", "Modern Cooking")
        End If
    Next
    End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:06:49+00:00Added an answer on May 15, 2026 at 5:06 pm

    Hey I’ve just done it in C# and converted it into VB (I hope it’s right).

    Here’s the code (

    Protected Sub ddlBookType_DataBound(sender As Object, e As EventArgs)
        Dim ddlBookType As DropDownList = DirectCast(sender, DropDownList)
        For Each item As ListItem In ddlBookType.Items
            If item.Text = "mod_cook" Then
                item.Text = "Modern Cooking"
            End If
        Next
    End Sub
    

    And here’s the original C# code

    protected void ddlBookType_DataBound(object sender, EventArgs e)
    {
        DropDownList ddlBookType = (DropDownList)sender;
        foreach (ListItem item in ddlBookType.Items)
        {
            if (item.Text == "mod_cook")
            {
                item.Text = "Modern Cooking";
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
i got an object with contents of html markup in it, for example: string
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.