?
Solved

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

Posted on 2012-04-10
6
Medium Priority
?
491 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: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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

752 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