Click here to Skip to main content
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 2: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)



Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2014
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