need help about secure query string

indianswz

Newcomer
Joined
Mar 27, 2004
Messages
14
hi......friends,

i want to have some tutorials or samples regarding secure query string in datalist in asp.net when some values r passed from one page to another.

currently i have just simple query string but now i want my querystring to be secure and not visible in the address bar.......

hope u guyz understand my question......and reply.

i am using vb as the language.

bye
 
wessamzeidan said:
You can encode the values in the query string and then decode them in the recieving page......

hi......i am getting what u r telling to do.......but i have a datalist generated from database regarding the available products.....and then have the buy button near each of the product....so i need to pass the product id and product price to the next page......the BUY button code is as below...:

<asp:HyperLink id="buy" target="_blank" runat="server" navigateurl='<%# "buy.aspx?productid=" &Container.DataItem("productid") & "&price=" & Container.DataItem("price") %>' >BUY</asp:HyperLink>

so.....how do i write the code to secure this querystring which appears on the next page i.e. buy.aspx

write me if u have any questions........or want some more information.

bye
 
If you already have a function that encryptes your string, define it in your code behind, and use it in your aspx file like this

<asp:HyperLink id="buy" target="_blank" runat="server" navigateurl='<%# "buy.aspx?productid=" & myEncFunction(Container.DataItem("productid")) & "&price=" & myEncFunction(Container.DataItem("price")) %>' >BUY</asp:HyperLink>
 
you could make use of Session.Item("Query"). This is out from the user view.

EG:
first.aspx
Private Sub Button1_Click(....) Handles Button1.Click
Session.Item("Query") = strQuery
Response.Redirect("second.aspx")
End Sub

second.aspx
Private Sub Load(....)
cmd = New Command(Session.Item("Query"), conn)
End Sub
 
georgepatotk said:
you could make use of Session.Item("Query"). This is out from the user view.

EG:
first.aspx
Private Sub Button1_Click(....) Handles Button1.Click
Session.Item("Query") = strQuery
Response.Redirect("second.aspx")
End Sub

second.aspx
Private Sub Load(....)
cmd = New Command(Session.Item("Query"), conn)
End Sub

hi...

i am really confused about using sessions for querystring......

look...just now i have a querystring which looks like this......which is in the BUY link.

<asp:HyperLink id="buy" target="_blank" runat="server" navigateurl='<%# "buy.aspx?productid=" &Container.DataItem("productid") & "&price=" & Container.DataItem("price") %>' >BUY</asp:HyperLink>

so.....now how can i store this productid and price which r coming from the container.dataitem in the session.........if u could create a sample code for the above thing.......take the first page as products.aspx and the second as buy.aspx in which the details r to be displayed on the basis of the product id selected....

would be very thankful to u ........if u help me
 
<asp:HyperLink id="buy" target="_blank" runat="server" navigateurl='<%# "buy.aspx%>' >BUY</asp:HyperLink>


buy.aspx
Private Sub Load(....)
cmd = New Command(Session.Item("Query"), conn)
End Sub
 
Back
Top