Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > asp:HyperLinkColumn

Reply
Thread Tools

asp:HyperLinkColumn

 
 
TJS
Guest
Posts: n/a
 
      11-29-2003
how can I encrypt the querystring values for a HyperLinkColumn ?

in example below I would like to encrypt value for field1
================================================== ====
<asp:HyperLinkColumn Text="View" DataNavigateUrlField="field1"
DataNavigateUrlFormatString="page.aspx?idx={0}"></asp:HyperLinkColumn>



 
Reply With Quote
 
 
 
 
Sink
Guest
Posts: n/a
 
      12-01-2003
One way of doing this is to convert from a hyperlink to
a button column, they appear the same. Add an
OnItemCommand handler and in the OnItemCommand handler,
encrypt your id using whatever method you choose and the
call Response.Redirect("....?id=" + EncrytptedValue");
You have to extract the id from the e parameter wen the
OnItemCommand is called.
If you are using paging, make sure you add a check for the
pager in your OnItemCommand handler (the pager is just
another ListItem)or paging will no longer work, especially
as you are changing pages.
On your receiving page side, you decrypt your id and
forward you go.
The OnItemCommand is defined within the datagrid definition
and the check line for the OnItemCommand Handler

if(e.Item.ItemType == ListItemType.Pager)
return;

Hope this helps,
Sink

>-----Original Message-----
>how can I encrypt the querystring values for a

HyperLinkColumn ?
>
>in example below I would like to encrypt value for field1
>================================================= =====
><asp:HyperLinkColumn Text="View"

DataNavigateUrlField="field1"
>DataNavigateUrlFormatString="page.aspx?idx=

{0}"></asp:HyperLinkColumn>
>
>
>
>.
>

 
Reply With Quote
 
 
 
 
TJS
Guest
Posts: n/a
 
      12-01-2003
thanks for responding.

unfortunately, that would encrypt the value after it is displayed in the
form.
The encryption needs to prevent display at anytime.




"Sink" <(E-Mail Removed)> wrote in message
news:a28901c3b7df$a82e1c10$(E-Mail Removed)...
> One way of doing this is to convert from a hyperlink to
> a button column, they appear the same. Add an
> OnItemCommand handler and in the OnItemCommand handler,
> encrypt your id using whatever method you choose and the
> call Response.Redirect("....?id=" + EncrytptedValue");
> You have to extract the id from the e parameter wen the
> OnItemCommand is called.
> If you are using paging, make sure you add a check for the
> pager in your OnItemCommand handler (the pager is just
> another ListItem)or paging will no longer work, especially
> as you are changing pages.
> On your receiving page side, you decrypt your id and
> forward you go.
> The OnItemCommand is defined within the datagrid definition
> and the check line for the OnItemCommand Handler
>
> if(e.Item.ItemType == ListItemType.Pager)
> return;
>
> Hope this helps,
> Sink
>
> >-----Original Message-----
> >how can I encrypt the querystring values for a

> HyperLinkColumn ?
> >
> >in example below I would like to encrypt value for field1
> >================================================= =====
> ><asp:HyperLinkColumn Text="View"

> DataNavigateUrlField="field1"
> >DataNavigateUrlFormatString="page.aspx?idx=

> {0}"></asp:HyperLinkColumn>
> >
> >
> >
> >.
> >



 
Reply With Quote
 
SInk
Guest
Posts: n/a
 
      12-01-2003
If you keep the actual key in a non-visible field, a bound
column with Visible=False, display some other field,
your requirements would be met.
You would extract the key field from the hidden field
in the handler.

Alternatively, though if the field is hidden, you could
encrypt the key in a seperate db field, using say SHA, and
then use the encrypted field in your hidden field and
save the decrypt on the second page.

Regards
Sink



>-----Original Message-----
>thanks for responding.
>
>unfortunately, that would encrypt the value after it is

displayed in the
>form.
>The encryption needs to prevent display at anytime.
>
>
>
>
>"Sink" <(E-Mail Removed)> wrote in message
>news:a28901c3b7df$a82e1c10$(E-Mail Removed)...
>> One way of doing this is to convert from a hyperlink to
>> a button column, they appear the same. Add an
>> OnItemCommand handler and in the OnItemCommand handler,
>> encrypt your id using whatever method you choose and the
>> call Response.Redirect("....?id=" + EncrytptedValue");
>> You have to extract the id from the e parameter wen the
>> OnItemCommand is called.
>> If you are using paging, make sure you add a check for

the
>> pager in your OnItemCommand handler (the pager is just
>> another ListItem)or paging will no longer work,

especially
>> as you are changing pages.
>> On your receiving page side, you decrypt your id and
>> forward you go.
>> The OnItemCommand is defined within the datagrid

definition
>> and the check line for the OnItemCommand Handler
>>
>> if(e.Item.ItemType == ListItemType.Pager)
>> return;
>>
>> Hope this helps,
>> Sink
>>
>> >-----Original Message-----
>> >how can I encrypt the querystring values for a

>> HyperLinkColumn ?
>> >
>> >in example below I would like to encrypt value for

field1
>> >================================================= =====
>> ><asp:HyperLinkColumn Text="View"

>> DataNavigateUrlField="field1"
>> >DataNavigateUrlFormatString="page.aspx?idx=

>> {0}"></asp:HyperLinkColumn>
>> >
>> >
>> >
>> >.
>> >

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments