Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. radiobuttonlist with image

radiobuttonlist with image

Scheduled Pinned Locked Moved ASP.NET
databasedesignsysadmintutorialannouncement
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    creative77
    wrote on last edited by
    #1

    hi i m using radiobuttonlist with images like this <asp:RadioButtonList ID="rbtnthumb1" runat="server"> <asp:ListItem Value ="News_icon.jpg"> <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News</asp:ListItem> <asp:ListItem Value ="imageicon.bmp"><img src="images/imageicon.bmp" alt="Image" align="absmiddle">Image</asp:ListItem> <asp:ListItem Value ="Video97.gif" ><img src="images/Video97.gif" alt="Video" align="absmiddle">Video</asp:ListItem> </asp:RadioButtonList> In design view it show radiobuttonlist with images but when i use insert query.it stored this value in mytable <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News but i only want to store News_icon.jpg(image file name)and i m using this way for adding value cmd.Parameters.AddWithValue("@ChooseThumbnail", rbtnthumb1.SelectedItem.Text) please let me know how to stroe only imagefile name in database table regard's

    C A 2 Replies Last reply
    0
    • C creative77

      hi i m using radiobuttonlist with images like this <asp:RadioButtonList ID="rbtnthumb1" runat="server"> <asp:ListItem Value ="News_icon.jpg"> <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News</asp:ListItem> <asp:ListItem Value ="imageicon.bmp"><img src="images/imageicon.bmp" alt="Image" align="absmiddle">Image</asp:ListItem> <asp:ListItem Value ="Video97.gif" ><img src="images/Video97.gif" alt="Video" align="absmiddle">Video</asp:ListItem> </asp:RadioButtonList> In design view it show radiobuttonlist with images but when i use insert query.it stored this value in mytable <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News but i only want to store News_icon.jpg(image file name)and i m using this way for adding value cmd.Parameters.AddWithValue("@ChooseThumbnail", rbtnthumb1.SelectedItem.Text) please let me know how to stroe only imagefile name in database table regard's

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      What have you tried ? How much do you know about the languages you're using ? What do you think the solution might be ? Seems to me like the most likey solution is to use some string mashing to extract the value, or a regex.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      C 1 Reply Last reply
      0
      • C creative77

        hi i m using radiobuttonlist with images like this <asp:RadioButtonList ID="rbtnthumb1" runat="server"> <asp:ListItem Value ="News_icon.jpg"> <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News</asp:ListItem> <asp:ListItem Value ="imageicon.bmp"><img src="images/imageicon.bmp" alt="Image" align="absmiddle">Image</asp:ListItem> <asp:ListItem Value ="Video97.gif" ><img src="images/Video97.gif" alt="Video" align="absmiddle">Video</asp:ListItem> </asp:RadioButtonList> In design view it show radiobuttonlist with images but when i use insert query.it stored this value in mytable <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News but i only want to store News_icon.jpg(image file name)and i m using this way for adding value cmd.Parameters.AddWithValue("@ChooseThumbnail", rbtnthumb1.SelectedItem.Text) please let me know how to stroe only imagefile name in database table regard's

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Use this : cmd.Parameters.AddWithValue("@ChooseThumbnail", rbtnthumb1.SelectedValue) If you call SelectedItem.Text it will return the innerhtml under the listitem. On the other hand if you call SelectedValue, it will return the value attribute assigned in asp:ListItem. Hope you like it. Another thing it is better to write like <img src="images/Video97.gif" alt="Video" align="absmiddle" /> You havnt closed any img tag using /> on the right. :rose::thumbsup:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        1 Reply Last reply
        0
        • C Christian Graus

          What have you tried ? How much do you know about the languages you're using ? What do you think the solution might be ? Seems to me like the most likey solution is to use some string mashing to extract the value, or a regex.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          C Offline
          C Offline
          creative77
          wrote on last edited by
          #4

          thanks for reply i m beginner and trying to save a imgefilename in database with radiobuttonlist.i do't know may be my approach wrong or right can you tell me right concept about my question ? if i m doing wrong then what is the right way mustafa

          C 1 Reply Last reply
          0
          • C creative77

            thanks for reply i m beginner and trying to save a imgefilename in database with radiobuttonlist.i do't know may be my approach wrong or right can you tell me right concept about my question ? if i m doing wrong then what is the right way mustafa

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            creative77 wrote:

            i m beginner

            Then this task is way too complex for you. You should abandon it, and spend some time learning basic exercises instead. Except you're being paid for this code, right ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups