Dynamic page Creation ASP and C#

Discussion in 'ASP .Net' started by Tex, Feb 9, 2006.

  1. Tex

    Tex Guest

    I am trying to build a survey application using asp.net 2.0 and c# in
    visual studio 2005. I am fairly new to asp. I need to find a way to
    dynamically create a page with all of the survey questions on it. I am
    able to gather question names, types, answers etc... However once I
    have all of this information I am not sure how to dynamically create
    this webpage with different kinds of questions with varying amounts of
    answers.

    Any help would be appreciated.

    Thanks
    Tex, Feb 9, 2006
    #1
    1. Advertising

  2. Tex

    Spam Catcher Guest

    "Tex" <> wrote in news:1139459232.024245.115520
    @f14g2000cwb.googlegroups.com:

    > I am trying to build a survey application using asp.net 2.0 and c# in
    > visual studio 2005. I am fairly new to asp. I need to find a way to
    > dynamically create a page with all of the survey questions on it. I am
    > able to gather question names, types, answers etc... However once I
    > have all of this information I am not sure how to dynamically create
    > this webpage with different kinds of questions with varying amounts of
    > answers.



    I think you need some basic ASP.NET tutorials:

    http://aspnet.4guysfromrolla.com/articles/081402-1.aspx

    Basically you need to create the controls dynamically - based on the
    contents of your survey.


    --
    Stan Kee ()

    Boycott StarForce!
    http://www.glop.org/starforce
    Spam Catcher, Feb 9, 2006
    #2
    1. Advertising

  3. Tex

    Tex Guest

    I can add controls dynamically, but since I dont know how many I may
    need to add how can I specify a place holder for each. If I don't give
    a place holder it just crams verything up next to eachother. I guess I
    see how to create the controls but how can I control the layout when I
    don't know how many controls I may be adding?


    Thanks
    Tex, Feb 9, 2006
    #3
  4. Tex

    KMA Guest

    To space out the controls, put a break in between each (<BR>), for example,
    or add CSS info. A key issue is how you handle the postback. You may need to
    assign a unique ID to each set of controls so that you can iterate through
    them and find out what question they were ansering.

    "Tex" <> wrote in message
    news:...
    >I can add controls dynamically, but since I dont know how many I may
    > need to add how can I specify a place holder for each. If I don't give
    > a place holder it just crams verything up next to eachother. I guess I
    > see how to create the controls but how can I control the layout when I
    > don't know how many controls I may be adding?
    >
    >
    > Thanks
    >
    KMA, Feb 9, 2006
    #4
  5. Tex

    Spam Catcher Guest

    "Tex" <> wrote in news:1139464318.723409.86400
    @f14g2000cwb.googlegroups.com:

    > If I don't give
    > a place holder it just crams verything up next to eachother. I guess I
    > see how to create the controls but how can I control the layout when I
    > don't know how many controls I may be adding?


    You can stuff multiple controls into a place holder.

    Or you can do dynamic formatting - i.e. build your table dynamically.

    Or you can use a control like a DataGrid, Repeater, or DataList.

    --
    Stan Kee ()

    Boycott StarForce!
    http://www.glop.org/starforce
    Spam Catcher, Feb 9, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PABruceFan
    Replies:
    3
    Views:
    4,117
    John Saunders
    Jul 31, 2004
  2. Carlos
    Replies:
    1
    Views:
    366
    Felix Piskunov
    Nov 10, 2006
  3. mausimo
    Replies:
    0
    Views:
    254
    mausimo
    Sep 24, 2009
  4. PABruceFan
    Replies:
    3
    Views:
    186
    John Saunders
    Jul 31, 2004
  5. Arne de Booij

    Dynamic creation of ASP code

    Arne de Booij, Jun 1, 2004, in forum: ASP General
    Replies:
    11
    Views:
    200
    Arne de Booij
    Jun 1, 2004
Loading...

Share This Page