Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

error using <%@ Import Namespace="System.Web.Routing" %> in VisualStudio 2010

Posted on 2012-04-10
6
Medium Priority
?
497 Views
Last Modified: 2012-05-12
Hi, I have a project using web.routing.

When I try it with Visual Studio 2010 don't work when i try the url  http://localhost/www.decooutlet.es/admin/new the Explorer gives error 404,

but if i try with the IIS Administator it Works correctly.
0
Comment
Question by:limmontreefree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 37831279
can u post the routing code in the server side?
0
 

Author Comment

by:limmontreefree
ID: 37831606
Yes, in the web.config:

<assemblies>
      <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
 </assemblies>

  <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="UrlRoutingModule"/>
            <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            <!--<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>-->
        </modules>
        <handlers>
            <!--<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>-->
            <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
        </handlers>
    </system.webServer>


the global.asax:


<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web.Routing" %>

<script runat="server">
   
    Public Sub RegistraRuta()

       
        RouteTable.Routes.MapPageRoute("admin-novedades", _
                           "admin/novedades", _
                           "~/wfNewsAdminListado.aspx")
       
        RouteTable.Routes.MapPageRoute("admin-novedades-editar", _
                           "admin/novedades/{tipo-mov}/{*id}", _
                           "~/wfNewsAdminAgregarEditar.aspx")
       
        RouteTable.Routes.MapPageRoute("admin-novedades-ultimas", _
                           "novedades/ultimas", _
                           "~/wfNewsUltimas.aspx")
       
        RouteTable.Routes.MapPageRoute("admin-novedades-detalle", _
                           "novedades/{id}/{title}", _
                           "~/wfNewsDetalle.aspx")
       
    End Sub
   
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Código que se ejecuta al iniciarse la aplicación
        RegistraRuta()
   
    End Sub
   
    Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Código que se ejecuta durante el cierre de aplicaciones
    End Sub
       
    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        ' Código que se ejecuta al producirse un error no controlado
    End Sub

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Código que se ejecuta cuando se inicia una nueva sesión
    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Código que se ejecuta cuando finaliza una sesión.
        ' Nota: El evento Session_End se desencadena sólo con el modo sessionstate
        ' se establece como InProc en el archivo Web.config. Si el modo de sesión se establece como StateServer
        ' o SQLServer, el evento no se genera.
    End Sub
       
</script>


Thanks.
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 37831613
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:limmontreefree
ID: 37831726
Sorry teh URL http://localhost/admin/new is an example the correct url that dont'w wotk is:

http://localhost/admin/novedades

But Don't work if I try in the visual studio 2010 but works fine in the ISS managenement.

thanks.
0
 

Accepted Solution

by:
limmontreefree earned 0 total points
ID: 37937319
mystery Solved

The name's folder was www.myproyect.com so the routing didn't work.

Thanks everybody
0
 

Author Closing Comment

by:limmontreefree
ID: 37959962
The problem was in the name's folder it has "." and the routing didn't work.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question