If lbxSearchResults.Items.Count = 0 Then m_FileName = lbxFiles.SelectedItem Else m_FileName = lbxSearchResults.SelectedItem End If
I'm having trouble converting with the above segment of VB code to ASP. In ASP.NET it's giving me "Value of type 'System.Web.UI.WebControls.ListItem' cannot be converted to 'String'.
If I change it to
If lbxSearchResults.Items.Count = 0 Then m_FileName = lbxFiles.SelectedItem.text Else m_FileName = lbxSearchResults.SelectedItem.text End If
I get a "NullReferenceException was unhandled by user code Object reference not set to an instance of an object"
Can anyone guide me to figure out the ASP.Net equivalent to the VB code?

New Topic/Question
Reply




MultiQuote





|