Search Results

Search found 20409 results on 817 pages for 'url routing'.

Page 113/817 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • url.rewrite-once with Kohana and with urls

    - by mike clagg
    currently I have this setup in our simple-hosts.conf: url.rewrite-once = ( ".*.(js|ico|gif|jpg|png|css|php|htm)(?.*)?$" = "$0", "/slapi" = "/slapi/index.php" ) Works great, except the above fails when I have a dot in the query string: ?url=http://google.com My regexpy is not 1337

    Read the article

  • js function to get filename from url

    - by Blankman
    Hi, I have a url like http://www.example.com/blah/th.html I need a javascript function to give me the 'th' value from that. All my urls have the same format (2 letter filenames, with .html extension). I want it to be a safe function, so if someone passes in an empty url it doesn't break. I know how to check for length, but I should be checking for null to right?

    Read the article

  • document.URL Matching in Javascript

    - by streetparade
    I have a url which looks like this https://test.high.com/people/11111111-name-firstname-_custa/deals/new Now i need to match document.URL if im on that Page if so i will alert a message. The important part is /deals/new How can i match that in Javascript?

    Read the article

  • How to get final destination URL from AJAX?

    - by Maurice Lam
    When I do an XMLHttpRequest, I always get redirected automatically to the URL (presumably by the headers of the response). For example, if I query "http://www.stackoverflow.com" I will be redirected to "http://stackoverflow.com". How can I get that final URL? (http://stackoverflow.com/ in the example) I checked in the response headers but I cannot seem to find it. (I just used the GET/POST method not HEAD).

    Read the article

  • regex problem with url

    - by newBie
    i need to find regex that suitable with this.. [url]%252FShowOneUserReview-g298570-d301416-r63722677%26sl%3Dzh%26tl%3Den_US%26hl%3Den_US%26ie%3DUTF-8 its situated in is it possible for me to find only [url]...-8?

    Read the article

  • javascript url parsing

    - by Ra
    Hi, I have a url like http://mywebsite.com/folder1/folder2/index how to parse this above url and get all the values separately? I want the output like http, mywebsite.com, folder1, folder2, index Thanks in adavance

    Read the article

  • URL breaking at special character

    - by Josh
    Hello All- I'm having trouble with a URL string in my Web Application. It's using a UNC path similar to \\houtestmachine\common\File1.pdf My problem is when it encounters files that have a # character. I tried doing a string newstring = originalstring.Replace("#", "%23"); but the # is still there in URL (target of a hyperlink) at runtime in the browser. How can I fix this?

    Read the article

  • retreive the url of the page an image sits on

    - by Ayyash
    I'm trying to log URLs that access broken images, using an HTTP module to catch those images when accessed. How do you retrieve the URL where that image sits on? is there a way to do it the other way round too? That is, loop through images served in a URL and decide which ones are broken. This is all in ASP.NET with C#.

    Read the article

  • Strange Url's in ASP.NET site

    - by Bob
    My asp.net 4 website url format is http://www.somesite.com/ShowProduct.aspx?ID=3330 but it sometimes gets changed to http://www.somesite.com/(S(ghtef0vy5fgfdjgdfgderd55)X(1))/ShowProduct.aspx?ID=3330 or http://www.somesite.com/ShowProduct.aspx?ID=3330&AspxAutoDetectCookieSupport=3330 How can i prevent this. I want all url's to be of this format only http://www.somesite.com/ShowProduct.aspx?ID=3330

    Read the article

  • Creating meaningful add URLs in Cakephp

    - by Loftx
    Hi there, For my site I have a number of Orders each of which contains a number of Quotes. A quote is always tied to an individual order, so in the quotes controller I add a quote with reference to it's order: function add($orderId) { // funtion here } And the calling URL looks a bit like http://www.example.com/quotes/add/1 It occurred to me the URLs would make more sense if they looked a bit more like http://www.example.com/orders/1/quotes/add As the quote is being added to order 1. Is this something it's possible to achive in CakePHP? Cheers, Tom

    Read the article

  • Injecting tenant repositories with StructureMap in a multi-tenant MVC applicaiton

    - by FreshCode
    I'm implementing StructureMap in a multi-tenant ASP.NET MVC application to inject instances of my tenant repositories that retrieve data based on an ITenantContext interface. The Tenant in question is determined from RouteData in a base controller's OnActionExecuting. How do I tell StructureMap to construct TenantContext(tenantID); where tenantID is derived from my RouteData or some base controller property? Base Controller Given the following route: {tenant}/{controller}/{action}/{id} My base controller retrieves and stores the correct Tenant based on the {tenant} URL parameter. Using Tenant, a repository with an ITenantContext can be constructed to retrieve only data that is relevant to that tenant. Based on the other DI questions, could AbstractFactory be a solution?

    Read the article

  • Injecting multi-tenant repositories with StructureMap in ASP.NET MVC

    - by FreshCode
    I'm implementing StructureMap in a multi-tenant ASP.NET MVC application to inject instances of my tenant repositories that retrieve data based on an ITenantContext interface. The Tenant in question is determined from RouteData in a base controller's OnActionExecuting. How do I tell StructureMap to construct TenantContext(tenantID); where tenantID is derived from my RouteData or some base controller property? Base Controller Given the following route: {tenant}/{controller}/{action}/{id} My base controller retrieves and stores the correct Tenant based on the {tenant} URL parameter. Using Tenant, a repository with an ITenantContext can be constructed to retrieve only data that is relevant to that tenant. Based on the other DI questions, could AbstractFactory be a solution?

    Read the article

  • How to make parameters optional when using Rails named routes?

    - by Jason
    I have a named route: map.find '/find/:category/:state/:search_term/:permalink', :search_term=>nil, :controller=>'find', :action=>'show_match' and the following URL matches it & works OK: http://localhost:3000/find/cars/ca/TestSeachTerm/bumpedupphoto-test but if I take out the 2nd last parameter i.e. "TestSearchTerm", then the route fails to get matched, even though I have :search_term=nil in the route. http://localhost:3000/find/cars/ca//bumpedupphoto-test Can anyone see what I am doing wrong? Being trying to solve this for a few days now. Thanks!

    Read the article

  • Route all requests through PageController except existing controllers (Zend Framework)

    - by ChrisRamakers
    For a new CMS i've developed a Pages module that allows me to manage the site's tree structure. Each page is reachable from the url http://www.example.com/pageslug/ where pageslug identifies the page being called. What I want to achieve now is a route that allows me to route all incoming requests to a single PagesController unless it's a request to an existing controller (like images for example). It's easy enough to catch all requests to the Pages Controller but how to exclude existing controllers? This is my module bootstrap. How can i achieve this in the most preferrable way <?php class Default_Bootstrap extends Zend_Application_Module_Bootstrap { protected function _initRoute() { $this->bootstrap('frontController'); /* @var $frontcontroller Zend_Controller_Front */ $frontcontroller = $this->getResource('frontController'); $router = $frontcontroller->getRouter(); $router->addRoute( 'all', new Zend_Controller_Router_Route('*', array('controller' => 'pages', 'action' => 'view') ) ); } }

    Read the article

  • Howto allow "Illegal characters in path" ?

    - by hbruce
    I have a MVC.NET application with one route as follows: routes.MapRoute("member", "member/{id}/{*name}", new { controller = "member", action = "Details", id = "" }, new { id = @"\d+" }); Thus, a link could be something like this: http://domain/member/123/any_kind_of_username This works fine in general but if the path contains illegal characters (e.g. a double qoute: http://domain/member/123/my_"user"_name) I get a "System.ArgumentException: Illegal characters in path." After much googling the best suggestions seems to be to make sure that the url doesn't contain any such characters. Unfortunately, that is out of my control in this case. Is there a way to work around this?

    Read the article

  • Storing links to internal content pages in ASP.NET MVC

    - by mare
    I'm using a route like this routes.MapRoute( "PageBySlug", RouteType.Regular, "{slug}", new {controller = "Page", action = "Display", slug = "Default"}, null ); to map request to ~/Some-Page-Slug to ~/Page/Display/Some-Page-Slug. When adding content, user can choose to link to existing pages to create references and I then store those links in this format in the datastore: "/Some-Page-Slug". When I run the app in Cassini and pull the link out from datastore and attach it to A tag it looks like this http://localhost:93229/Some-Page-Slug and this link works. But when running the application in virtual directory under some website in IIS, the attached link generates this URL http://localhost/Some-Page-Slug, when it should be http://localhost/virtualdir/Some-Page-Slug. Of course, this generates 404 error. How can I solve this to be universally useful and working under all circumstances? Should I store it differently in the database or should I transform it into correct form in my Views at runtime and how to do that?

    Read the article

  • Django: TypeError: 'str' object is not callable, referer: http://xxx

    - by user705415
    I've been wondering why when I set the settings.py of my django project 'arvindemo' debug = Flase and deploy it on Apache with mod_wsgi, I got the 500 Internal Server Error. Env: Django 1.4.0 Python 2.7.2 mod_wsgi 2.8 OS centOS Here is the recap: Visit the homepage, go to sub page A/B/C/D, and fill some forms, then submit it to the Apache server. Once click 'submit' button, I will get the '500 Internal Server Error', and the error_log listed below(Traceback): [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] Traceback (most recent call last): [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] response = self.get_response(request) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] response = self.handle_uncaught_exception(request, resolver, sys.exc_info()) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] if resolver.urlconf_module is None: [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/urlresolvers.py", line 323, in urlconf_module [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] self._urlconf_module = import_module(self.urlconf_name) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] __import__(name) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/web/django/arvindemo/arvindemo/../arvindemo/urls.py", line 23, in <module> [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] url(r'^submitPage$', name=submitPage), [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] TypeError: url() takes at least 2 arguments (2 given) When using django runserver, I set arvindemo.settings debug = True, everything is OK. But things changed once I set debug = Flase. Here is my views.py from django.http import HttpResponseRedirect from django.http import HttpResponse, HttpResponseServerError from django.shortcuts import render_to_response import datetime, string from user_info.models import * from django.template import Context, loader, RequestContext import settings def hello(request): return HttpResponse("hello girl") def helpPage(request): return render_to_response('kktHelp.html') def server_error(request, template_name='500.html'): return render_to_response(template_name, context_instance = RequestContext(request) ) def page404(request): return render_to_response('404.html') def submitPage(request): post = request.POST Mall = 'goodsName' Contest = 'ojs' Presentation = 'addr' WeatherReport = 'city' Habit = 'task' if Mall in post: return submitMall(request) elif Contest in post: return submitContest(request) elif Presentation in post: return submitPresentation(request) elif Habit in post: return submitHabit(request) elif WeatherReport in post: return submitWeather(request) else: return HttpResponse(request.POST) return HttpResponseRedirect('404') def submitXXX(): ..... def xxxx(): .... Here comes the urls.py from django.conf.urls import patterns, include, url from views import * from django.conf import settings handler500 = 'server_error' urlpatterns = patterns('', url(r'^hello/$', hello), # hello world url(r'^$', homePage), url(r'^time/$', getTime), url(r'^time/plus/(\d{1,2})/$', hoursAhead), url(r'^Ttime/$', templateGetTime), url(r'^Mall$', templateMall), url(r'^Contest$', templateContest), url(r'^Presentation$', templatePresentation), url(r'^Habit$', templateHabit), url(r'^Weather$', templateWeather), url(r'^Help$', helpPage), url(r'^404$', page404), url(r'^500$', server_error), url(r'^submitPage$', submitPage), url(r'^submitMall$', submitMall), url(r'^submitContest$', submitContest), url(r'^submitPresentation$', submitPresentation), url(r'^submitHabit$', submitHabit), url(r'^submitWeather$', submitWeather), url(r'^terms$', terms), url(r'^privacy$', privacy), url(r'^thanks$', thanks), url(r'^about$', about), url(r'^static/(?P<path>.*)$','django.views.static.serve',{'document_root':settings.STATICFILES_DIRS}), ) I'm sure there is no syntax error in my django project,cause when I use django runserver, everything is fine. Anyone can help ? Best regards

    Read the article

  • MVC MapPageRoute and ActionLink

    - by Dismissile
    I have created a page route so I can integrate my MVC application with a few WebForms pages that exist in my project: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // register the report routes routes.MapPageRoute("ReportTest", "reports/test", "~/WebForms/Test.aspx" ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } This has created a problem whenever I use Html.ActionLink in my Views: <%: Html.ActionLink("Home", "Index", "Home") %> When I load the page in the browser the link appears like: http://localhost:12345/reports/test?action=Index&controller=Home Has anyone run into this before? How can I fix this?

    Read the article

  • asp.net mvc custom routes with multiple submit buttons

    - by dangerisgo
    So I have a custom route as such: routes.MapRoute( "Wizard", // Route name "Wizard/{page}", // URL with parameters new { controller = "Wizard", action = "Index" } // Parameter defaults ); and have the following on my View: <% Html.BeginForm("Continue", "Wizard"); %> <input type="submit" value="Continue" name="Continue" /> <% Html.EndForm(); %> In which I want to call this function: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Continue(string Number, string Rev) { (...) } but in turn when that button is pressed always calls the postback Index rather than the one I want. If I remove the custom route, it calls my function, but what I want to be displayed in the address bar is: localhost:xxxx/Wizard/1 where the number at the end is the page (div shown) of the wizard either 1, 2, 3, or 4. So is there something I'm missing or can it not be done? Thanks.

    Read the article

  • How to create a reusable Asp.Net Mvc application?

    - by Amitabh
    We have multiple Asp.Net WebSites each running on IIS. Site1 : http://www.Site1.com/ Site2 : http://www.Site2.com/ We have to implement Shopping Cart functionality for each of the above WebSites. For each web site the corresponding shopping cart should work on the following Url. Shopping Cart for Site1 : http://www.Site1.com/shop/cart Shopping Cart for Site2 : http://www.Site2.com/shop/cart We want to develop the Shopping Cart application using Asp.Net MVC 2.0. But it should be reusable in both the above sites.

    Read the article

  • Why is my form triggering the wrong controller action?

    - by COCoach
    This form has multiple submit buttons, when clicked, it calls a simple JavaScript function to change the value of a hidden input (function is called "setHidden". This worked before, after some other not relevant code, it has ceased working. Essentially, the action it is supposed to call is never called, instead it seems to default back to a previous URL. The Form: <form action="/League/RemoveOwner" method="post"> <input type="hidden" value="1007" name="lid"/> <input type="hidden" value="0" id="index" name="index"/> <input type="image" src="../../Resources/Images/Delete.png" height="12" alt="Remove Owner" title="Remove Owner" onclick="setHidden('index', '1031')"/></a> coach<br /> </form> The Controller: [HttpPost] public ActionResult RemoveOwner(int id, string index) { //yada return PartialView(); } When clicking the image, it should call the remove owner controller, instead it calls the "View" controller: public ActionResult View(int id) { //yada return View(); }

    Read the article

  • ASP.NET MVC search route

    - by sahina
    I setup a search route: routes.MapRoute( "Search", "Search/{q}", new { controller = "Search", action = "Index" } ); The search form has an input box and a button. I want the search with a GET as below. <% using(Html.BeginForm("Index", "Search", FormMethod.Get)) {%> <%:Html.TextBox("q")%> <span class="query-button"> <input type="submit" value="select" /></span> <% } %> </div> The action on the SearchController is: public ActionResult Index(string q) { // search logic here return View(new SearchResult(q)); } The URL becomes like this: http://localhost:19502/search?q=mvc+is+great But I want the search to be like: http://localhost:19502/search/mvc+is+great How do I setup the route or the Html.BeginForm

    Read the article

  • Rails 3 respond_with, route constraints and resources

    - by Intelekshual
    I'm building a versioned API, so I have the following nested controllers: ApiController < ApplicationController Api::V1Controller < ApiController Api::V1::EventsController < Api::V1Controller The API is accessed via a subdomain. I have the following routes: constraints(:subdomain => "api") do scope :module => 'api' do namespace :v1 do resources :events end end end This produces the type of URL I want (/v1/events). The problem I'm facing is when using responds_with in Api::V1::EventsController. Just doing something as simple as the below fails with the error too few arguments: def index @events = Event.all respond_with(@events) end I know respond_width is meant to be used with resources, but I'm not sure how the events resource should be accessed from the constrained, scoped, and namespaced route. I can output other things (such as current_user), just not an array of events. Help?

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >