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. Problems with ASP.NET 2.0

Problems with ASP.NET 2.0

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
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.
  • T Offline
    T Offline
    TheMajorRager
    wrote on last edited by
    #1

    Hello, I am trying to convert this application I am working on from ASP.NET 1.1 to 2.0, and certain things are not working as they should. One thing is the code below TextBox txtCompleted = new TextBox(); TextBox txtProjected = new TextBox(); position = j+1; CheckBox chk = Page.FindControl("chk_"+ j + "_" + ContractNum) as CheckBox; txtCompleted = Page.FindControl("txtCompleted_"+j+"_"+ContractNum) as TextBox; txtProjected = Page.FindControl("txtProjected_"+j+"_"+ContractNum) as TextBox; completed = txtCompleted.Text.Trim(); projected = txtProjected.Text.Trim(); CheckList_ID = int.Parse(CheckListID.Rows[j]["ID"].ToString()); In .NET 1.1 completed and projected get the values of the text boxes after the user clicks save, but in 2.0 this doesn't seem to work, I was wondering if anyone had any suggestions. Sincerely, The Major Rager

    N C 2 Replies Last reply
    0
    • T TheMajorRager

      Hello, I am trying to convert this application I am working on from ASP.NET 1.1 to 2.0, and certain things are not working as they should. One thing is the code below TextBox txtCompleted = new TextBox(); TextBox txtProjected = new TextBox(); position = j+1; CheckBox chk = Page.FindControl("chk_"+ j + "_" + ContractNum) as CheckBox; txtCompleted = Page.FindControl("txtCompleted_"+j+"_"+ContractNum) as TextBox; txtProjected = Page.FindControl("txtProjected_"+j+"_"+ContractNum) as TextBox; completed = txtCompleted.Text.Trim(); projected = txtProjected.Text.Trim(); CheckList_ID = int.Parse(CheckListID.Rows[j]["ID"].ToString()); In .NET 1.1 completed and projected get the values of the text boxes after the user clicks save, but in 2.0 this doesn't seem to work, I was wondering if anyone had any suggestions. Sincerely, The Major Rager

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      TheMajorRager wrote:

      txtCompleted = Page.FindControl("txtCompleted_"+j+"_"+ContractNum) as TextBox; txtProjected = Page.FindControl("txtProjected_"+j+"_"+ContractNum) as TextBox;

      If these controls already exist on your page why not call them directly rather than use FindControl?

      only two letters away from being an asset

      1 Reply Last reply
      0
      • T TheMajorRager

        Hello, I am trying to convert this application I am working on from ASP.NET 1.1 to 2.0, and certain things are not working as they should. One thing is the code below TextBox txtCompleted = new TextBox(); TextBox txtProjected = new TextBox(); position = j+1; CheckBox chk = Page.FindControl("chk_"+ j + "_" + ContractNum) as CheckBox; txtCompleted = Page.FindControl("txtCompleted_"+j+"_"+ContractNum) as TextBox; txtProjected = Page.FindControl("txtProjected_"+j+"_"+ContractNum) as TextBox; completed = txtCompleted.Text.Trim(); projected = txtProjected.Text.Trim(); CheckList_ID = int.Parse(CheckListID.Rows[j]["ID"].ToString()); In .NET 1.1 completed and projected get the values of the text boxes after the user clicks save, but in 2.0 this doesn't seem to work, I was wondering if anyone had any suggestions. Sincerely, The Major Rager

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        AS well as the previous comment, why would you write code that calls FindControl and has no block to make sure that it succeeded ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        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