encrypt the querystring values for a HyperLinkColumn

  • Thread starter Thread starter TJS
  • Start date Start date
T

TJS

how can I encrypt the querystring values for a HyperLinkColumn ?

in example below I would like to encrypt value for field1
======================================================
<asp:HyperLinkColumn Text="View" DataNavigateUrlField="field1"
DataNavigateUrlFormatString="page.aspx?idx={0}"></asp:HyperLinkColumn>
 
-----Original Message-----
how can I encrypt the querystring values for a HyperLinkColumn ?

in example below I would like to encrypt value for field1
======================================================
<asp:HyperLinkColumn Text="View" DataNavigateUrlField="field1"
DataNavigateUrlFormatString="page.aspx?idx=
{0}"> said:
.I had the same question, and the following seems to
work. You have to use an <asp:TemplateColumn> instead of
a hyperlinkcolumn, however.

<asp:TemplateColumn HeaderText="Course (Click to Edit)">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemTemplate>
<asp:HyperLink Runat="server" text='<%#
DataBinder.Eval(Container, "DataItem.Course_Code") %>'
navigateurl='<%
# "CourseDetails.aspx?index=0&ID=" & _
Server.URLEncode(DataBinder.Eval
(Container, "DataItem.Course_Code")) %>' />
</ItemTemplate>
 
thank you !

work. You have to use an <asp:TemplateColumn> instead of
a hyperlinkcolumn, however.

<asp:TemplateColumn HeaderText="Course (Click to Edit)">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemTemplate>
<asp:HyperLink Runat="server" text='<%#
DataBinder.Eval(Container, "DataItem.Course_Code") %>'
navigateurl='<%
# "CourseDetails.aspx?index=0&ID=" & _
Server.URLEncode(DataBinder.Eval
(Container, "DataItem.Course_Code")) %>' />
</ItemTemplate>
 
Back
Top