Search Results

Search found 28879 results on 1156 pages for 'pretty url'.

Page 54/1156 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Squid throws error, The requested URL could not be retrieved

    - by Supratik
    Hi Sometimes I am getting the following error The requested URL could not be retrieved While trying to retrieve the URL: http://groups.google.com/ The following error was encountered: Unable to determine IP address from host name for groups.google.com The dnsserver returned: Refused: The name server refuses to perform the specified operation. This means that: The cache was not able to resolve the hostname presented in the URL. Check if the address is correct. Your cache administrator is root. What could be the reason for the above error ? Regards Supratik

    Read the article

  • Redirect URL to a Tomcat webapp

    - by phs
    I have a Tomcat server with two webapps, app1 and app2 (the app part is really the same). Each app has an independent group of users. I would like the groups to be able to access their respective app using group1.domain.com/app and group2.domain.com/app URLs, meaning that the numbers should be hidden from the URL displayed in browser. I suppose there needs to be a mechanism that would return the correct app based on the group# part of the URL. I have a vague understanding of URL rewrites. Is there a way to do this with only Tomcat? Or do I need Apache HTTP server? I would rather not use Apache if possible, but have no problem going that way if necessary.

    Read the article

  • need help from some professional how to redirect old or invalid url

    - by kath
    I recently upgraded a site and almost all URLs have changed. I have redirected all of them (or so I hope) but it may be possible that some of them have slipped by me. Is there a way to somehow catch all invalid URLs and send the user to a certain page and somehow know what URL the person came from so I could log this, and fix those? I'm thinking I could use .htaccess somehow but am not sure how. I am using PHP Thanks so much! error file is already in .htaccess but seems nothing going to change you can see the error file as below AddHandler application/x-httpd-php5s .php ErrorDocument 404 /content/404.php RewriteEngine on RewriteBase / to see the problem what i want result is i need some thing to redirect if some one types wrong url just check the link even if you delete half of the location at the endof url it still opens http://adsbuz.com/classifieds/abu-dhabi-uae/ it sholud go to the error page but its not giong i neeed some kind force to push it to error page thanks

    Read the article

  • direct url to server ip address and port

    - by AM0
    We have a Windows 2012 dedicated server. There’s a custom service running on port xxxxx which accepts connections from our custom built hardware devices over TCP/IP port. As of now we use servername.serverdomain.com:xxxxx to connect to the service and start communication. However, we prefer to use URL instead of server’s name or IP Address. So we got a custom url and set its name servers to point to dedicated server. However, just setting DNS doesn’t seem to be working. Could someone please guide as to how to get it working? UPDATE In short I want www.custom-url.com being forwarded to servername.serverdomain.com:xxxxx. These requests are coming from hardware and not browser.

    Read the article

  • Is there a stylesheet or Windows commandline tool for controllable XML formatting, specifically putt

    - by Scott Stafford
    Hi - I am searching for an XSLT or command-line tool (or C# code that can be made into a command-line tool, etc) for Windows that will do XML pretty-printing. Specifically, I want one that has the ability to put attributes one-to-a-line, something like: <Node> <ChildNode value1='5' value2='6' value3='happy' /> </Node> It doesn't have to be EXACTLY like that, but I want to use it for an XML file that has nodes with dozens of attributes and spreading them across multiple lines makes them easier to read, edit, and text-diff. NOTE: I think my preferred solution is an XSLT sheet I can pass through a C# method, though a Windows command-line tool is good too.

    Read the article

  • Format XML with JAXB during unmarshal

    - by Tobiask
    Hi there, I want to format a XML document during unmarshal with JAXB. Unmarshal looks like: Unmarshaller u = createAndsetUpUnmarshaller(enableValidation, evtHandler, clazz); return u.unmarshal(new ByteArrayInputStream(stringSource.getBytes())); While marshaling one can format the code via: marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); But this isn´t possible for the unmarchal process... Any idea how I can format the XML string with JAXB during (or after) unmarshal process? BTW: I read some posts here about pretty print, but I want to do it with JAXB!

    Read the article

  • Are there any command line tools for controllable XML formatting?

    - by Scott Stafford
    Hi - I am searching for a command-line tool (or XSLT technique, or C# code that can be made into a command-line tool, etc) for Windows that will do XML pretty-printing. Specifically, I want one that has the ability to put attributes one-to-a-line, something like: <Node> <ChildNode value1='5' value2='6' value3='happy' /> </Node> It doesn't have to be EXACTLY like that, but I want to use it for an XML file that has nodes with dozens of attributes and spreading them across multiple lines makes them easier to read, edit, and text-diff.

    Read the article

  • What's the correct way to use Cakephp urls?

    - by Pichan
    Hello all, it's my first post here :) I'm having some difficulties with dealing with urls and parameters. I've gone through the router class api documentation over and over again and found nothing useful. First of all, I'd like to know if there is any 'universal' format in CakePHP(1.3) for handling urls. I'm currently handling all my urls as simple arrays(in the format that Router::url and $html-link accepts) and it's easy as long as I only need to pass them as arguments to cake's own methods. It usually gets tricky if I need something else. Mainly I'm having problems with converting string urls to the basic array format. Let's say I want to convert $arrayUrl to string and than again into url: $arrayUrl=array('controller'=>'SomeController','action'=>'someAction','someValue'); $url=Router::url($arrayUrl); //$url is now '/path/to/site/someController/someAction/someValue' $url=Router::normalize($url); //remove '/path/to/site' $parsed=Router::parse($url); /*$parsed is now Array( [controller] => someController [action] => someAction [named] => Array() [pass] => Array([0] => someValue) [plugin] => ) */ That seems an awful lot of code to do something as simple as to convert between 2 core formats. Also, note that $parsed is still not in the same as $arrayUrl. Of course I could tweak $parsed manually and actually I've done that a few times as a quick patch but I'd like to get to the bottom of this. I also noticed that when using prefix routing, $this-params in controller has the prefix embedded in the action(i.e. [action] = 'admin_edit') and the result of Router::parse() does not. Both of course have the prefix in it's own key. To summarize, how do I convert an url between any of these 3(or 4, if you include the prefix thing) mentioned formats the right way? Of course it would be easy to hack my way through this, but I'd still like to believe that cake is being developed by a bunch of people who have a lot more experience and insight than me, so I'm guessing there's a good reason for this "perceived misbehavior". I've tried to present my problem as good as I can, but due to my rusty english skills, I had to take a few detours :) I'll explain more if needed.

    Read the article

  • simply way to add another webapp framework to my project.

    - by zjm1126
    one webapp project has many url and i have to change this: ('/addTopic', AddTopic), ('/delTopic', DeleteTopic), ('/addPost', AddPost), ('/delPost', DeletePost), to this: ('/tribes/addTopic', AddTopic), ('/tribes/delTopic', DeleteTopic), ('/tribes/addPost', AddPost), ('/tribes/delPost', DeletePost), but ,if i add this to my project ,i have to change the url in every py file or html file , in django it can be this : urlpatterns = patterns('', (r'^articles/2003/$', 'news.views.special_case_2003')), ) it is easy to add the url of 'news' to my peoject, but does webapp has this ? thanks updated: (1) my main page url is : ('/', MainPage), ('/sign', Guestbook), (2) the url of a webapp project that i want to add is : ('/', MainPage), ('/logout', LogoutPage), ('/login_response', LoginHandler), and i want to change (1) to this: ('/', MainPage), ('/sign', Guestbook), ('/aa/', p2.MainPage), ('/aa/logout', p2.LogoutPage), ('/aa/login_response', p2.LoginHandler), so i have to change so many url like / to /aa/ , or change /logout to /aa/logout in py file and html file , that is a hard work so any simple way to do this ?

    Read the article

  • Regex for Searching for Text Not Preceeded By a Specific String

    - by James
    Hi, I am working on a web site with several other developers and we have had problems where people commit JavaScript code with AJAX calls that use URL's relative to the site root. An example would be /Home/Index which will not work if the site is hosted in a virtual directory. To get round the problem we use a $.url() method to convert it to a full path, e.g. $("#container").load($.url("/Home/Index")) I am trying to write a unit test that will search each JavaScript file and find places where the $.url method is not being used. The only problem is that I cannot seem to write a regex expression to do this. I have tried the following: (?!\$\.url\()"(/\w*)+" But this does not work. I cannot find a way to say that I don't want the $.url in front. Does anyone know if this is possible? Note that I need regular expressions that are compatible with .NET Thanks.

    Read the article

  • Using rel=next and rel=prev with multiple sets of paginated content on the same page

    - by jakejgordon
    We are running into issues with trying to figure out how to implement rel="next" and rel="prev" -- coupled with rel="canonical" -- with multiple sets of paginated content on the same page, with pages in multiple cultures. In other words, how do we implement these when we have a pager for both Product Reviews and Questions and Answers (aka "Q&A") on the same page, with duplicate content across culture-specific URLs (e.g. /us/en/my-product vs. /ca/en/my-product)? Our current implementation will actually do a full postback when you click Page 2, and will add something to the query string (e.g. website.com/ca/en/my-product?previewpage=2 or website.com/ca/en/my-product?questionpage=2). If we only had one set of paginated content then the implementation would certainly be more straightforward. Adding a second set of paginated content (i.e. Q&A) complicates things. Let's assume that we want the United States English page to be the canonical target (i.e. /us/en/my-product) based on culture. If you go to the /ca/en/my-product page you'll have a rel="canonical" href="/us/en/my-product". So far so good. Let's also assume that we are not implementing a page that lists ALL Product Reviews and Q&A. This would likely solve a number of our problems by using rel="canonical" to this page, but is not an option for reasons that are out of scope for this discussion. Now if you click on page 2 of Product Reviews, it will reload the page with /ca/en/my-product?reviewpage=2 as the URL. Given this scenario, here are my questions: On page 2 of the my-product page on the Canadian site, should there be a rel="canonical" to /us/en/my-product?reviewpage=2 (assuming the content is identical in the United States and Canada)? Should the rel="prev" go to /ca/en/my-product?reviewpage=1 or should it go to /ca/en/my-product ? The query-string version would really only be accessible if using the pager and shows the exact same content as the base page. The following two questions are closely related to this one. Should the /ca/en/my-product?reviewpage=1 have a rel canonical directly to /us/en/my-product (United States page with nothing in query string) since the content is identical)? Given that Q&A content is also paginated, should there be a rel="next" on the base page without query string? In other words, should the /ca/en/my-product page have a rel="next" to /ca/en/my-product?reviewpage=2 AND rel="next" to /ca/en/my-product?questionpage=2 . So far as I can tell it doesn't make sense to have multiple rel="next" implementations on the same page. I suspect that the pages with query string values should have rel="next" and rel="prev" that only point to other pages with query strings and not to the base page. The ?reviewpage=1 and ?questionpage=1 pages would then just have a rel="canonical" to /us/en/my-product . Thoughts? I know this is a tough one -- that's why I brought it to this community. Thanks so much for your help in advance!

    Read the article

  • HTTP error code 405: tomcat Url mapping issue

    - by Andrew
    I am having trouble POSTing to my java HTTPServlet. I am getting "HTTP Status 405 - HTTP method GET is not supported by this URL" from my tomcat server". When I debug the servlet the login method is never called. I think it's a url mapping issue within tomcat... web.xml <servlet-mapping> <servlet-name>faxcom</servlet-name> <url-pattern>/faxcom/*</url-pattern> </servlet-mapping> FaxcomService.java @Path("/rest") public class FaxcomService extends HttpServlet{ private FAXCOM_x0020_ServiceLocator service; private FAXCOM_x0020_ServiceSoap port; @GET @Produces("application/json") public String testGet() { return "{ \"got here\":true }"; } @POST @Path("/login") @Consumes("application/json") // @Produces("application/json") public Response login(LoginBean login) { ArrayList<ResultMessageBean> rm = new ArrayList<ResultMessageBean>(10); try { service = new FAXCOM_x0020_ServiceLocator(); service.setFAXCOM_x0020_ServiceSoapEndpointAddress("http://cd-faxserver/faxcom_ws/faxcomservice.asmx"); service.setMaintainSession(true); // enable sessions support port = service.getFAXCOM_x0020_ServiceSoap(); rm.add(new ResultMessageBean(port.logOn( "\\\\CD-Faxserver\\FaxcomQ_API", /* path to the queue */ login.getUserName(), /* username */ login.getPassword(), /* password */ login.getUserType() /* 2 = user conf user */ ))); } catch (RemoteException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } // return rm; return Response.status(201).entity(rm).build(); } @POST @Path("/newFaxMessage") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public ArrayList<ResultMessageBean> newFaxMessage(FaxBean fax) { ArrayList<ResultMessageBean> rm = new ArrayList<ResultMessageBean>(); try { rm.add(new ResultMessageBean(port.newFaxMessage( fax.getPriority(), /* priority: 0 - low, 1 - normal, 2 - high, 3 - urgent */ fax.getSendTime(), /* send time */ /* "0.0" - immediate */ /* "1.0" - offpeak */ /* "9/14/2007 5:12:11 PM" - to set specific time */ fax.getResolution(), /* resolution: 0 - low res, 1 - high res */ fax.getSubject(), /* subject */ fax.getCoverpage(), /* cover page: "" – default, “(none)� – no cover page */ fax.getMemo(), /* memo */ fax.getSenderName(), /* sender's name */ fax.getSenderFaxNumber(), /* sender's fax */ fax.getRecipients().get(0).getName(), /* recipient's name */ fax.getRecipients().get(0).getCompany(), /* recipient's company */ fax.getRecipients().get(0).getFaxNumber(), /* destination fax number */ fax.getRecipients().get(0).getVoiceNumber(), /* recipient's phone number */ fax.getRecipients().get(0).getAccountNumber() /* recipient's account number */ ))); if (fax.getRecipients().size() > 1) { for (int i = 1; i < fax.getRecipients().size(); i++) rm.addAll(addRecipient(fax.getRecipients().get(i))); } } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } return rm; } } Main.java private static void main(String[] args) { try { URL url = new URL("https://andrew-vm/faxcom/rest/login"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/json"); FileInputStream jsonDemo = new FileInputStream("login.txt"); OutputStream os = (OutputStream) conn.getOutputStream(); os.write(IOUtils.toByteArray(jsonDemo)); os.flush(); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (conn.getInputStream()))); String output; System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); } // Don't want to disconnect - servletInstance will be destroyed // conn.disconnect(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } I am working from this tutorial: http://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/

    Read the article

  • Error URL redirection

    - by xRobot
    urls.py: url(r'^book/(?P<booktitle>[\w\._-]+)/(?P<bookeditor>[\w\._-]+)/(?P<bookpages>[\w\._-]+)/(?P<bookid>[\d\._-]+)/$', 'book.views.book', name="book"), views.py: def book(request, booktitle, bookeditor, bookpages, bookid, template_name="book.html"): book = get_object_or_404(book, pk=bookid) if booktitle != book.book_title : redirect_to = "/book/%s/%s/%s/%s/%i/" % ( booktitle, bookeditor, bookpages, bookid, ) return HttpResponseRedirect(redirect_to) return render_to_response(template_name, { 'book': book, },) . So the urls of each book are like this: example.com/book/the-bible/gesu-crist/938/12/ I want that if there is an error in the url, then I get redirected to the real url by using book.id in the end of the url. For example if I go to: example.com/book/A-bible/gesu-crist/938/12/ the I will get redirected to: example.com/book/the-bible/gesu-crist/938/12/ but I go to wrong url I will get this error: TypeError at /book/A-bible/gesu-crist/938/12/ %d format: a number is required, not unicode . Why ? What I have to do ?

    Read the article

  • Django: reverse lookup URL of feeds?

    - by Santa
    I am having trouble doing a reverse URL lookup for Django-generated feeds. I have the following setup in urls.py: feeds = { 'latest': LatestEntries, } urlpatterns = patterns('', # ... # enable feeds (RSS) url(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}, name='feeds_view'), ) I have tried using the following template tag: <a href="{% url feeds_view latest %}">RSS feeds</a> But the resulting link is not what want (http://my.domain.com/feeds//). It should be http://my.domain.com/feeds/latest/. For now, I am using a hack to generate the URL for the template: <a href="http://{{ request.META.HTTP_HOST }}/feeds/latest">RSS feeds</a> But, as you can see, it clearly is not DRY. Is there something I am missing?

    Read the article

  • Exclude filter from certain url's

    - by Mads Mobæk
    I'm using a filter in web.xml to check if a user is logged in or not: <filter> <filter-name>LoginFilter</filter-name> <filter-class>com.mycompany.LoginFilter</filter-class> </filter> <filter-mapping> <filter-name>LoginFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> And this works like a charm until I have a stylesheet or image I want to exclude from this filter. I know one approach is to put everything that's protected inside /privateor similar, and then set the url-pattern to: <url-pattern>/private/*</url-pattern>. The downside to this is my URLs now looking like: http://www.mycompany.com/private/mypage instead of http://www.mycompany.com/mypage. Is there another solution to this problem, that let me keep my pretty-urls?

    Read the article

  • PHP Explode and Get_Url: Not Showing up the URL

    - by elmaso
    hello! its a little bit hard to understand. in the header.php i have this code: <? $ID = $link; $url = downloadLink($ID); ?> I get the ID with this Variable $link -- 12345678 and with $url i get the full link from the functions.php in the functions.php i have this snippet function downloadlink ($d_id) { $res = @get_url ('' . 'http://www.example.com/' . $d_id . '/go.html'); $re = explode ('<iframe', $res); $re = explode ('src="', $re[1]); $re = explode ('"', $re[1]); $url = $re[0]; return $url; } and normally it prints the url out.. but, i cant understand the code..

    Read the article

  • Wordpress, PHP, URL Encoding Issue

    - by Scott Porad
    Wordpress provides a function called "the_permalink()" that returns, you guessed it!, the permalink to a given post while in a loop of posts. I am trying to URL encode that permalink and when I execute this code: <?php print(the_permalink()); $permalink = the_permalink(); print($permalink); print(urlencode(the_permalink())); print(urlencode($permalink)); $url = 'http://wpmu.local/graphjam/2008/11/06/test4/'; print($url); print(urlencode($url)); ?> it produces these results in HTML: http://wpmu.local/graphjam/2008/11/06/test4/ http://wpmu.local/graphjam/2008/11/06/test4/ http://wpmu.local/graphjam/2008/11/06/test4/ http://wpmu.local/graphjam/2008/11/06/test4/ http%3A%2F%2Fwpmu.local%2Fgraphjam%2F2008%2F11%2F06%2Ftest4%2F I would expect lines 2, 3 and 5 of the output to be URL encoded, but only line 5 is so. Thoughts?

    Read the article

  • Ignore certificate errors when requesting a URL in Java

    - by Ryan Elkins
    I'm trying to print a URL (without having a browser involved at all) but the URL is currently throwing the following: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target I'm calling the URL using a JEditorPane's setPage method, which just takes a URL as a parameter. Assuming I can't change anything server side and I still need to get to this resource, how would I go about ignoring the certificate error (or something else that gets me to my goal)? Accessing this URL via a browser tells me the site is untrusted and asks me if I want to proceed.

    Read the article

  • How can I read this url in Rebol ?

    - by Rebol Tutorial
    when trying to read this kind of url URL: http://v4.lscache2.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor,oc:U0dWSlhTVF9FSkNNNl9QTVhJ&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&expire=1275886800&key=yt1&signature=89195E808CB3FBBC7BDE7298A1DC0613D7987F00.D3064112E8F479C523F8DF4FBFDF392CE48167C2&factor=1.25&id=34e01ad39b34b5c9& I get this error read/binary url connecting to: v4.lscache2.c.youtube.com ** User Error: Error. Target url: http://v4.lscache2.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id,expire,ip,ipbits, itag,algorithm... ** Near: read/binary url

    Read the article

  • Determining full XHR request URL on a Google Chrome XHR Breakpoint

    - by DanH
    I am initiating a jQuery ajax ($.ajax) post, within the Google Chrome browser. I have setup a XHR breakpoint in the "XHR Breakpoints" section of the "Scripts" tab within the Developer Tools. The criteria of the breakpoint is "get" ie. I want the debugger to break on all XHR requests which contain the word "get" in them (somePage.asmx/getListOfAnimals) is an example. The breakpoint is being correctly hit, however I am unable to determine what the exact URL that is being requested. I realize I can remove the breakpoint and see what URL is being requested from the "Network" tab, but I want to know this at the time the breakpoint is hit. I have tried stepping through the XHR request once it has been hit in Chrome, but I must be missing a Javascript object/property which contains the fully requested URL. Google Chrome has detected that the XHR requested URL contains "get" but how do I get to this URL from within the debug session before the request is made?

    Read the article

  • Spring - MVC - Sanitize URL before redisplaying to the user

    - by Raghav
    In my application , a HTTP GET request URL to the application with script tag is getting redisplayed as it is although it fails the authorization. Example: http://www.example.com/welcome<script>alert("hi")</script> The issue is sanitizing external input entered directly into address bar by modifying existing GET URL. Spring redisplays the submitted URL as it is. Though the script does not get executed in the browser(FF), is there anyway to strip the URL of these values before displaying it back to the user Reference: Spring MVC application filtering HTML in URL - Is this a security issue?

    Read the article

  • Track pageviews in Google Analytics on partial url of Grails application

    - by Pieter van Gent
    For my Grails application I want to set up Google Analytics to track only "partial" url's. I 'll explain: a typical Grails url consists of the following parts: domain + application-name + controller + action + id e.g. www.mydomain.com/myapp/controller/action/12345 As far as I understand for Google Analytics the page to be tracked is identified by the entire url. For my purpose I'm not interested in the id part of the url: I want to know which actions have been performed, but I need not know for which id the action was executed. And of course I would like a generic solution, because I have multiple controllers and multiple actions... Maybe some kind of filter stating "I want to track pages 3 levels deep (/myapp/controller/action)" would do? Or a filter stating "exclude everything from url after the last /"? Any help would be much appreciated. Kind regards, Pieter

    Read the article

  • Changing the URL of an ExpressionEngine forum

    - by Steph
    I've set up a forum on ExpressionEngine and customised the URL as I want a specific path to the forum. To do this I went to Modules Discussion Forum Forum Board Preferences and in the Forum URL put in my desired URL. Let's call it http://www.mywebsite.com/students/forum/ My homepage displays the latest 5 posts from the forum. It all works except for the URLs which don't go to this URL and instead point to http://www.mywebsite.com/forums/viewthread/xxx Is there an extra step I am missing here? Why doesn't the forum URL just update automatically when I save it?

    Read the article

  • jQuery Ajax post with dynamic url

    - by morpheous
    I want to send an AJAX POST, but I want the url that the data is sent to, to be derived from the id of the element that was clicked. This is what I have so far: I have written a javascript function (get_my_url) that returns a url, depending on the element id that was passed to the function. The problem is, it is not clear how to bind the function (get_my_url) to the url param of the .ajax() method. jQuery('.elem1').click(function(){ jQuery.ajax({ async: false, type: 'POST', url: get_my_url(jQuery(this).attr('id')), data: 'id1=1', dataType: 'json', success: function(data){ msg = data.msg }, error: function(xrq, status, et){msg='Oops. An error occured!'} }); Does anyone know how to pass a function to the url param?

    Read the article

  • ASP.NET MVC: Route to URL

    - by JamesBrownIsDead
    What's the easiest way to get the URL (relative or absolute) to a Route in MVC? I saw this code here on SO but it seems a little verbose and doesn't enumerate the RouteTable. Example: List<string> urlList = new List<string>(); urlList.Add(GetUrl(new { controller = "Help", action = "Edit" })); urlList.Add(GetUrl(new { controller = "Help", action = "Create" })); urlList.Add(GetUrl(new { controller = "About", action = "Company" })); urlList.Add(GetUrl(new { controller = "About", action = "Management" })); With: protected string GetUrl(object routeValues) { RouteValueDictionary values = new RouteValueDictionary(routeValues); RequestContext context = new RequestContext(HttpContext, RouteData); string url = RouteTable.Routes.GetVirtualPath(context, values).VirtualPath; return new Uri(Request.Url, url).AbsoluteUri; } What's a better way to examine the RouteTable and get a URL for a given controller and action?

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >