.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to disable resize grip on multiline textbox?

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :ASP.Net

I cannot seem to find what should be a simple setting to keep my multiline textbox to the height/width or row/column settings without the resize grip or ability to resize. How do I prevent resizing?

View Complete Post

More Related Resource Links

Issues with multiline textbox, javascript and IE


Hi All,

i have a requirement to embolden/italicise the selected  text in a textbox. the way it is implemented as is by using a js function which inserts <b> and </b> tags at the start and end of the selected text  for bold, and similarly <i> and </i> tags at the start and end of the selected text  for italics.

here is the code in c# (to add attributes to link buttons)

lkbBold.Attributes.Add("onclick", "AddHTMLTags('" + txtTitle.ClientID + "', 'B'); return false;");
lkbItalic.Attributes.Add("onclick", "AddHTMLTags('" + txtTitle.ClientID + "', 'I'); return false;");

the txtTitle is the id of the text box, which contains the selected text to be emboldend.

and here's the javascript method

function AddHTMLTags(textBoxId, format)
  var textComponent = document.getElementById(textBoxId);
  var selectedText;
  var textToReplace; 
  var content = document.getElementById(textBoxId).value;
  var content1 ;
  var content2 ;
  var newContent; 
      // For IE 
      if (document.selection != undefined)
        var len =  document.selection.createRange().text.length;
        var myrange

How to disable textbox causing validation?

Hello I was running into a strange problem: If I left a textbox blank (in some instances) the textbox would not give up the focus (I could not even close the form).  I learnt later that this was because the text in the textbox was causing validation to fail.  I would have to type in some value (Satisfy validation) before i could close the form. This is problematic for me and I don't want the textbox to behave this way (I do not awnt front end validation).  I desire to have validation done ONLY on the back end.     I thought that I could solve this problem by changing the 'CausesValidation' property in the textbox to false.  This worked!  However it introduced a new problem.  The binding no longer worked on the Textbox.  That is, whatever value I typed in the textbox would not make it to the data set. What is the correct way in solving this problem???  I want validation to be shut off however I still (obviously) need to keep binding in tact...      

Reading MultiLine TextBox line by line

If I have a list of something in a MultiLine TextBox, one item per line, how do I then in turn read this? Right now TextBox.Text reads it all as one line. Lets say we have this: TextBox txtbx; At first I thought I could split the string on Environment.Newline, this doesn't work.  Error.Next I thought I could Replace(Environment.Newline,";").Split(";"); This didn't work either, Error.  Both gave cannot convert string to char[] exceptions. What I want to be able to do is read the input line by line and do something with each item one by one. Does anyone know how to do this?Thanks.

problem with javascript in multiline textbox

 I am setting Maxlength of a textbox using javascript. Take maxlegth as 100.As we know Enter key is taking two char space. But i want to avoid this. i.e. if i press enter key after 96th char it should allow me to enter four more char where now it is allowing only 98. This is wat i am using  function textboxMultilineMaxNumber(txt,maxLen) { try { if(txt.value.length > (maxLen-1)) return false; } } catch(e){ } }

Multiline textbox help - Gridview

Hi, I have a gridview connected to a SQL datasource. I have in the gridview one column as text and displays more than 6000 characters. How do I display this column as a multitext display, allowing the user to scroll-down in a fixed column grid? Thanks in advance. Nijojo.

Disable "Paste" lable on read only textbox.

Hi, I am new to C# .NET. I am facing very small problem. i.e. I made a text box with readonly option. Now this text box is not allowing to paste,ok its working fine. But when i give mouse right click paste lable is enable. Can you guide me how to disable this lable. With Regards Srinubabu

Binding SharePoint Multiline textbox to a infopath repeating table Listbox

Hi, I have a InfoPath form  with repeating table control which gets the data from a sharepoint list. I'm trying to bind a multiline textbox to a listbox and intend to get the line by line data entered in the multiline textbox in sharepoint to show as same line by line in the form's listbox. or is there any other way of getting this done.  Thanks.

How Do I display only the last line of a Multiline TextBox when rows=1?


hi all,

