Dynamically changing server control defaults

Discussion in 'ASP .Net Web Controls' started by Scott C., Mar 4, 2004.

  1. Scott C.

    Scott C. Guest

    We are building a web application that allow's the users to change the defaults of a their pages.
    Here is a list of what I've done so far
    1.) Return the control names, control properties and default values back from a database
    2.) I load each record into an objec
    3.) I then load all of these objects into a collection and send it back to the page.
    This all works great but then my problem starts
    Here is where I am stuck
    Dim cn As Strin
    Dim cp As Strin
    Dim cdv As Strin
    For Each obj In collControls 'This is my collection that was sent bac
    Dim cntl As D_Controls = New D_Controls 'This is my objec
    cntl = ob
    cn = cntl.ControlName 'example: "Button1
    cp = cntl.PropertyType 'example: "Text
    cdv = cntl.DefaultValue 'example: "Hello

    ' This is ultimately what I want to do. This is where the question lies.
    ' I know that the following doesn't work
    cn.cp = cdv ' example: Button1.Text = "Hello

    Anyone have any ideas. All I want to do is reset the page's default

    Scott C., Mar 4, 2004
    1. Advertisements

  2. Scott C.

    Felbrigg Guest

    Looks like a job for the "Reflection" .
    Felbrigg, Mar 5, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.