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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dropdown and Radiobutton Index

Dropdown and Radiobutton Index

Scheduled Pinned Locked Moved ASP.NET
csharpdatabase
4 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.
  • R Offline
    R Offline
    Rajiya
    wrote on last edited by
    #1

    Hi, Can anyone please write the functions given below using C#.Now i have writen them in VB.NET. Public Function getIndex(ByVal ddList As RadioButtonList, ByVal val As String) As Integer Dim i As Integer Dim str As String For i = 0 To ddList.Items.Count - 1 str = ddList.Items(i).Value.Trim If str = val Then Return i End If Next Return 0 End Function Public Function getIndex(ByVal ddList As DropDownList, ByVal val As String) As Integer Dim i As Integer For i = 0 To ddList.Items.Count - 1 If ddList.Items(i).Value = val Then Return i End If Next Return 0 End Function It's a bit urgent. Thanks RIZ

    H P 2 Replies Last reply
    0
    • R Rajiya

      Hi, Can anyone please write the functions given below using C#.Now i have writen them in VB.NET. Public Function getIndex(ByVal ddList As RadioButtonList, ByVal val As String) As Integer Dim i As Integer Dim str As String For i = 0 To ddList.Items.Count - 1 str = ddList.Items(i).Value.Trim If str = val Then Return i End If Next Return 0 End Function Public Function getIndex(ByVal ddList As DropDownList, ByVal val As String) As Integer Dim i As Integer For i = 0 To ddList.Items.Count - 1 If ddList.Items(i).Value = val Then Return i End If Next Return 0 End Function It's a bit urgent. Thanks RIZ

      H Offline
      H Offline
      hemant kaushal
      wrote on last edited by
      #2

      Use this Link http://www.developerfusion.co.uk/Utilities/[^

      1 Reply Last reply
      0
      • R Rajiya

        Hi, Can anyone please write the functions given below using C#.Now i have writen them in VB.NET. Public Function getIndex(ByVal ddList As RadioButtonList, ByVal val As String) As Integer Dim i As Integer Dim str As String For i = 0 To ddList.Items.Count - 1 str = ddList.Items(i).Value.Trim If str = val Then Return i End If Next Return 0 End Function Public Function getIndex(ByVal ddList As DropDownList, ByVal val As String) As Integer Dim i As Integer For i = 0 To ddList.Items.Count - 1 If ddList.Items(i).Value = val Then Return i End If Next Return 0 End Function It's a bit urgent. Thanks RIZ

        P Offline
        P Offline
        Prasad Babu A
        wrote on last edited by
        #3

        Hi, Plz find C# code. public int getIndex(RadioButtonList ddList, string val) { int i; string str; for (int i = 0; i <= ddList.Items.Count - 1; i++) { str = ddList.Items(i).Value.Trim; if (str == val) { return i; } } return 0; } public int getIndex(DropDownList ddList, string val) { int i; for (int i = 0; i <= ddList.Items.Count - 1; i++) { if (ddList.Items(i).Value == val) { return i; } } return 0; } I hope this will helps u. Bye Pessi.

        R 1 Reply Last reply
        0
        • P Prasad Babu A

          Hi, Plz find C# code. public int getIndex(RadioButtonList ddList, string val) { int i; string str; for (int i = 0; i <= ddList.Items.Count - 1; i++) { str = ddList.Items(i).Value.Trim; if (str == val) { return i; } } return 0; } public int getIndex(DropDownList ddList, string val) { int i; for (int i = 0; i <= ddList.Items.Count - 1; i++) { if (ddList.Items(i).Value == val) { return i; } } return 0; } I hope this will helps u. Bye Pessi.

          R Offline
          R Offline
          Rajiya
          wrote on last edited by
          #4

          Thanks a lot for ur help

          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