By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

How to insert HTML strings in ASP.net

P: n/a
Hi, friends,

In ASP, we use
obj = CreateObject("com.dll")
obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
to get different HTML strings based on input values.

Then, we insert them into proper location of HTML something like the
following:
<table>
<% = outHTMLTxt1 %>
</table>

In ASP.net, how do we do this? I looked into Page_Load() event, and I could
get different HTML strings, but I did not know how to insert them into proper
location of HTML.

Any sample source code or reference papers? Help please.

Thanks a lot
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
you can either use a control, which is what I recommend, or you can still do
inline coding with asp.net.. the <% %> is still usable.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
Hi, friends,

In ASP, we use
obj = CreateObject("com.dll")
obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
to get different HTML strings based on input values.

Then, we insert them into proper location of HTML something like the
following:
<table>
<% = outHTMLTxt1 %>
</table>

In ASP.net, how do we do this? I looked into Page_Load() event, and I could
get different HTML strings, but I did not know how to insert them into proper
location of HTML.

Any sample source code or reference papers? Help please.

Thanks a lot

Nov 19 '05 #2

P: n/a
But, I do not have object, such as com.dll, any more. I created different
HTML strings in Page_load(). How can I instert it in HTML? Any sample code?

"Curt_C [MVP]" wrote:
you can either use a control, which is what I recommend, or you can still do
inline coding with asp.net.. the <% %> is still usable.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
Hi, friends,

In ASP, we use
obj = CreateObject("com.dll")
obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
to get different HTML strings based on input values.

Then, we insert them into proper location of HTML something like the
following:
<table>
<% = outHTMLTxt1 %>
</table>

In ASP.net, how do we do this? I looked into Page_Load() event, and I could
get different HTML strings, but I did not know how to insert them into proper
location of HTML.

Any sample source code or reference papers? Help please.

Thanks a lot

Nov 19 '05 #3

P: n/a
Huh?
What specifically is your question? Is it how to get a string/text/html from
code onto the page, or how to get the string/text/html out of a DLL you wrote?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
But, I do not have object, such as com.dll, any more. I created different
HTML strings in Page_load(). How can I instert it in HTML? Any sample code?

"Curt_C [MVP]" wrote:
you can either use a control, which is what I recommend, or you can still do
inline coding with asp.net.. the <% %> is still usable.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
Hi, friends,

In ASP, we use
obj = CreateObject("com.dll")
obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
to get different HTML strings based on input values.

Then, we insert them into proper location of HTML something like the
following:
<table>
<% = outHTMLTxt1 %>
</table>

In ASP.net, how do we do this? I looked into Page_Load() event, and I could
get different HTML strings, but I did not know how to insert them into proper
location of HTML.

Any sample source code or reference papers? Help please.

Thanks a lot

Nov 19 '05 #4

P: n/a
For exmple, in Page_Load()

newHTMLStr = "<tr><td>....";

If I use Reponse.Write(newHTMLStr), all those <tr><td> element will be on
the top of web page. But, I want to inert those <tr><td> elements into
<table></table>. This <table></table> element was already created when I
designed the web page by draging and droping it in a web form.

My question is: How to insert this new created newHTMLStr into pre-existing
<table></table> element so that we have cells in the previouly empty
<table></table> element.
"Curt_C [MVP]" wrote:
Huh?
What specifically is your question? Is it how to get a string/text/html from
code onto the page, or how to get the string/text/html out of a DLL you wrote?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
But, I do not have object, such as com.dll, any more. I created different
HTML strings in Page_load(). How can I instert it in HTML? Any sample code?

"Curt_C [MVP]" wrote:
you can either use a control, which is what I recommend, or you can still do
inline coding with asp.net.. the <% %> is still usable.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:

> Hi, friends,
>
> In ASP, we use
> obj = CreateObject("com.dll")
> obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
> to get different HTML strings based on input values.
>
> Then, we insert them into proper location of HTML something like the
> following:
> <table>
> <% = outHTMLTxt1 %>
> </table>
>
> In ASP.net, how do we do this? I looked into Page_Load() event, and I could
> get different HTML strings, but I did not know how to insert them into proper
> location of HTML.
>
> Any sample source code or reference papers? Help please.
>
> Thanks a lot

Nov 19 '05 #5

P: n/a
Check out the Literal control

Basically you would declare a Literal control in your HTML table - where you
want the inserted HTML to go. Then, in your code behind, you'd set the .Text
property of the Literal control to your HTML string. It's that simple.

If you want your HTML to be styled, then you'd have to use inline CSS or set
the css class property directly in the HTML string you are inserting.

http://www.w3schools.com/aspnet/control_literal.asp

http://msdn.microsoft.com/library/de...classtopic.asp
-HTH
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com...
For exmple, in Page_Load()

newHTMLStr = "<tr><td>....";

If I use Reponse.Write(newHTMLStr), all those <tr><td> element will be on
the top of web page. But, I want to inert those <tr><td> elements into
<table></table>. This <table></table> element was already created when I
designed the web page by draging and droping it in a web form.

My question is: How to insert this new created newHTMLStr into
pre-existing
<table></table> element so that we have cells in the previouly empty
<table></table> element.
"Curt_C [MVP]" wrote:
Huh?
What specifically is your question? Is it how to get a string/text/html
from
code onto the page, or how to get the string/text/html out of a DLL you
wrote?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
> But, I do not have object, such as com.dll, any more. I created
> different
> HTML strings in Page_load(). How can I instert it in HTML? Any sample
> code?
>
> "Curt_C [MVP]" wrote:
>
> > you can either use a control, which is what I recommend, or you can
> > still do
> > inline coding with asp.net.. the <% %> is still usable.
> >
> > --
> > Curt Christianson
> > site: http://www.darkfalz.com
> > blog: http://blog.darkfalz.com
> >
> >
> >
> > "Andrew" wrote:
> >
> > > Hi, friends,
> > >
> > > In ASP, we use
> > > obj = CreateObject("com.dll")
> > > obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
> > > to get different HTML strings based on input values.
> > >
> > > Then, we insert them into proper location of HTML something like
> > > the
> > > following:
> > > <table>
> > > <% = outHTMLTxt1 %>
> > > </table>
> > >
> > > In ASP.net, how do we do this? I looked into Page_Load() event, and
> > > I could
> > > get different HTML strings, but I did not know how to insert them
> > > into proper
> > > location of HTML.
> > >
> > > Any sample source code or reference papers? Help please.
> > >
> > > Thanks a lot

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.