Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,117 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,003 people online right now. Registration is fast and FREE... Join Now!




How to generate HTML in a Pop Up window

 
Reply to this topicStart new topic

How to generate HTML in a Pop Up window, is it possible?

pepsidime
post 9 Oct, 2008 - 11:12 AM
Post #1


New D.I.C Head

*
Joined: 8 Oct, 2008
Posts: 4


My Contributions


I'm working in .NET. My page is in ASP with VB code behind. I've tried several methods to get this to work.

I need to display HTML sourcecode on the fly (which is stored in a String) in a pop up window when a user clicks a ButtonField control in my GridView.

I have a panel that I am trying to popup which would be sufficient I think if I could figure out how it works:
CODE
<asp:Panel ID="pnlHTML" runat="server" Visible="false" CssClass="modalPopup" Wrap="false"
        style="display:none;" BorderStyle="Solid" ScrollBars="Auto">
            <asp:Literal ID="litHTML" runat="server" />
        </asp:Panel>


Here is my code for the button field which is within a gridView:
CODE
<asp:ButtonField ButtonType="Button" CommandName="viewEmail" HeaderText="Email"
                    Text="View" />


And my code behind, I have this line within a Select statement on e.CommandName in my RowCommand subprocedure:
CODE
Case "viewEmail"
                    litHTML.Text = "<p>New</p><ul>    <li>Jones </li></ul>"
                    pnlHTML.Visible = True


How can I get this to work? Or is there a better way? It seems like I have tried everything. Any help would be most appreciated.

User is offlineProfile CardPM

Go to the top of the page

pepsidime
post 9 Oct, 2008 - 11:47 AM
Post #2


New D.I.C Head

*
Joined: 8 Oct, 2008
Posts: 4


My Contributions


The more I play around with this, the more I think there is no way to do it.

I've decided to just store the html into a file and use Resonse.Write to run a Javascript opening that file in a new window. This can be done in just a few lines and it's much easier than trying to figure this mess out. I'll just have to live with taking up more space on the web server.

Thanks to anyone that read!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 10:27AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month