Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:53:29+00:00 2026-06-10T05:53:29+00:00

There is (suppose to be) a label or textbox in hidden mode that from

  • 0

There is (suppose to be) a label or textbox in hidden mode that from the code behind will be set (text value) to “user” or “manager”.

I want to be able to make a JavaScript verify what is the value of the (hidden) textbox/label when there’s a click event on given table row (<tr>) which dose not have runat="server" property set.

If a client tries to click on that row (actually that row has a few textbox elements)
so if client try to edit e.g. click on the row
then action taken by a js function like alert("no edit allowed") will be taken.

<tr id="TR_editTimein" onClick="javascript:CheckIfManager();">
    <td> <input type="text" id="timeIn" /></td>
</tr>
  1. If code behind recognize a manager(from Request.QueryString) it sets the hidden LBL or TXTBX with value “manager”

  2. JavaScript onClick event over TR_editTimein will trigger CheckIfManager()
    function

  3. CheckIfManager() will ask for the value of the hidden element and if value is “user” it will do alert(“no edit option for non Managers”)

For now, what happens is if i set that say aspTextBox to Visible=false
JavaScript also don’t see it.

what is the right way to validate if the client is user or manager?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:53:30+00:00Added an answer on June 10, 2026 at 5:53 am

    If you set Visible=False, the ASP.NET control wont even get rendered in browser ( client -side ). That means DOM won’t have that object and so you cannot fetch that object using getElementById.

    The alternative is to use an asp:HiddenField which renders as input type='hidden'.

    If you have a resolute and unyielding need to use asp:Label or asp:TextBox set the display:none; from code-behind like this

    myLabelID.Attributes.Add("style","display:none");
    

    That way the object will be rendered in browser and hidden from user allowing you to fetch that using JavaScript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
Suppose there is an image_url column in database. I want the user to choose
I suppose there should be a way to set a cookie to be accessible
Suppose there is a SQL statement: select * from A order by cola In
Suppose I have knockout.js template like this: <script type=text/html id=mytemplate> <label for=inputId>Label for input</label>
Suppose there was a SQL table like this: Label Name | Last name |
Suppose I have this label in my aspx page: <asp:Label ID=savings runat=server Text='<%# Eval(savings)%>'
Suppose there is a script sth.py When i logged with 'root' account. type :
Suppose there is a situation like : statement 1; statement 2; statement 3; statement
Suppose there are two lists a = {a1, a2, a3} and b = {b1,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.