This is the current code I am using:

                      <asp:TextBox ID="txtBoxComments" runat="server" MaxLength="5000" ReadOnly="true" Rows="1" Text='<%# Eval("Comments") %>'
                       TextMode="MultiLine" Width="100%" Wrap="true" />

 Thank you!


Disable copy paste in textbox without Javascript




Can you somebody help me in disabling copy paste in the textbox without using Javascript for an web application?




disable COPY/Paste function on a textbox

Hi, I want to make disable COPY/Paste function on a textbox. DO u know how to do it if so please let me know asap? And it is required to be done at client side. The text box can be HTML or ASP:TextBox. Please reply asap.

Trying to display only the last line of a Multiline TextBox


Hi all,

On my Asp.Net GridView I am binding a textbox to a field in SQL. Sometimes the content of the textbox is more than 1 line and I
need to show only the LAST line. How can I do that? Here is part of my code...notice that I use Rows=1 on purpose so that
I am able to show only 1 line but I need it to scroll all the way down and have it show only the last line of the whole content:

  <asp:TextBox ID="txtBoxComments" runat="server" MaxLength="5000" ReadOnly="true" Rows="1" Text='<%# Eval("Comments") %>'
      TextMode="MultiLine" Width="100%" Wrap="true" />

 Thank you!

Resize forms, textbox and buttons



I have a application with more then 100 forms, designed in 800 x 600 resolution, without anchors and dock. Now I my clients want use the application in 1024 x 768.

How can I resize and reposition my controls (just: textbox, combos, buttons and gridviews), without using anchors and dock?

I looking for a method or control like a known vb "Resize_For_Resolution". I found a control named ".Net Resize" but is not free.




Limit characters in multiline textbox on formview



I have this working perfectly on a normal webform without a master page or formview.

Label1 is counting the values in TextBox2 and limiting them to 10.

I need this to work in a formview with a master page but I just can't get it to work. Can someone please advise how I use this with the controls being in a formview or even a detailsview.

Thanks for any help.

    function checkLength(con)

if(con.value.length >= 10)

return false;



document.getElementById('Label1').innerHTML = (9 - con.value.length) + ' Chraracters Remaining';return true;


function setRemaining()

document.getElementById('Label1').innerHTML = (10 - document.getElementById('TextBox2').value.length) + ' Chraracters Remaining';

if (document.getElementById('TextBox2').value.length > 10)

document.getElementById('TextBox2').value = document.getElementById('TextBox2').value.substring(0,10);



How to disable a validator that associates with a disabled textbox?


 Hi there,

If a control is disabled (enabled = false), will the validator controls associated with it automatically know not to carry out validation?

i have a checkbox and a textbox, if the checkbox is checked, the textbox is enabled, and has to have a value, where i used a required field validator.

but if the checkbox is not checked, textbox is then disabled, however, the validator controls still seem to be trying to validate the disabled textbox.

so is there a way to disable validator according to textbox's state? such as textbox.enable = true? seems like causevalidation method requires multiple button, however i only need one...


thanks in advance!

Custom workflow with SPD, cannot able to update URL from multiline textbox


Hi All,

I am having trouble in updating multiline textbox field from custom workflow initiation form. Here is the description of the problem..

I have an initiation form with multiline text box field where user will paste a long url like http://moss.company/sites/Sinbtr1-Project/_layouts/Workflow.aspx?ID=119&List={171485A0-4C2D-4C40-A393-AAD36F60EA52}&Source=http%3A%2F%2Fmoss%2Ecompany%2Fsites%2FProject%2FDocControl%2FForms%2FAllItems%2Easpx%3FRootFolder%3D%252fsites%252fSinbtr1%252dProject%252fDocControl%252fSQUAD%2520CHECK%26FolderCTID%3D0x01200093A5FA92433C7C44B0DCF8816CA93C5A%26View%3D%257b305B3511%252d0D87%252d4444%252dAD04%252d8FA3A342EF97%257d.

When user starts a workflow, i want to update one "multiline text field" in associated document library. But, everything else is getting updated except this URL field.

I also tried to decode this url by using javascript and update. but didnt worked...

TextBox MultiLine shows squigly lines?


Why does this url show squigly lines in firefox and how do I remove them?


Textbox multiline How to set character limit?



I would like to put 250 characters limit to my textbox.

How can i do it?

Best Regards

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend