D
D
Dmitry Gormash2014-11-24 00:33:56
ASP.NET
Dmitry Gormash, 2014-11-24 00:33:56

How to link to a profile in asp net?

Hello!
How can I make links to a profile in asp net like: site.ru/profile/id_user ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Grigoriev, 2014-11-27
@kanonir1886

It would be better to clarify the question, but if we are talking about just custom paths, then this is implemented through the routes table, in asp.no webforms this can be done through the RouteCollection ( msdn )

public class Global : System.Web.HttpApplication
{
    void RegisterRoutes(RouteCollection routes)
    {
        routes.Add(new Route("profile", new PageRouteHandler("~/profile.aspx")));
    }

    protected void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes(RouteTable.Routes);
    }
}

If you search further, you can also find parameterized routes, as in mvc. In asp.net mvc, registering routes out of the box.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question