Sirdots
asked on
Hiding/encrypting a querystring variable
i have a templatefield and will like to hide the value of the student variable
when passing this to the next page. I decided to use the httputility.urlencode
to make this value non meaningful but this is not working for me. I am still
getting the same value. How can i do this?
asp:TemplateField HeaderText="picture">
<ItemTemplate>
<asp:HyperLink ID="Label1" runat="server" Text='<%# Bind("picture") %>' NavigateUrl=<%#"javascript :my_window =window.op en('displa yImage.asp x?student= " + UrlFullEncode(DataBinder.E val(Contai ner.DataIt em,"studen t").ToStri ng()) + "','my_window','width=300, height=300 ');my_wind ow.focus() " %>/>
</ItemTemplate>
</asp:TemplateField>
private const string _strApostropheEncoding = "%27";
public static string UrlFullEncode(string strUrl)
{
if (strUrl == null)
return "";
strUrl = HttpUtility.UrlEncode(strU rl);
return strUrl.Replace("'", _strApostropheEncoding);
}
when passing this to the next page. I decided to use the httputility.urlencode
to make this value non meaningful but this is not working for me. I am still
getting the same value. How can i do this?
asp:TemplateField HeaderText="picture">
<ItemTemplate>
<asp:HyperLink ID="Label1" runat="server" Text='<%# Bind("picture") %>' NavigateUrl=<%#"javascript
</ItemTemplate>
</asp:TemplateField>
private const string _strApostropheEncoding = "%27";
public static string UrlFullEncode(string strUrl)
{
if (strUrl == null)
return "";
strUrl = HttpUtility.UrlEncode(strU
return strUrl.Replace("'", _strApostropheEncoding);
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER