Solved

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

Posted on 2012-04-10
6
462 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now