Hi guys...
I must be going brain dead from working on this project for 80 hours in the
last week. I suppose that's part-time for some coders.. anyway...
I created a simple Hyperlink in a user control:
<asp:HyperLin k id="lnkRefine" runat="server" >Refine Search</asp:HyperLink>
In the code behind I am trying to set the NavigateURL depending upon a
condition. I include the entire Sub since it may reveal what I am doing
wrong:
----------------------------------------------
Protected Sub Page_PreRender( ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.PreRender
Dim lnkRefine As HyperLink = FindControl("ln kRefine")
If Not IsDBNull(lnkRef ine) Then
If strPassthru = "passthru" Then
lnkRefine.Navig ateUrl =
"~/Search/SearchDetail.as px?page=base&se archId=" & strSavedSearchI D
Else
lnkRefine.Navig ateUrl = "javascript:his tory.go(-1)"
End If
End If
End Sub
------------------------------------------------------
Since the code gets past the If Not IsDBNull(lnkRef ine) I assume (maybe
incorrectly) that the control was found and object reference instantiated.
On the line:
lnkRefine.Navig ateUrl = "~/Search/SearchDetail.as px?page=base&se archId=" &
strSavedSearchI D
I am getting the error:
Object reference not set to an instance of an object
Any help would be appreciated... thanks
I must be going brain dead from working on this project for 80 hours in the
last week. I suppose that's part-time for some coders.. anyway...
I created a simple Hyperlink in a user control:
<asp:HyperLin k id="lnkRefine" runat="server" >Refine Search</asp:HyperLink>
In the code behind I am trying to set the NavigateURL depending upon a
condition. I include the entire Sub since it may reveal what I am doing
wrong:
----------------------------------------------
Protected Sub Page_PreRender( ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.PreRender
Dim lnkRefine As HyperLink = FindControl("ln kRefine")
If Not IsDBNull(lnkRef ine) Then
If strPassthru = "passthru" Then
lnkRefine.Navig ateUrl =
"~/Search/SearchDetail.as px?page=base&se archId=" & strSavedSearchI D
Else
lnkRefine.Navig ateUrl = "javascript:his tory.go(-1)"
End If
End If
End Sub
------------------------------------------------------
Since the code gets past the If Not IsDBNull(lnkRef ine) I assume (maybe
incorrectly) that the control was found and object reference instantiated.
On the line:
lnkRefine.Navig ateUrl = "~/Search/SearchDetail.as px?page=base&se archId=" &
strSavedSearchI D
I am getting the error:
Object reference not set to an instance of an object
Any help would be appreciated... thanks
Comment