Replace a text by a control

Discussion in 'ASP .Net Web Controls' started by gokul, Jul 30, 2004.

  1. gokul

    gokul Guest

    Hi There,
    Iam in the process of creating a very small content management system.
    The need is....
    I have a page displayed taking data from the database , both for the
    template and the content.

    I use a dropdown list box to display a list of countries.

    The hitch is I have to display the dropdown at a specified marker tag
    in the template so that I can get the user list of countries at a
    specified place.

    For E.x

    <tr>
    <td class="bold" width="100%"><br>
    <br>
    User Name:<br>
    <input name="textfield" type="text" size="15" maxlength="20">
    <br>
    <br>
    Password:<br>
    <input name="textfield2" type="text" size="15" maxlength="20">
    <br>
    <br>
    <span class="bold">Forgot your password?</span><br>
    <br>
    <span class="bold">Click here to register.</span>
    <span> [#Country#]</span>
    </td>
    </tr>

    The above is the html template it will be stored in the DB and pumped
    out and displayed.
    I have to replace the [#Country#] with the dropdown server control
    which gets the populated data from the DB.

    Or please suggest me a way how can I do it.
    Thanks and Regards
    Gokul
     
    gokul, Jul 30, 2004
    #1
    1. Advertising

  2. gokul

    Juno Guest

    try this:
    Read this template out of db as string, and divide the string into three
    parts, the second part is [#Country#].
    Add a placehoder control to your page, and then add first part as literal
    control , and your dropdownlist control and then the third part.

    like:
    PlaceHolder1.Controls.Add(new Literate(sPart1))
    PlaceHolder1.Controls.Add(Your DropDownList)
    PlaceHolder1.Controls.Add(new Literate(sPart3))


    --
    Juno
    MCSD.NET, MCDBA, MCSE
    ----------------------------------------------------------
    Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
    DataForm.NET - The most powerful data entry web server control for ASP.NET



    "gokul" <> wrote in message
    news:...
    > Hi There,
    > Iam in the process of creating a very small content management system.
    > The need is....
    > I have a page displayed taking data from the database , both for the
    > template and the content.
    >
    > I use a dropdown list box to display a list of countries.
    >
    > The hitch is I have to display the dropdown at a specified marker tag
    > in the template so that I can get the user list of countries at a
    > specified place.
    >
    > For E.x
    >
    > <tr>
    > <td class="bold" width="100%"><br>
    > <br>
    > User Name:<br>
    > <input name="textfield" type="text" size="15" maxlength="20">
    > <br>
    > <br>
    > Password:<br>
    > <input name="textfield2" type="text" size="15" maxlength="20">
    > <br>
    > <br>
    > <span class="bold">Forgot your password?</span><br>
    > <br>
    > <span class="bold">Click here to register.</span>
    > <span> [#Country#]</span>
    > </td>
    > </tr>
    >
    > The above is the html template it will be stored in the DB and pumped
    > out and displayed.
    > I have to replace the [#Country#] with the dropdown server control
    > which gets the populated data from the DB.
    >
    > Or please suggest me a way how can I do it.
    > Thanks and Regards
    > Gokul
     
    Juno, Jul 30, 2004
    #2
    1. Advertising

  3. gokul

    gokul Guest

    Hi Juno,
    Thanks for the tip.
    What I do now is.... I have a place holder, have a literal control and
    place it in the Place holder, by your tip Iam able to place the
    control in to the page...but the problem is I want to replace it at a
    particular point.
    The replace is to be made with a particular text string by this
    control (DropDownList).

    Regards
    GOKUL.

    "Juno" <> wrote in message news:<>...
    > try this:
    > Read this template out of db as string, and divide the string into three
    > parts, the second part is [#Country#].
    > Add a placehoder control to your page, and then add first part as literal
    > control , and your dropdownlist control and then the third part.
    >
    > like:
    > PlaceHolder1.Controls.Add(new Literate(sPart1))
    > PlaceHolder1.Controls.Add(Your DropDownList)
    > PlaceHolder1.Controls.Add(new Literate(sPart3))
    >
    >
    > --
    > Juno
    > MCSD.NET, MCDBA, MCSE
    > ----------------------------------------------------------
    > Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
    > DataForm.NET - The most powerful data entry web server control for ASP.NET
    >
    >
    >
    > "gokul" <> wrote in message
    > news:...
    > > Hi There,
    > > Iam in the process of creating a very small content management system.
    > > The need is....
    > > I have a page displayed taking data from the database , both for the
    > > template and the content.
    > >
    > > I use a dropdown list box to display a list of countries.
    > >
    > > The hitch is I have to display the dropdown at a specified marker tag
    > > in the template so that I can get the user list of countries at a
    > > specified place.
    > >
    > > For E.x
    > >
    > > <tr>
    > > <td class="bold" width="100%"><br>
    > > <br>
    > > User Name:<br>
    > > <input name="textfield" type="text" size="15" maxlength="20">
    > > <br>
    > > <br>
    > > Password:<br>
    > > <input name="textfield2" type="text" size="15" maxlength="20">
    > > <br>
    > > <br>
    > > <span class="bold">Forgot your password?</span><br>
    > > <br>
    > > <span class="bold">Click here to register.</span>
    > > <span> [#Country#]</span>
    > > </td>
    > > </tr>
    > >
    > > The above is the html template it will be stored in the DB and pumped
    > > out and displayed.
    > > I have to replace the [#Country#] with the dropdown server control
    > > which gets the populated data from the DB.
    > >
    > > Or please suggest me a way how can I do it.
    > > Thanks and Regards
    > > Gokul
     
    gokul, Aug 2, 2004
    #3
    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. juglesh
    Replies:
    16
    Views:
    328
    juglesh
    Dec 27, 2004
  2. penny
    Replies:
    28
    Views:
    2,455
    Charlton Wilbur
    Mar 10, 2008
  3. mscir
    Replies:
    0
    Views:
    317
    mscir
    Oct 12, 2005
  4. Replies:
    7
    Views:
    201
    Yanick
    Aug 4, 2006
  5. Chris Angelico
    Replies:
    9
    Views:
    233
    Andrew Cooper
    Jul 29, 2012
Loading...

Share This Page