Making a Preview Page

J

JJ

I have some html in a textbox. I'd like to have a 'preview' button that
allows the user to see what the html would look like as rendered in a page.
How could I do this without having to write the document temporarily to a
database (or other data store)?

Thanks,
JJ
 
C

chanko

I have some html in a textbox. I'd like to have a 'preview' button that
allows the user to see what the html would look like as rendered in a page.
How could I do this without having to write the document temporarily to a
database (or other data store)?

Thanks,
JJ

Could you maybe store the html in a Session variable, and open up a
new window, where you check to see if said Session variable isn't
null, and then just display it on that new blank screen

does that work for you?
 
J

JJ

How much can a session variable store? Might I run into problems if the html
code is quite long?

Is there a way perhaps to 'post' the textbox text to another page which
simply displays what it receives ?

Thanks,
JJ
 
C

chanko

Could you maybe store the html in a Session variable, and open up a
new window, where you check to see if said Session variable isn't
null, and then just display it on that new blank screen

does that work for you?

oh, and the way i would probably display it
is place a div in your aspx page with a runat=server tag, and in
codebehind

div.InnerHtml = Session["variable"].ToString();

or even, i think you can add a <asp:Literal... object in aspx page,
and just assign the session variable to the literal object Text
property
 
C

chanko

Could you maybe store the html in a Session variable, and open up a
new window, where you check to see if said Session variable isn't
null, and then just display it on that new blank screen
does that work for you?

oh, and the way i would probably display it
is place a div in your aspx page with a runat=server tag, and in
codebehind

div.InnerHtml = Session["variable"].ToString();

or even, i think you can add a <asp:Literal... object in aspx page,
and just assign the session variable to the literal object Text
property

well, you can store whatever you want in a session variable
i don't think that being just plain text, it would matter that much
how long the html would be

other than that i'm not sure any other way to do it, without storing
it some place
maybe somebody else can give you a better idea as to how to achieve
this

good luck
 
J

JJ

Thanks - I'll give your suggestion a go.
JJ
chanko said:
On Jun 13, 11:08 am, "JJ" <[email protected]> wrote:
I have some html in a textbox. I'd like to have a 'preview' button
that
allows the user to see what the html would look like as rendered in a
page.
How could I do this without having to write the document temporarily
to a
database (or other data store)?

Could you maybe store the html in a Session variable, and open up a
new window, where you check to see if said Session variable isn't
null, and then just display it on that new blank screen
does that work for you?

oh, and the way i would probably display it
is place a div in your aspx page with a runat=server tag, and in
codebehind

div.InnerHtml = Session["variable"].ToString();

or even, i think you can add a <asp:Literal... object in aspx page,
and just assign the session variable to the literal object Text
property

well, you can store whatever you want in a session variable
i don't think that being just plain text, it would matter that much
how long the html would be

other than that i'm not sure any other way to do it, without storing
it some place
maybe somebody else can give you a better idea as to how to achieve
this

good luck
 
K

kal

JJ said:
I have some html in a textbox. I'd like to have a 'preview' button that
allows the user to see what the html would look like as rendered in a page.
How could I do this without having to write the document temporarily to a
database (or other data store)?
A really cool way of doing this is to create put all your current contact in
a div and then have another hidden div also. - then when the user clicks
preview - your current div is hidden and the other divs innerhtml is changed
to your textbox txt and then shown.

way cool

Kal
 
J

JJ

Thanks,

JJ
kal said:
A really cool way of doing this is to create put all your current contact
in a div and then have another hidden div also. - then when the user
clicks preview - your current div is hidden and the other divs innerhtml
is changed to your textbox txt and then shown.

way cool

Kal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top