471,321 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Insert text into an ASPx page

Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm i
am having is that I have created an ASPx page with some text in, and need to
add a block of text at a particular place from a database table (reading the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin
Jan 19 '06 #1
7 1689
if its plain text
u can display it in label

"Martin" <Ma****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm
i
am having is that I have created an ASPx page with some text in, and need
to
add a block of text at a particular place from a database table (reading
the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of
the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin

Jan 19 '06 #2
Hi
I think it is plain text, and have been playing with literals - it seems to
display better irrespective of how much text is inserted. If I want to add
in HTML tagged text, what are my options?
Thanks
Martin

"Ankit Aneja" wrote:
if its plain text
u can display it in label

"Martin" <Ma****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm
i
am having is that I have created an ASPx page with some text in, and need
to
add a block of text at a particular place from a database table (reading
the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of
the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin


Jan 19 '06 #3
You can put a Placeholder control situated in the exact place on the page
that you need. Then you can add controls to this after you get your data. It
could be an Generic control, label, Panel, whatever you need.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Martin" wrote:
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm i
am having is that I have created an ASPx page with some text in, and need to
add a block of text at a particular place from a database table (reading the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin

Jan 19 '06 #4
Peter
OK - that sort of makes sense. So, how do you control a placeholder? Can
you turn on/off display?
Regards
Martin

"Peter Bromberg [C# MVP]" wrote:
You can put a Placeholder control situated in the exact place on the page
that you need. Then you can add controls to this after you get your data. It
could be an Generic control, label, Panel, whatever you need.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Martin" wrote:
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm i
am having is that I have created an ASPx page with some text in, and need to
add a block of text at a particular place from a database table (reading the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin

Jan 19 '06 #5
=?Utf-8?B?TWFydGlu?= <Ma****@discussions.microsoft.com> wrote in
news:9F**********************************@microsof t.com:
I think it is plain text, and have been playing with literals - it
seems to display better irrespective of how much text is inserted. If
I want to add in HTML tagged text, what are my options?


Almost any HTML tag can be made accessible to the code-behind by adding a
tag 'runat=server' and 'id=<name>' as attributes. You can then access the
"inside" of the tag with <name>.innerHtml. You could do this with a div or
a span or whatever suits your needs.

-mdb
Jan 19 '06 #6
Hi,

Just use a Label , also you could use a DIV and set the text in your code.

In reality there are multiple ways of doing it, it's a simple task

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Martin" <Ma****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm
i
am having is that I have created an ASPx page with some text in, and need
to
add a block of text at a particular place from a database table (reading
the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of
the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin

Jan 19 '06 #7
Hi
Used the placeholder (as suggested) and the appropriate tags to sort it out
- once I'd looked at the hlp for Placeholder, it all made sense.
Thanks for your time
Martin

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Just use a Label , also you could use a DIV and set the text in your code.

In reality there are multiple ways of doing it, it's a simple task

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Martin" <Ma****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm
i
am having is that I have created an ASPx page with some text in, and need
to
add a block of text at a particular place from a database table (reading
the
data I can do) - can anyone point me in the direction of some sample
code/examples on how to do this? The reason behind it is that mosst of
the
text being used is generic, but particular apps have specific additional
text, and I want to find the best way to achieve this.
Thanks in advance
Martin


Jan 19 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by =?Utf-8?B?bXBhaW5l?= | last post: by
2 posts views Thread by =?Utf-8?B?UGhpbGlw?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.