Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Calling Textbox properties incode behind

Calling Textbox properties incode behind

Scheduled Pinned Locked Moved ASP.NET
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kinnuP
    wrote on last edited by
    #1

    hi all, please help me i this, i wnt to make all text boxes inside the page are readonly true.but insted of doing for each textbox i want find all the text boxes in page and make at once read only true . i am using this code to find foreach(Controls control in Page.Controls) { if (control is TextBox) { } } but unable to get common property of text boxes is there any way please help me. Thanks And Regards, GuruKiran

    M J 2 Replies Last reply
    0
    • K kinnuP

      hi all, please help me i this, i wnt to make all text boxes inside the page are readonly true.but insted of doing for each textbox i want find all the text boxes in page and make at once read only true . i am using this code to find foreach(Controls control in Page.Controls) { if (control is TextBox) { } } but unable to get common property of text boxes is there any way please help me. Thanks And Regards, GuruKiran

      M Offline
      M Offline
      M LN Rao
      wrote on last edited by
      #2

      foreach(Controls control in Page.Controls) { if (control is TextBox) { (control as TextBox).ReadOnly = true; } } Does this work....

      Intelligence is measured by common sense not by how many scholarly books you read.

      1 Reply Last reply
      0
      • K kinnuP

        hi all, please help me i this, i wnt to make all text boxes inside the page are readonly true.but insted of doing for each textbox i want find all the text boxes in page and make at once read only true . i am using this code to find foreach(Controls control in Page.Controls) { if (control is TextBox) { } } but unable to get common property of text boxes is there any way please help me. Thanks And Regards, GuruKiran

        J Offline
        J Offline
        John ph
        wrote on last edited by
        #3
        foreach (Control ctrl in c.Controls) {
            if ((ctrl.GetType() == TextBox)) {
                ((TextBox)(ctrl)).ReadOnly = true;
            }
        }
        

        Regards
         - J O N -


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups