Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Formview FindControl()Formview FindControl()
Previous
 
Next
New Post
4/10/2008 11:09 AM
 



I am trying to access the value of a listbox's selected value from within a formview. 

I have tried using this code:    Me.FormView1.FindControl("DropDownList1").ToString
It returns this value:    System.Web.UI.WebControls.DropDownList

Feedback Appreciated.

 
New Post
4/10/2008 11:22 AM
 

I guess you may try this

Dim ddl As DropDownList = CType(Me.FormView1.FindControl("DropDownList1"), DropDownList)

If Not ddl Is Nothing

Dim MyString as String = ddl.SelectedItem.Text

End If

 

 

or something like above

I see that you have written ListBox but you are using DropDownList, if it is Indeed ListBox, you may replace the DropDownList with ListBox in above code segment

 
New Post
4/10/2008 11:43 AM
 



Success.
Appreciate the timely response. 

Next I will be declaring the MyString a Integer, rather than a String for mathmatical evalutaions.  (EX: Dim MyString As Integer)
Trouble here is one of the DropDownLists has other characters within values I need romoved to properly recognize as an Integer. ( : , - / etc.)
It seems I would need to use a remove(":"), contains(":") or a replace(":","")

Feedback Appreciated.

 
New Post
4/10/2008 11:47 AM
 



HA!  What was I thinking.
Simply assign a value (without any non-Integer characters) to the DropDownList items.




When taking 2 fields and processing a calculation upon formview insert, what are my options for having this calculated value be binded to a different tablefield (on initial time of insert, all through single insert button click)?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Formview FindControl()Formview FindControl()


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out