Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I am creating a form and need to display data from a database as read only. Is there a way to do this?
Example:
Client Name: Fred's Trucking
Fred's Trucking would be from the database.
Just display this data in a static control (I.e label, read only text box, etc).
Add a comment
Just display the data. Your code is what makes it read only. Use an asp:label instead of a form control.
www.ASP.net has a variety of examples
Walkthrough: Basic Data Access in Web Pages
http://msdn.microsoft.com/en-us/library/tw738475.aspx
Assuming that you would want to display "Fred's Trucking" in a TextBox control, a TextBox control has a "ReadOnly" property that you would set to "True".
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.