J
John Kotuby
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:HyperLink 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.EventArgs) Handles Me.PreRender
Dim lnkRefine As HyperLink = FindControl("lnkRefine")
If Not IsDBNull(lnkRefine) Then
If strPassthru = "passthru" Then
lnkRefine.NavigateUrl =
"~/Search/SearchDetail.aspx?page=base&searchId=" & strSavedSearchID
Else
lnkRefine.NavigateUrl = "javascript:history.go(-1)"
End If
End If
End Sub
------------------------------------------------------
Since the code gets past the If Not IsDBNull(lnkRefine) I assume (maybe
incorrectly) that the control was found and object reference instantiated.
On the line:
lnkRefine.NavigateUrl = "~/Search/SearchDetail.aspx?page=base&searchId=" &
strSavedSearchID
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:HyperLink 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.EventArgs) Handles Me.PreRender
Dim lnkRefine As HyperLink = FindControl("lnkRefine")
If Not IsDBNull(lnkRefine) Then
If strPassthru = "passthru" Then
lnkRefine.NavigateUrl =
"~/Search/SearchDetail.aspx?page=base&searchId=" & strSavedSearchID
Else
lnkRefine.NavigateUrl = "javascript:history.go(-1)"
End If
End If
End Sub
------------------------------------------------------
Since the code gets past the If Not IsDBNull(lnkRefine) I assume (maybe
incorrectly) that the control was found and object reference instantiated.
On the line:
lnkRefine.NavigateUrl = "~/Search/SearchDetail.aspx?page=base&searchId=" &
strSavedSearchID
I am getting the error:
Object reference not set to an instance of an object
Any help would be appreciated... thanks