Solved

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

Posted on 2012-04-10
6
471 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
  • 4
  • 2
6 Comments
 
LVL 42

Expert Comment

by:sedgwick
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:sedgwick
ID: 37831613
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

785 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