J
John Kotuby
Hi all,
I am using a Repeater in conjunction with a SQLDatasource and SQL Server.
One of the controls in the repeater is a HyperlLink as follows:
<asp:HyperLink NavigateUrl='Search.aspx?page=base&searchid=<%
Eval("sequence")%>' .....
As you can see I am trying to pass a QueryString evaluated at runtime. All
the other Evals of DataFields in the Repeater are working just fine. However
this NavigateUrl is resolving as "request.querystring("searchid") = "<%" at
the destination page. I thought that to solve the problem I would then
simply set the string in the code-behind on Page_Load.
However the documentaion is unclear giving me 2 problems.
In pseudo-code here is what I'm trying to do. I know the syntax is wrong,
but I m just trying to display my intention.....
Dim strNav as String
strNav = "Search.aspx?page=base&searchid=" & Eval("sequence")
Repeater.HyperLink.NavigateURL = strNav
How do I access the HyperLink control in the Repeater?
Do I need to use the SearchControl method to find the HyperLink in the
Repeater?
Also, will a simple call like Eval("sequence") work in the code-beind VB, as
it does in the apsx page where the syntax
<% Eval("sequence")%> seems to work for all the data fields called up by
the SQLDatasource control?
Or is there any way to get at the underlying recordset in the SQLDataSource
directly to get the value of a field by name rather than numeric index?
I suppose there might be a better way to get the value of the field
"sequence" to the target page, but for now I am trying QueryString.
Thanks...
I am using a Repeater in conjunction with a SQLDatasource and SQL Server.
One of the controls in the repeater is a HyperlLink as follows:
<asp:HyperLink NavigateUrl='Search.aspx?page=base&searchid=<%
Eval("sequence")%>' .....
As you can see I am trying to pass a QueryString evaluated at runtime. All
the other Evals of DataFields in the Repeater are working just fine. However
this NavigateUrl is resolving as "request.querystring("searchid") = "<%" at
the destination page. I thought that to solve the problem I would then
simply set the string in the code-behind on Page_Load.
However the documentaion is unclear giving me 2 problems.
In pseudo-code here is what I'm trying to do. I know the syntax is wrong,
but I m just trying to display my intention.....
Dim strNav as String
strNav = "Search.aspx?page=base&searchid=" & Eval("sequence")
Repeater.HyperLink.NavigateURL = strNav
How do I access the HyperLink control in the Repeater?
Do I need to use the SearchControl method to find the HyperLink in the
Repeater?
Also, will a simple call like Eval("sequence") work in the code-beind VB, as
it does in the apsx page where the syntax
<% Eval("sequence")%> seems to work for all the data fields called up by
the SQLDatasource control?
Or is there any way to get at the underlying recordset in the SQLDataSource
directly to get the value of a field by name rather than numeric index?
I suppose there might be a better way to get the value of the field
"sequence" to the target page, but for now I am trying QueryString.
Thanks...