RE: changing hyperlinks within item templates at runtime

From: Bill Borg (anonymous_at_discussions.microsoft.com)
Date: 04/08/04


Date: Thu, 8 Apr 2004 09:51:04 -0700

Paul, there are a couple ways to go, but here's one: return the string for your "return page" from a public function of the page class, then use something like...

    href='<%# MyReturnPage() + databinder.eval(etc.) %>'

hth,

Bill
     
     ----- Paul wrote: -----
     
     There are a number of places in my app where I want the user to work
     with an item (a real physical item referred to by its stock number) If
     such an item hasn't been selected, I redirect the user to a page to
     select one. Then having selected one, want to redirect them back from
     where they came (passing the stockitemID ). It's this latter part
     (redirection from where they came) that's bugging me.
     
     I'm using a datagrid to display the items that fit the search criteria.
     One of the columns is a hyperlink that needs to redirect the user back
     to the page that they came from.
     
     At 1st when I had only one page, I hard coded the return page like this:
     
     <item template><a href='returnpage.aspx?itemid=<#%databinder.eval(container.dataitem,
     "ID")%>.... and the rest..... </a></item template>
     
     I need to change "returnpage.aspx" to reflect the page that the user
     came from. It's not getting the value that's the problem, it's getting
     that value into the above statement!
     
     Subsequently, I made the item template contain <an asp:hyperlink> in the
     hope that I could manipulate the navigateURL property in the code
     behind. However, I get an "Object reference not set to an instance of
     an object" error when I try that. (It seems that "ids" of items within
     datagrids aren't what they seem!)
     
     I thought of passing the returnURL to the SQL server stored proc and
     passing it back again. That would definitely work (I could refer to the
     return page using the
     
     <%# databinder.eval.....%>
     
     syntax, but it seems very silly to pass a parameter only to return it
     back again!
     
     
     There must be another way! Any advice gratefully received.
     
     --
     Paul
     



Relevant Pages

  • Re: pb with OID_802_11_BSSID_LIST_SCAN
    ... Paul T., I have try your project "RFSSIDList", but the problem is that I ... does not really support this command (it is a dell axim x3i pocket pc 2003). ... > that passing a pointer for the output buffer, but passing a size of zero ... > causing a test in the driver to fail before it does anything. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: pb with OID_802_11_BSSID_LIST_SCAN
    ... Paul T., I have try your project "RFSSIDList", but the problem is that I ... does not really support this command (it is a dell axim x3i pocket pc 2003). ... > that passing a pointer for the output buffer, but passing a size of zero ... > causing a test in the driver to fail before it does anything. ...
    (microsoft.public.pocketpc.developer)
  • Re: pb with OID_802_11_BSSID_LIST_SCAN
    ... Paul T., I have try your project "RFSSIDList", but the problem is that I ... does not really support this command (it is a dell axim x3i pocket pc 2003). ... > that passing a pointer for the output buffer, but passing a size of zero ... > causing a test in the driver to fail before it does anything. ...
    (microsoft.public.windowsce.app.development)
  • Re: pb with OID_802_11_BSSID_LIST_SCAN
    ... Paul T., I have try your project "RFSSIDList", but the problem is that I ... does not really support this command (it is a dell axim x3i pocket pc 2003). ... > that passing a pointer for the output buffer, but passing a size of zero ... > causing a test in the driver to fail before it does anything. ...
    (microsoft.public.pocketpc.developer.networking)
  • changing hyperlinks within item templates at runtime
    ... want to redirect them back from ... where they came (passing the stockitemID). ... </item template> ... I get an "Object reference not set to an instance of ...
    (microsoft.public.dotnet.framework.aspnet)