html-
<asp:HyperLink ID="HyperLink1" runat="server" href='<%# GetRouteUrl("RouteForCat", new {id = Eval("id"), Title= GetTitle(Eval("Title"))})%>'
Text='<%# Eval("Title") %>'>
</asp:HyperLink>
c#
protected string GetTitle(object obj)
{
return obj.ToString().Replace(' ', '-');
}
global
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RegisterCustomRoutes(RouteTable.Routes);
}
void RegisterCustomRoutes(RouteCollection routes) {
routes.MapPageRoute("RouteForCat", "News/{title}/{id}", "~/Details.aspx");
}