Click here to Skip to main content
13,252,362 members (58,891 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all,

i want to encrypt query string in grid view's HyperLinkField
i have navigate url like this:

<asp:GridView ID="grid" runat="server" Style="position: relative"  AutoGenerateColumns="False">
                                                <asp:HyperLinkField HeaderText="आवेदन संख्या" DataNavigateUrlFormatString="~/Services/HortiCulture/G2G/FRMAppRejScreen.aspx?App_no={0}"
                                                    DataNavigateUrlFields="APPLICATION_NO" DataTextField="APPLICATION_NO"/>

and in repeater also i have used hyper link ,
so pls tell me how to encrypt this query string in source view & code behind page.

Posted 23-Jan-13 3:16am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use this block of code.

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl=<%#"/aspnetqueryurl/Details.aspx?query="+RandomString(15)+ GetMd5Hash(eval("aircraftid"))+ RandomString(7) %>’ Text="Read Details"></asp:HyperLink>

Here the function
is used to generate some random numbers which are added before and after your desired value. So when you will need to decode the query string to original value then simply just delete them from head and tail.

Happy Coding..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100