views:

18

answers:

1

I am trying to render a hyperlink to html. ( etc)

When the page loads it works fine. (and lots 10 links) on the update panel it hits the same function and tries to get another 10 links. I set the navigationURL to something like

"../Folder/Mypage.aspx?498592ghjgfosdfgo"

It is set identically both times(load and updatepanel postback) but when i try to render it to html the second time (on the update panel) it adds "../" to the front so i end up with

"../../Folder/Mypage.aspx?498592ghjgfosdfgo"

The function where it changes here

Public Shared Function RenderControl(ByVal c As Control) As String
    Dim sw As New IO.StringWriter
    Dim htmlw As New HtmlTextWriter(sw)
    c.RenderControl(htmlw)
    Return sw.ToString
End Function

c is the hyperlink which has the propertry navigationurl (this never gets changed) but the sw which ends up looking like this on load

<a id="lnkView" href="../Folder/mypage.aspx?AnTfh0ZsFP9NCxiBpM+Zd11cI+AUOF93HZQtumPgzMKky0PejGrda9I6kCFn070dOsIfq0M2AgI=">View</a>}

and this on panel update

    <a id="lnkView" href="../../Folder/mypage.aspx?AnTfh0ZsFP9NCxiBpM+Zd11cI+AUOF93HZQtumPgzMKky0PejGrda9I6kCFn070dOsIfq0M2AgI=">View</a>}

And cannot work out where the ../ comes from for the life of me! HELP :)

+1  A: 

Try using ~/Folder/mypage.aspx?XYZ as your NavigateURL.

When you say "on the update panel," do you mean on a user control that is inside an update panel?

matt-dot-net
yeh in a updatepanel I have a table which im adding rows to e.g TableId.Rows.Add(tr)I tried using the ~ but it produces the same resultswhen c.RenderControl(htmlw) is applied on the page load. The ~ is removed and replaced with ../ and on the updatepanel it has ../../ again!
Steve