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. dynamic control in separate class

dynamic control in separate class

Scheduled Pinned Locked Moved ASP.NET
helpquestion
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.
  • D Offline
    D Offline
    dkosasih
    wrote on last edited by
    #1

    Hi All, I have been stuck with this problem for a long time and have not found any solution. suppose I have a page called a.aspx.vb and a class file called B.vb. in a.aspx.vb I create a new instance of B:

    protected sub page_load()
    dim cls as new B
    dim lit as new literal
    lit = b.createbutton
    end sub

    then say inside the B.vb I have:

    protected function createbutton() as literal
    dim lit as new literal
    dim butt as new Button()
    'this is where my problem is
    addhandler butt.click, addressof method
    lit.controls.add(butt)
    return lit
    end function

    I want my code to do something on click. like...assign some value to some variables on a.aspx. say again in the a.aspx I want something like:

    sub method
    'on button click
    dim something as string
    something = "the button has been clicked"
    end sub

    But obviously it won't work just like that. so how do I do that??? I hope this explains what I need. Thanks for helping in advance.

    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