Solved

How do you make records Read-only in mvc 4

Posted on 2014-04-18
4
281 Views
Last Modified: 2014-04-23
Please help
       I want to be able to click on a button(s) and deactivate a row(s).
                1) click on a button(S)
                2) press the deactivate * * button
                3) the record is now read only and the text of the record is grayed out
                 4) the fact that this record is readonly has to be stored in the sql database for future inquires
ReadOnly.rtf
0
Comment
Question by:vcurtis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 40010184
Which part do you need help with exactly? Presumably you are already reading/writing data to your database.

There is no built-in way in the database to mark a record read only, so you need to do it yourself. A simple bit field should do the job.
0
 

Author Comment

by:vcurtis
ID: 40012990
You are right about the database, So I using the "bit" datatype. What I am not sure is, how can I do the following
  1) have the application Read the bit datatype as false/true
  2) have the  application "grey out" the record so it is read-only and cannot be clicked or
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 40013144
It depends how you are reading your data. If you are using a DataReader then calling GetBoolean with the index of your column will convert the bit to a bool.

Once you check that value you can simply set the Enabled property of your server controls to false to disable/grey them out.
0
 

Author Closing Comment

by:vcurtis
ID: 40018933
Thanks Carl
  That worked
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET Textbox input validation 4 63
How can I do Unit Testing with Session ? 1 23
Installing .NET 3.5 on Windows Server 2012 1 57
Need help with a query 14 35
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question