In Code Behind File, How to assign contentEditable=“true” property to the TextBox?

I am binding some values to the TextBox using JavaScript. But During PostBack, the textbox values are cleared. So I used contentEditable="false" in the TextBox property.So the above problem get solved.

But, Suppose if there is no records to bind the TextBox using Javascript, at that time I want to set the textbox property contentEditable="true". So we can enter some values. How to do this in the Code Behind file?

This is my TextBox Sourcode:

This is my JavaScript to assign the Value to the TextBox:

function SuggessionSelectedValues(obj, ctrlName) 
    {
        if(ctrlName == "UCJobOrderNo")
        {             
            document.getElementById('<%=txtD1.ClientID %>').value         = obj[1];
        }
    }

I call this JavaScript function in One Dynamic Suggestion control.

Answers


The TextBox control has an Attributes property, so in your code behind you could do:

MyTextBox.Attributes["contentEditable"] = recordCount == 0;

This would set the value of the contentEditable attribute based on the recordCount.


We need to give like this:

     txtD1.Attributes.Add("contentEditable", "true");

Need Your Help

Require dependency of dependency

node.js node-modules

I have the modules as shown above. I need to include not only quickblox, but the quickblox.chat plugin. I'm using this code: // Quickblox var QB = require('quickblox'); var QBChat =

??? Maximum recursion limit of 500 reached

matlab recursion limit max

I have received the following message when I tried to run (adpcm_encoder).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.