Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I display html snippets in a datagrid column?

Posted on 2009-05-03
11
Medium Priority
?
219 Views
Last Modified: 2013-12-17
Hey experts!  I am trying to store html encrypted text into a datagrid column (NOT A GRIDVIEW!!), in a web-based page.

Unfortunately, unless I add 'Server.UrlEncode(DataBind.Eval("MyColumn"))", the text in the column doesn't show up!  And if I add the above urlencode, the text displayed is the gobbledygook text with %'s and such.

Is there a way to display html encoded columns in a datagrid, so that the html code, looks like what you typed in?
0
Comment
Question by:louisiana_blues
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24293776
Enclose the text in quotes. Use either single or double quotes.
0
 

Author Comment

by:louisiana_blues
ID: 24295782
I'm sorry but I don't understand what you mean.  Could you please show a specific example?
0
 

Author Comment

by:louisiana_blues
ID: 24295836
Below is a specific column in my datagrid.  Could you change this snippet so the viewing of the grid (not the edit portion--that works fine), displays the html text correctly?
        <asp:TemplateColumn HeaderText="Box Info">
        <HeaderStyle Width="200px" ></HeaderStyle>
        <ItemTemplate>
            <%#Server.UrlEncode(DataBinder.Eval(Container.DataItem, "Box"))%>
        </ItemTemplate>
        <EditItemTemplate>
          <asp:TextBox Width="200px" CssClass="NormalText" runat="server" id="txtBox" Text='<%# DataBinder.Eval(Container.DataItem, "Box") %>' />
        </EditItemTemplate>               
        <FooterTemplate>
          <asp:TextBox id="txtNewBox" runat="server" Width="200px"></asp:TextBox>
        </FooterTemplate>
        </asp:TemplateColumn>

Open in new window

0
Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24295841
Do something like this

"'" & DataBind.Eval("MyColumn") & "'"
0
 

Author Comment

by:louisiana_blues
ID: 24319465
Yikes.  I can't seem to get an answer that I can understand...too many, well does he mean, 'this databind' or that one or does he mean inside the <Z% or outside?  Argghhh..  I don't know where to put your snipped.  I have Databinds all over the place as you can see in the code above.  Could someone with clarity (so there is nothing left out) please interpret the above answer?  I will give partial credit to whomever can provide an answer I an use.

Below is the specific expression I am using (as I've already specified above).  Could someone make the magic change that will allow me to view html snippets in my datagrid (not gridview!).

Thanks!
        <%#Server.UrlEncode(DataBinder.Eval(Container.DataItem, "SearchFor"))%>

Open in new window

0
 

Author Comment

by:louisiana_blues
ID: 24319587
And the answer yet again is no.  I would really appreciate if someone actually knows the ansewr--CodeCruiser keeps having me *try* things, but he doesn't know the answer.  I thought the powers that be here frown on people giving people answers when they don't know the answer...

At this point, this question is bulloxed up, because I've had to respond numerous times to wrong suggestions.  I'll keep the question open for another day or so, in hopes that an expert can help me.  Otherwise I'll have to close this, spend the time opening up another question.   Ack.  No more 'suggestions' please.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24320768
Good Luck Mate!
0
 

Author Comment

by:louisiana_blues
ID: 24321643
Could someone please remove CodeCruiser?  All he does is bollux up questions.  He doesn't know any answers...
0
 

Author Comment

by:louisiana_blues
ID: 24321645
Please close this question.
0
 

Accepted Solution

by:
louisiana_blues earned 0 total points
ID: 24321663
I answered this question on my own.  Please delete.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24508865
>it's been open for a year almost

From 03/05/09 to 29/05/09 is almost an year! Wow i did not know that.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question