Click here to Skip to main content
11,417,750 members (46,127 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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">
                                            <Columns>
                                                <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.

thanks,
raj
Posted 23-Jan-13 3:16am

1 solution

Rate this: bad
good
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
RandomString();
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..
  Permalink  

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

  Print Answers RSS
0 Sascha Lefévre 340
1 Abhinav S 339
2 OriginalGriff 315
3 Sergey Alexandrovich Kryukov 255
4 deepankarbhatnagar 121
0 Sergey Alexandrovich Kryukov 9,345
1 OriginalGriff 7,712
2 Maciej Los 3,758
3 Abhinav S 3,601
4 Sascha Lefévre 3,198


Advertise | Privacy | Mobile
Web03 | 2.8.150427.4 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2015
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