473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Easy Question ;-) How to render a html page in a table cell of an ASP.NET page

I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM

Dec 14 '06 #1
7 2423
Use an iframe.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"SteveM" <st*********@philips.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
>I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM

Dec 14 '06 #2
Do you have the control of the generated html document ? In other words, is
it possible to insert into your chain an xml format ...
Word -xml -html in your first app,
Word -xml -table cell inner html in your second app...

An other solution could be to use the WebClient class.

WebClient wc = new WebClient();

string result = wc.DownloadData();

Regex r = new Regex(@"\<body\>(?<body>.*)\</body\>",
RegexOptions.IgnoreCase); // not sur of the syntax

string body = r.Match("result").Group["body"].Value;

yourTable.Controls.Add(new Literal(body));
The idea is to capture the body of the remote page using regex, and to
render the captured content to your page.

HTH

"SteveM" <st*********@philips.coma écrit dans le message de news:
11*********************@79g2000cws.googlegroups.co m...
>I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM

Dec 14 '06 #3
Eliyahu,

I created a custom control based on an IFrame but because it is a frame
it is bounded and
requires me to either have scroll bars are determine ahead of time the
size to make the frame. I could find no where where it would let me
bind the frame to the side of the cell itself
and thus make it adjustable as the page grows or shrinks (the way a
normal HTML page will do). Do you know a way to do this?

Thanks
-Steve

Eliyahu Goldin wrote:
Use an iframe.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"SteveM" <st*********@philips.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM
Dec 14 '06 #4
Steve,
I use the SaveAs option with a HTML format to convert the Word document
to HTML
There is also an XML format, but I fail to see what that buys me?
(Perhaps I do not fully understand the relationship here or how XML
renders itself)

The second solution is something I was toying with, capturing the HTML
from the page and writing it into my aspx file in the cell location, is
that what you are getting at?
I will look up WebClient... I have never used this class before
Thanks
-SteveM

Steve B. wrote:
Do you have the control of the generated html document ? In other words,is
it possible to insert into your chain an xml format ...
Word -xml -html in your first app,
Word -xml -table cell inner html in your second app...

An other solution could be to use the WebClient class.

WebClient wc = new WebClient();

string result = wc.DownloadData();

Regex r = new Regex(@"\<body\>(?<body>.*)\</body\>",
RegexOptions.IgnoreCase); // not sur of the syntax

string body = r.Match("result").Group["body"].Value;

yourTable.Controls.Add(new Literal(body));
The idea is to capture the body of the remote page using regex, and to
render the captured content to your page.

HTH

"SteveM" <st*********@philips.coma écrit dans le message de news:
11*********************@79g2000cws.googlegroups.co m...
I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM
Dec 14 '06 #5
You have to use an iframe, as a whole html page cotnains head. body etc and
you cant have that in a table cell as it will create invalid html. Also, if
you try to extract just the body, and features of the page are using
javascript or CSS injected into the head then you will lose its
functionality or its style.

Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"SteveM" <st*********@philips.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
>I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM

Dec 14 '06 #6
John,
So if I have an IFrame based custom control, I am assuming that I can
put that in a
table cell?

IFrame's are really new to me, do you have any good resources where I
can see an example at least similiar to what i want to do ( I seem to
learn by example a lot faster ;-) )

Thanks
-Steve

John Timney (MVP) wrote:
You have to use an iframe, as a whole html page cotnains head. body etc and
you cant have that in a table cell as it will create invalid html. Also, if
you try to extract just the body, and features of the page are using
javascript or CSS injected into the head then you will lose its
functionality or its style.

Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"SteveM" <st*********@philips.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM
Dec 14 '06 #7

"SteveM" <st*********@philips.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
John,
So if I have an IFrame based custom control, I am assuming that I can
put that in a
table cell?
Dont see why not - you'll need to work out how to style it based on your
current page dimensions though if you expect it to shrink and grow as your
page dynamically resizes
IFrame's are really new to me, do you have any good resources where I
can see an example at least similiar to what i want to do ( I seem to
learn by example a lot faster ;-) )
http://harishmvp.blogspot.com/2005/0...namically.html
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog

Thanks
-Steve

John Timney (MVP) wrote:
>You have to use an iframe, as a whole html page cotnains head. body etc
and
you cant have that in a table cell as it will create invalid html. Also,
if
you try to extract just the body, and features of the page are using
javascript or CSS injected into the head then you will lose its
functionality or its style.

Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"SteveM" <st*********@philips.comwrote in message
news:11*********************@79g2000cws.googlegro ups.com...
>I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page... that is the way it supposed to work. I am falling down on the
part on how to render the html back to the cell of table (used for
formatting) on my ASP.NET page. I can find no controls that allow you
to display another html page. I have tried putting it into a custom
control, but then I am faced with scroll bars and it doesnt have the
look and feel of a normal HTML (sizing by sizing the page).

So in a nutshell what I want to be able to do is take page a (which is
an html converted document) and display it in a content section in a
table cell of a master page... thats all simple huh?

Thanks for any help or pointers you can give me
-SteveM

Dec 14 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Timothy Madden | last post by:
Hello Please take a look at this table: http://web.ss.pub.ro/~bat/HelloWorld.php Now the table has the width property set to 100%, which should mean the width available to the browser. Does...
10
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
6
by: Paul Thompson | last post by:
In NN/FF/Moz, it takes 20 sec to render a page from a file of 330 KB. It takes less than 1 sec to render that file in IE. Is there some tweak that I can make on NN to alter this? The...
3
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
4
by: Zuel | last post by:
Hi Folks. So I have a small problem. My DoPostBack function is not writen to the HTML page nor are the asp:buttons calling the DoPostBack. My Goal is to create a totaly dynamic web page where...
0
by: Subba Rao via DotNetMonster.com | last post by:
---------------------------HTML---------------------------------------- <html> <head> <title>:: DHTML Table Demo ::</title> <script langauge="javascript" src="InterchangeRows.js"></script>...
3
by: John Hughes | last post by:
I'm trying to add a user control to a form via the pages render method and I get the following error : "Control 'Button1' of type 'Button' must be placed inside a form tag with runat=server" ...
7
by: Mariusf | last post by:
I am a novice Perl programmer and need to change a perl script that I use to create web pages with thumbnail images and some text. Currently the script created a web page for each artist / category...
2
by: Albin | last post by:
Hi, I have a html page where in the table spans for two pages the first page's last row doesn end properly and the 2nd page's first row also isnt proper.The code i use is given below,the no of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.