Hi,
you are trying to combine two absolutly different functionality. NavigateUrl
is used in browser to construct new GET HTTP request and point it to
described resource on web server - this means you actual page cannot response
to this request because it will not be posted back. On the other hand link
button uses post back mechanism = user usually constructs POST HTTP (type of
request can be changed) request and sends it to you current page for
processing.
You have to choose another approach to solve your requirements. You can use
link button and post back you url or any other identifier as command
argument. Then you can handle logging in on command event and transfer
(server side - url will be same as search page) or redirect (client side - if
you want url to reflect actual user choice but it means one more round trip)
to page you want to display as response to user click. Another approach you
can choose is to use hyperlink and add some query string to NavigateUrl to
inform your application to log user request. You can handle logging in each
page or for example in custom http module.
Regards,
Ladislav
> Hi There,
>
[quoted text clipped - 21 lines]
> subclass one of the above controls and add the functionality, but that
> sounds messy to me.
Alexey Smirnov - 15 Aug 2007 08:20 GMT
On Aug 15, 9:04 am, Ladislav Mrnka
<LadislavMr...@discussions.microsoft.com> wrote:
> Hi,
> you are trying to combine two absolutly different functionality. NavigateUrl
[quoted text clipped - 17 lines]
> Regards,
> Ladislav
I fully agree. In addition to Ladislav's proposals you can try
following:
- use Hyperlink Control with onclientclick property where you can call
an Ajax function before client will be redirected to the NavigateUrl.
- use Hyperlink Control pointed to another webform, e.g. redirect.aspx?
url=http://mysite/mypage where url will be your target url and write
your statistics from the redirect.aspx
- use HttpHandler and check HTTP_REFERER. if the referrer is the
address of your search page then you can log that request.