This is a migrated thread and some comments may be shown as answers.

Cannot get the value

0 Answers 83 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brent
Top achievements
Rank 1
Brent asked on 07 Feb 2009, 12:41 AM
Hello,

I am having problems getting the value selected from the combo box. I assume the code would be the same as a regular asp:DropDownList?
I get the error: Value of type 'String' cannot be converted to 'Telerik.Web.UI.RadComboBox'

 <telerik:RadComboBox ID="Title" runat="server"  
                                     ToolTip="Please enter your title" Skin="WebBlue" Text="Title"  
                                   > 
                                     <Items> 
                                         <telerik:RadComboBoxItem runat="server" Text="Mr" Value="Mr" /> 
                                         <telerik:RadComboBoxItem runat="server" Text="Mrs" Value="Mrs" /> 
                                         <telerik:RadComboBoxItem runat="server" Text="Miss" Value="Miss" /> 
                                         <telerik:RadComboBoxItem runat="server" Text="Ms" Value="Ms" /> 
                                         <telerik:RadComboBoxItem runat="server" Text="Dr" Value="Dr" ToolTip="Please give your title" /> 
                                         <telerik:RadComboBoxItem runat="server" Text="Prof" Value="Prof" /> 
                                     </Items> 
                                     <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                 </telerik:RadComboBox> 

Imports System.Net.Mail 
Imports System.Net 
 
Partial Class fastquote_Default 
    Inherits System.Web.UI.Page 
 
    Protected Sub SendEmail_Click(ByVal sender As ObjectByVal e As System.Web.UI.ImageClickEventArgs) 
        ' !!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS  
        Const ToAddress As String = "me@gmail.com" 
        Dim mm As New MailMessage() 
        ' (2) Assign the MailMessage's properties  
        mm.Subject = "GetAQuote" 
        mm.IsBodyHtml = True 
        mm.Body = ("" & (HttpUtility.HtmlEncode(Title.SelectedItem.Value) & "")) 
        Dim smtp As New SmtpClient() 
        ' (4) Send the MailMessage (will use the Web.config settings)  
        smtp.Send(mm) 
        
    End Sub 
     
    
 
 
End Class 

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Brent
Top achievements
Rank 1
Share this question
or