Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27350

VS 2010 Routing, how do I resolve this?

$
0
0
I am using a datalist and a literal and the URL appears
Name:  test.jpg
Views: 30
Size:  28.3 KB

and I try make the url's "prettier" ,example, http://localhost:1573/Example/Test/3

but not working what I've done

Global.asax
Code:

Public Sub Route()
          RouteTable.Routes.MapPageRoute("Test1", _
                                      "test/{name}/{id}", _
                                      "~/test/default.aspx")

    End Sub

.vb
Code:

Protected Function DisplayPaging(ByVal index As Integer) As String
        If (PagedData.CurrentPageIndex + 1) = index Then
            PagingCont += "<b> " + index.ToString() + " </b>"
        Else
                PagingCont += " <a href=""" + Request.CurrentExecutionFilePath + "?=" & index.ToString() & """>" + index.ToString() + "</a> "
        End If
        Return PagingCont
    End Function

.aspx
Code:

<asp:literal runat="server" ID="PaginationLiteral" Text="<%$RouteValue:id%>" ></asp:literal>
What am I doing wrong? Any ideas? :ehh:
Attached Images
 

Viewing all articles
Browse latest Browse all 27350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>