title: Can't split textarea value on linebreaks in Asp.net
body: <p>I'm trying to use a textarea to grab user input as separate entries from a textarea.</p>
  
  <p><strong>My Textarea:</strong></p>
  
  <pre><code>&lt;asp:TextBox runat="server" TextMode="MultiLine" ID="uploadFieldChoices"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p><strong>Value of textarea as seen on textarea:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/aT7fz.png" alt="enter image description here"></p>
  
  <p><strong>Value of textarea as retrieved by code:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/By9nk.png" alt="enter image description here"></p>
  
  <p>Then I'll want store that in XML and use it to generate a dropdownlist that has those three entries as options. </p>
  
  <p>To grab that what I'm trying to do is split the textarea value on line breaks and use that as my values to store as XmlNodes:</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>If lstrFieldType = "Dropdown" Then
      Dim lnodChoices As XmlNode = ldocFieldList.CreateElement("options")
      Dim larrSplit() As String = uploadFieldChoices.Text.Split(Environment.NewLine)
      For Each lstrOption As String In larrSplit
          If Not lstrOption.Trim = "" Then
              Dim lnodOption As XmlNode = ldocFieldList.CreateElement("option")
              lnodOption.InnerText = lstrOption
              lnodChoices.AppendChild(lnodOption)
          End If
      Next
      lnodUploadField.AppendChild(lnodChoices)
  End If
  </code></pre>
  
  <p>But so far I can't get <code>larrSplit</code> to actually give me more than one value. Weird thing is, even though the above only gives me a single XmlNode, the xml file will actually have line breaks in the entry!</p>
  
  <p>I know that a normal VB textbox has a ".lines" property that gives what I'm looking for, but isn't a property in the Web.Textbox control.</p>
  
  <p>I've also tried:</p>
  
  <pre><code>Dim larrSplit() As String = uploadFieldChoices.Text.Split("\n\r")
  Dim larrSplit() As String = uploadFieldChoices.Text.Split(vbNewLine)
  Dim larrSplit() As String = uploadFieldChoices.Text.Split(vbCrLf)
  </code></pre>
  
  <p>But none work.</p>
  
  <p>Why is this not working, and is there a better way completely different than the above?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Included code for textarea as it may be relevant.</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>Included images of textbox and value.</p>