J
Jim via DotNetMonster.com
Hi,
I'm creating a control that displays the Previous and Next Pages. I get the
values I want but they don't display in the HTML Href tag. It just displays
blank. I declared the 2 variables PageBack and PageNext outside the sub but
that doesn't seem to work.
I tried using a session variable but I had to reload the page twice to get
the correct number.
<%@ Control Language="VB" %>
<script runat="server">
Dim PageBack as String
Dim PageNext as String
Sub Page_Load(sender As Object, e As EventArgs)
Dim strPageName = System.IO.Path.GetFileName(Request.Path)
Dim PageName as String = strPageName
Dim PageNumber As String = Mid(PageName,5,3)
Dim BackPg as String = PageNumber - 1
Dim NextPg as String = PageNumber + 1
PageBack= Left(PageName,4)&"00"&BackPg &".aspx"
PageNext= Left(PageName,4)&"00"&NextPg &".aspx"
End Sub
</script>
<a href="<%# PageBack %>">Back</a><br>
<a href="<%# PageNext %>">Next</a>
Thanks
I'm creating a control that displays the Previous and Next Pages. I get the
values I want but they don't display in the HTML Href tag. It just displays
blank. I declared the 2 variables PageBack and PageNext outside the sub but
that doesn't seem to work.
I tried using a session variable but I had to reload the page twice to get
the correct number.
<%@ Control Language="VB" %>
<script runat="server">
Dim PageBack as String
Dim PageNext as String
Sub Page_Load(sender As Object, e As EventArgs)
Dim strPageName = System.IO.Path.GetFileName(Request.Path)
Dim PageName as String = strPageName
Dim PageNumber As String = Mid(PageName,5,3)
Dim BackPg as String = PageNumber - 1
Dim NextPg as String = PageNumber + 1
PageBack= Left(PageName,4)&"00"&BackPg &".aspx"
PageNext= Left(PageName,4)&"00"&NextPg &".aspx"
End Sub
</script>
<a href="<%# PageBack %>">Back</a><br>
<a href="<%# PageNext %>">Next</a>
Thanks