Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

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

XML
<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

1 solution

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..
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900