{"id":545,"date":"2003-12-08T13:11:21","date_gmt":"2003-12-08T17:11:21","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=545"},"modified":"2003-12-08T13:11:21","modified_gmt":"2003-12-08T17:11:21","slug":"aspnet-textbox-multiline-incorrect-documentation","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2003\/12\/08\/aspnet-textbox-multiline-incorrect-documentation\/","title":{"rendered":"ASP.NET TextBox MultiLine Incorrect Documentation"},"content":{"rendered":"<p>[<b>Update: The link to the TextBox class from the ASP.NET TextBox Web Server Control points to the Windows Forms TextBox, not the Web Controls TextBox. Balls!<\/b>]<\/p>\n<p>If you&#8217;re running into trouble when using the TextBox class in ASP.NET, the MultiLine property and the Microsoft .NET Framework SDK Documentation, it&#8217;s probably because the documentation is wrong.  The documentation that ships with v1.1 says that you can use the &#8216;Multiline&#8217; property of the <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpref\/html\/frlrfSystemWindowsFormsTextBoxClassTopic.asp?frame=true\">TextBox<\/a> class (which is actually a property of the <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpref\/html\/frlrfSystemWindowsFormsTextBoxBaseClassTopic.asp?frame=true\">TextBoxBase<\/a> class) to toggle the TextMode property like this:<br \/>\n<code><br \/>\nprivate void CreateMyMultilineTextBox() {<br \/>\n&nbsp;&nbsp;\/\/ Create an instance of a TextBox control.<br \/>\n&nbsp;&nbsp;TextBox textBox1 = new TextBox();<\/p>\n<p>&nbsp;&nbsp;\/\/ Set the Multiline property to true.<br \/>\n&nbsp;&nbsp;textBox1.Multiline = true;<br \/>\n&nbsp;&nbsp;....<br \/>\n}<br \/>\n<\/code><br \/>\nIf you do what the documentation says, you&#8217;ll get a compiler error that says this:<br \/>\n<code><br \/>\nerror CS0117: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Multiline'<br \/>\n<\/code><br \/>\nSo instead, use the the <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpref\/html\/frlrfsystemwebuiwebcontrolstextboxmodeclasstopic.asp\">TextBoxMode<\/a> enumeration and the TextMode property:<br \/>\n<code><br \/>\nprivate void CreateMyMultilineTextBox() {<br \/>\n&nbsp;&nbsp;\/\/ Create an instance of a TextBox control<br \/>\n&nbsp;&nbsp;TextBox textBox1 = new TextBox();<\/p>\n<p>&nbsp;&nbsp;\/\/ use the TextMode property and the TextBoxMode enumeration<br \/>\n&nbsp;&nbsp;textBox1.TextMode = TextBoxMode.MultiLine;<br \/>\n&nbsp;&nbsp;....<br \/>\n}<br \/>\n<\/code><br \/>\nAll of this is documented correctly <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/vbcon\/html\/vbtskspecifyingmultilineinputfortextboxwebcontrol.asp\">online<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Update: The link to the TextBox class from the ASP.NET TextBox Web Server Control points to the Windows Forms TextBox, not the Web Controls TextBox. Balls!] If you&#8217;re running into trouble when using the TextBox class in ASP.NET, the MultiLine property and the Microsoft .NET Framework SDK Documentation, it&#8217;s probably because the documentation is wrong. &hellip; <a href=\"https:\/\/cephas.net\/blog\/2003\/12\/08\/aspnet-textbox-multiline-incorrect-documentation\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ASP.NET TextBox MultiLine Incorrect Documentation<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/545"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=545"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/545\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}