2 Replies - 4158 Views - Last Post: 07 August 2006 - 08:26 PM Rate Topic: -----

#1 what2do?  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-August 06

HELP! URGENT! extract values from <select> statement

Posted 01 August 2006 - 07:48 AM

hi

i am working on asp.net. i have a problem where i need to conditionally display the data stored in the database. that is, if the value is 1, then Yes and if it is 0, then no.

for this i have written a function. in the fuction, based on the value in the repeater element, i return a tag sequence. like this:

Function populateRadio(input as String) as String
If Int32.Parse(input) = 1 then
Return "<input type=""radio"" name=""textfield8"" id=""textfield8"" value=""1"" checked>Yes</input><br><input type=""radio"" name=""textfield8"" id=""textfield8"" value=""0"">No</input>"
Else
Return "<input type=""radio"" name=""textfield8"" id=""textfield8"" value=""1"">Yes</input><br><input type=""radio"" name=""textfield8"" id=""textfield8"" value=""0"" checked>No</input>"
End If
End Function

this works fine. but the problem occurs when i need to read the data in the radio button for an update query. as it is not an asp control, i am getting an error. Can somebody please help me??

Thanks a lot.

This post has been edited by what2do?: 01 August 2006 - 08:40 AM


Is This A Good Question/Topic? 0
  • +

Replies To: HELP! URGENT! extract values from <select> statement

#2 what2do?  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-August 06

Re: HELP! URGENT! extract values from <select> statement

Posted 01 August 2006 - 08:43 AM

cant seem to get around this. So, help is welcome.
Was This Post Helpful? 0
  • +
  • -

#3 sontek  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 283
  • Joined: 13-September 01

Re: HELP! URGENT! extract values from <select> statement

Posted 07 August 2006 - 08:26 PM

View Postwhat2do?, on 1 Aug, 2006 - 07:48 AM, said:

hi

i am working on asp.net. i have a problem where i need to conditionally display the data stored in the database. that is, if the value is 1, then Yes and if it is 0, then no.

for this i have written a function. in the fuction, based on the value in the repeater element, i return a tag sequence. like this:

Function populateRadio(input as String) as String
If Int32.Parse(input) = 1 then
Return "<input type=""radio"" name=""textfield8"" id=""textfield8"" value=""1"" checked>Yes</input><br><input type=""radio"" name=""textfield8"" id=""textfield8"" value=""0"">No</input>"
Else
Return "<input type=""radio"" name=""textfield8"" id=""textfield8"" value=""1"">Yes</input><br><input type=""radio"" name=""textfield8"" id=""textfield8"" value=""0"" checked>No</input>"
End If
End Function

this works fine. but the problem occurs when i need to read the data in the radio button for an update query. as it is not an asp control, i am getting an error. Can somebody please help me??

Thanks a lot.



Although the radio button is not an asp.net button you could add runat='server' and it would make it accessible via your code but I think a better way would be to pop to asp.net radio buttons onto your page and then make them visible/invisible rather than actually returning HTML as a string
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1