Store code line in a string?
        Posted  
        
            by 
                user1342164
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user1342164
        
        
        
        Published on 2013-06-28T15:55:46Z
        Indexed on 
            2013/06/28
            16:21 UTC
        
        
        Read the original article
        Hit count: 284
        
I need to store code in a string so that if a value is true, it is in the code line if not true its not in the code line. When I populate summarytextbox if consulting amount is "" then dont use this code if is does have an amount include the code. Is this possible? Other wise I would have to do a bunch if then statements. When I do the following below it cant convert to double.
Dim ConsultingFee As String 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Session("ConsultingFeeAmount") = "" Then
    Else
'Store the following line in a string????
        ConsultingFee = +Environment.NewLine + Session("ConsultingFee") + " Amount: " + Session("ConsultingFeeAmount")
    End If
    SummaryTextBox.Text = Session("TeachingHospital") + Environment.NewLine + Session("HospitalAddress") + Environment.NewLine + Session("HospitalCity") + Environment.NewLine + Session("HospitalState") + Environment.NewLine + Session("HospitalZip") + Environment.NewLine + Session("HospitalTIN") + ConsultingFee
End Sub
© Stack Overflow or respective owner