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. General Programming
  3. C#
  4. Inheriting controls from a web page(asp 1.0)

Inheriting controls from a web page(asp 1.0)

Scheduled Pinned Locked Moved C#
1 Posts 1 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.
  • S Offline
    S Offline
    sishya
    wrote on last edited by
    #1

    hI, I have a web page in which i am generating all the controls dynamically .I have a place holder(also dynamically generated)in webform1 into which i am pushing all the All the generated controls . Now i want ato inherit this page into webform2 .What i tried was public class Webform2 : webform1 in webform class i have a ftion public void look() { // Response.Write("look"); PlaceHolder pl = new PlaceHolder(); TextBox tb; tb = new TextBox(); tb.Text = "adarsh"; tb.Visible = true; tb.Width = Unit.Percentage(20); tb.Height = Unit.Percentage(20); pl.Controls.Add(tb); this.form1.Controls.Add(pl); } } in webform2 class i call page load event i call this ftion look .But it gives a runtime exception saying in line this.form1.Controls.Add(pl); object reference not set to an instance of an object.Why is this and pls suggest any solution for this. -- modified at 1:54 Monday 3rd July, 2006

    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