Encoding a value
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdatagridrepeaterdatalist' list.


sanderson@calibresys.com
Have a datagrid with a hyperlink using an Itemtemplate

                                    
<asp:TemplateColumn SortExpression="Title" HeaderText="Course Name">
<ItemTemplate>
    <a href='MLN_COURSEINFO.aspx?UNIVID=
<%#DataBinder.Eval(Container.DataItem,"UNIV_ID")%>&COURSEID=
        <% #DataBinder.Eval(Container.DataItem,"Course_CD")%>'
style="color:Black;">

        <%#DataBinder.Eval(Container.DataItem,"Title")%>
    </a>
</ItemTemplate>
</asp:TemplateColumn>

Problem is I need to encode the data because some of the Course Codes have
"&" in them. Is this possible?

Reply to this message...
 
    
Administrator
Use the "'s as in below. It might be single 's, I can't recall off the =
top of my head.

<asp:TemplateColumn SortExpression=3D"Title" HeaderText=3D"Course Name">
<ItemTemplate>
    <a href=3D"MLN_COURSEINFO.aspx?UNIVID=3D"
<%#DataBinder.Eval(Container.DataItem,"UNIV_ID")%>"&COURSEID=3D"
        <% #DataBinder.Eval(Container.DataItem,"Course_CD")%>"
style=3D"color:Black;">

        <%#DataBinder.Eval(Container.DataItem,"Title")%>
    </a>
</ItemTemplate>
</asp:TemplateColumn>

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 08, 2002 7:00 PM
To: aspngDataGridRepeaterDatalist
Subject: [aspngdatagridrepeaterdatalist] Encoding a value

Have a datagrid with a hyperlink using an Itemtemplate

                                =09
<asp:TemplateColumn SortExpression=3D"Title" HeaderText=3D"Course Name">
<ItemTemplate>
    <a href=3D'MLN_COURSEINFO.aspx?UNIVID=3D
<%#DataBinder.Eval(Container.DataItem,"UNIV_ID")%>&COURSEID=3D
        <% #DataBinder.Eval(Container.DataItem,"Course_CD")%>'
style=3D"color:Black;">

        <%#DataBinder.Eval(Container.DataItem,"Title")%>
    </a>
</ItemTemplate>
</asp:TemplateColumn>

Problem is I need to encode the data because some of the Course Codes =
have
"&" in them. Is this possible?

| [aspngdatagridrepeaterdatalist] member Click here to reveal e-mail address =3D =
YOUR ID
| http://www.aspfriends.com/aspfriends/aspngdatagridrepeaterdatalist.asp =
=3D JOIN/QUIT

Reply to this message...
 
 
System.ComponentModel.Container
System.Web.UI.DataBinder
System.Web.UI.WebControls.TemplateColumn




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com