Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Replace a text by a control

Reply
Thread Tools

Replace a text by a control

 
 
gokul
Guest
Posts: n/a
 
      07-30-2004
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
 
Reply With Quote
 
 
 
 
Juno
Guest
Posts: n/a
 
      07-30-2004
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: m...
> 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



 
Reply With Quote
 
 
 
 
gokul
Guest
Posts: n/a
 
      08-02-2004
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: m...
> > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Text editors (was Re: Search and replace text in XML file?) Chris Angelico Python 9 07-29-2012 05:55 PM
Regular Expression to Replace UPPER Case Text with lower case text penny Perl Misc 28 03-10-2008 01:14 AM
Replace text in text box with innerhtml type thing bobd314@gmail.com Javascript 7 08-04-2006 12:18 PM
replace text in IFRAME using innerHTML.replace(...) possible? mscir Javascript 0 10-11-2005 11:21 PM
replace instances of text on page with image or other text? juglesh Javascript 16 12-27-2004 04:14 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57