Search Results

Search found 15578 results on 624 pages for 'place and route'.

Page 20/624 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Best Practices with MVC Route

    - by codemnky
    if this is asked before just point me in the right direction I am a OO and MVC newbie. I am following along the MVC Storefront(a little outdated now) where they are talking about routes and adding them to global.asax.cs My question is this. wouldn't it be better if only 1 route is defined and after that everything is done programatically? I dont want the user to navigate using the address bar thank you

    Read the article

  • ASP NET MVC custom route fallback

    - by manudea
    I'm wondering if it is possibile to customize routing in a way that all requests are evaluated by a piece of code, redirected to the relevant controller if a match is found or passed to next rout in list if not found. sample request: /my coolpage/another one the code searches and determine that the right controller for this is Page, action is "list" and id is "123" and so redirects another request: /products/list/5 code finds no match al passes it back to next route that knows how to handle it... any idea on how to do this?

    Read the article

  • How to create route

    - by user276640
    I want to use URL such as /Image/sample.png I create route, but it does not work, it say "The resource cannot be found" What is the problem? (action GetImage is in controller home) routes.MapRoute("Image", "Image/{id}", new { controller = "Home", action = "GetImage", id = "" });

    Read the article

  • No route matches {:controller=>"welcome", :action=>"contact"}

    - by jade
    I'm new to rails so it may sound quite naive.I'm getting this error No route matches {:controller=>"welcome", :action=>"contact"} Here is my routes.rb root :to => 'welcome#index' Here is my controller class WelcomeController < ApplicationController def index redirect_to :action => :contact end end And i have a contact.html.erb in my app/view/.What am i doing wrong?

    Read the article

  • Rails will_paginate custom route

    - by kristian nissen
    How can I use will_paginate with a custom route? I have the following in my routes: map.connect 'human-readable/:name', :controller => :tags, :action => 'show' but will_paginate uses url_for as far as I can tell, but I want to use 'human-readable' instead of url_for, but how?

    Read the article

  • mvc consistent route parameters without re-initializing every action

    - by Ayo
    Trying to consistently tack on a route parameter for every action without having to set it every action I tried this with ViewData but it seems ineffecient to do to every action. when I have over 40-50 actions, and Sessions are a no go for me. Is there a simpler way through filters or something else I could use? eg. http://localhost/myController/myView?param=foo eg. http://localhost/myController/myView/myID?param=foo (needs to be tacked on id automatically)

    Read the article

  • Add Shortcut to Nested Route

    - by wakeless
    I'm using nested routes and I want to provide some sort of a shortcut method. (I'm using RoR 3.0) The routes look like this. resources :countries do resources :regions do resources :wineries end end To access a winery route I want to be able to define a function that removes the need to specify a country and region each time. Like: def winery_path(winery) country_region_winery_path (winery.country, winery.region, winery) end Where should I do this? How can I get that to be available whereever url_for is available?

    Read the article

  • Cakephp: how do I know what route was used

    - by Jason
    So I am a total cakephp newb and one of the first things I expected to see basic info about each page request logged. More specifically, what route data including what controller/method is being used. Obviously I did not find what I was expecting and about the only kind of meaning info I can find is from the apache logs. What I expected was to see something similar to first log entry for a rails app request. Does cakephp not log this kind of data?

    Read the article

  • How to detect invalid route and trigger function in Backbone.Controller

    - by tomodian
    Is there any method to detect invalid (or undefined) route and trigger 404 page in Backbone.Controller? I've defined routes in my Controller like this, but it didn't work. class MyController extends Backbone.Controller routes: "method_a": "methodA" "method_b": "methodB" "*undefined": "show404Error" # when access to /#method_a methodA: -> console.log "this page exists" # when access to /#method_b methodB: -> console.log "this also exists" # when access to /#some_invalid_hash_fragment_for_malicious_attack show404Error: -> console.log "sorry, this page does not exist"

    Read the article

  • rspec nested ( has many resource ) no route found error

    - by Surya
    My calendar resource is a nested resource under profile map.resources :profiles, :has_many=>[:calendar] I am trying to write a rspec spec for calendarcontroller it "should use supplied date" do get :show , :month = '09' , :year = '2010' end But i get an error stating No route matches {:month="09", :year="2010", :controller="calendar", :action="show"} Any idea how i could get around this ?

    Read the article

  • How to Place DialogBar or Dialog box into pane in vc 2008 or vc 2010 Beta

    - by gbalajimecse
    Hi now i am working in 2003 vc++ and i am converting(migrating) my project in to vc 2008 or new vc 2010 Beta,i saw the feature pack of 2008,2010 regards CDockable Pane(Auto Hode,floating),so i require this features ,i want to place a dialogbox or dialog bar into pane(CDockable Pane class), so i done this in my following code Myframe Code snippet is : if (!m_MyPane.Create(L"MyPane", this, CRect(0,0,0,0), true, IDD_DIALOG1, WS_CHILD|WS_VISIBLE)) return -1; AddDockSite(); EnableDocking(CBRS_ALIGN_ANY); EnableAutoHidePanes(CBRS_ALIGN_ANY); m_MyPane.EnableDocking(CBRS_ALIGN_ANY); DockPane(&m_MyPane, AFX_IDW_DOCKBAR_RIGHT); MyPane class Definition is : include "stdafx.h" include "Pane.h" include "Resource.h" include "MainFrm.h" include "soft1.h" ifdef _DEBUG undef THIS_FILE static char THIS_FILE[]=FILE; define new DEBUG_NEW endif CPane1::CPane1() { } CPane1::~CPane1() { } BEGIN_MESSAGE_MAP(CPane1, CDockablePane) ON_WM_CREATE() ON_WM_SIZE() END_MESSAGE_MAP() int CPane1::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; return 0; } void CPane1::OnSize(UINT nType, int cx, int cy) { CDockablePane::OnSize(nType, cx, cy); } when i build it wont shows any error and executed without error in the output the frame show the mypane but mypane didn't show IDD_DIALOG1 So is it anything am i missed please rectify my code and how to place a IDD_DIALOG1 dialogbox in to mypane PLEASE HELP ME REGARDS G.BALAJI

    Read the article

  • Place the business logic in Java Beans?

    - by Lirik
    I was reading this page and I found the following statement: MVC in Java Server Pages Now that we have a convenient architucture to separate the view, how can we leverage that? Java Server Pages (JSP) becomes more interesting because the HTML content can be separated from the Java business objects. JSP can also make use of Java Beans. The business logic could be placed inside Java Beans. If the design is architected correctly, a Web Designer could work with HTML on the JSP site without interfering with the Java developer. Interestingly in my textbook I pulled the following quote: In the MVC architecture... the original request is always handled by a servlet. The servlet invokes the business logic and data access code and creates beans to represent the results (that’s the model). Then, the servlet decides which Java Server Page is appropriate to present those particular results and forwards the request there (the JSP is the view). The servlet decides what business logic code applies and which JSP should present the results (the servlet is the controller). The two statements seem slightly contradicting. What is the best way to use beans: should we place business logic in them or should we only place results in them? Are there ways in which beans are inadequate for representing a model?

    Read the article

  • Database INSERT does not take place

    - by reggie
    My code is as follows: <?php include("config.php"); $ip=$_SERVER['REMOTE_ADDR']; if($_POST['id']) { $id=$_POST['id']; $id = mysql_escape_String($id); $ip_sql=mysql_query("select ip_add from Voting_IP where mes_id_fk='$id' and ip_add='$ip'"); $count=mysql_num_rows($ip_sql); if($count==0) { $sql = "update Messages set up=up+1 where mes_id='$id'"; mysql_query($sql); $sql_in = "insert into Voting_IP (mes_id_fk,ip_add) values ('$id','$ip')"; mysql_query($sql_in) or die(mysql_error()); echo "<script>alert('Thanks for the vote');</script>"; } else { echo "<script>alert('You have already voted');</script>"; } $result=mysql_query("select up from Messages where mes_id='$id'"); $row=mysql_fetch_array($result); $up_value=$row['up']; echo "<img src='button.png' width='110' height='90'>"; echo $up_value; } ?> My problem is that the insert process does not take place at all. The script tags echos an alert box. Even the img tag is echoed to the web page. But the insert process does not take place. The config file is fine. Note: This code works on my local machine which has PHP 5.3 but it does not work on the server which has PHP 5.2. Any advice?

    Read the article

  • unable to place breakpoints in eclipse

    - by anjanb
    I am using eclipse europa (3.5) on windows vista home premium 64-bit using JDK 1.6.0_18 (32 BIT). Normally, I am able to put breakpoints just fine; However, for a particular class which is NOT part of the project (this class is inside a .JAR file (.JAR file is part of the project) ), although I have attached a source directory to this .JAR file, I am unable to place a breakpoint in this class. If I double-click on the breakpoint pane(left border), I notice that a class breakpoint is placed. I was wondering if there was NO debug info; However, found that this particular class was compiled using ant/javac task using debug="true" and debuglevel="lines,vars,source". I even ran jad on this class to confirm that it indeed contained the debug info. So, why is eclipse preventing me from placing a breakpoint ? EDIT : Just so everyone understands the context, this is a webapp running under tomcat 6.0. I am remote debugging the application from eclipse after having started tomcat outside. The application is working just fine. I am trying to understand the behavior of the above class which I'm unable to do since eclipse is not letting me set a BP. P.S : I saw a few threads here talking about BPs not being hit but in my case, I am unable to place the BP! P.P.S : I tried JDK 1.6.0_16 before trying out 1.6.0_18. Thanks for any pointers.

    Read the article

  • Number of ways to place kings on chess board

    - by Rakesh
    You have an N x N chessboard and you wish to place N kings on it. Each row and column should contain exactly one king, and no two kings should attack each other (two kings attack each other if they are present in squares which share a corner). The kings in the first K rows of the board have already been placed. You are given the positions of these kings as an array pos[ ]. pos[i] is the column in which the king in the ith row has already been placed. All indices are 0-indexed. In how many ways can the remaining kings be placed? Input: The first line contains the number of test cases T. T test cases follow. Each test case contains N and K on the first line, followed by a line having K integers, denoting the array pos[ ] as described above. Output: Output the number of ways to place kings in the remaining rows satisfying the above conditions. Output all numbers modulo 1000000007. Constraints: 1 <= T <= 20 1 <= N <= 16 0 <= K <= N 0 <= pos_i < N The kings specified in the input will be in different columns and not attack each other. Sample Input: 5 4 1 2 3 0 5 2 1 3 4 4 1 3 0 2 6 1 2 Sample Output: 1 0 2 1 18 Explanation: For the first example, there is a king already placed at row 0 and column 2. The king in the second row must belong to column 0. The king in the third row must belong to column 3, and the last king must beong to column 1. Thus there is only 1 valid placement. For the second example, there is no valid placement. How should i approach this problem

    Read the article

  • Android ADB has moved and Eclipse is looking in the old place

    - by Peter Nelson
    I did an SDK update last night and it moved adb.exe. In its place it left a file called "adb_has_moved.txt" saying The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools" Please also update your PATH environment variable to include the platform-tools/ directory, so you can execute adb from any location. So I did all that, including the PATH and now I can start adb.exe from any DOS prompt. But I still can't start it from Eclipse (Galileo 3.52). When I try it says Location of the Android SDK has not been set up in the preferences ... which is not true. The SDK IS set up in Preferences. The real problem is at the top of the Preferences window where it says "Could not find C:\SDK\android-sdk-windows\ tools \adb.exe!" ...No kidding - the update moved it to C:\SDK\android-sdk-windows\ platform-tools. Because it's specifying a specific (wrong) path Eclipse is bypassing the PATH variable. So how do I get Eclipse to look in the right place?

    Read the article

  • php insert doesnot take place

    - by reggie
    my code is as follows <?php include("config.php"); $ip=$_SERVER['REMOTE_ADDR']; if($_POST['id']) { $id=$_POST['id']; $id = mysql_escape_String($id); $ip_sql=mysql_query("select ip_add from Voting_IP where mes_id_fk='$id' and ip_add='$ip'"); $count=mysql_num_rows($ip_sql); if($count==0) { $sql = "update Messages set up=up+1 where mes_id='$id'"; mysql_query($sql); $sql_in = "insert into Voting_IP (mes_id_fk,ip_add) values ('$id','$ip')"; mysql_query($sql_in) or die(mysql_error()); echo "<script>alert('Thanks for the vote');</script>"; } else { echo "<script>alert('You have already voted');</script>"; } $result=mysql_query("select up from Messages where mes_id='$id'"); $row=mysql_fetch_array($result); $up_value=$row['up']; echo "<img src='button.png' width='110' height='90'>"; echo $up_value; } ?> My problem is that the insert process doesnot take place at all. the script tags echos an alert box. even the img tag is echoed to the web page. but the insert process doesnot take place. the config file is fine.. note: this code works on my local machine which has php 5.3 but it doesnot work on the server which has php 5.2.. any advice..???

    Read the article

  • php insert doesnot take place _ URGENT HELP PLEASE

    - by reggie
    my code is as follows <?php include("config.php"); $ip=$_SERVER['REMOTE_ADDR']; if($_POST['id']) { $id=$_POST['id']; $id = mysql_escape_String($id); $ip_sql=mysql_query("select ip_add from Voting_IP where mes_id_fk='$id' and ip_add='$ip'"); $count=mysql_num_rows($ip_sql); if($count==0) { $sql = "update Messages set up=up+1 where mes_id='$id'"; mysql_query($sql); $sql_in = "insert into Voting_IP (mes_id_fk,ip_add) values ('$id','$ip')"; mysql_query($sql_in) or die(mysql_error()); echo "<script>alert('Thanks for the vote');</script>"; } else { echo "<script>alert('You have already voted');</script>"; } $result=mysql_query("select up from Messages where mes_id='$id'"); $row=mysql_fetch_array($result); $up_value=$row['up']; echo "<img src='button.png' width='110' height='90'>"; echo $up_value; } ?> My problem is that the insert process doesnot take place at all. the script tags echos an alert box. even the img tag is echoed to the web page. but the insert process doesnot take place. the config file is fine.. note: this code works on my local machine which has php 5.3 but it doesnot work on the server which has php 5.2.. any advice..???

    Read the article

  • Javascript place in header

    - by JibW
    I am not clear why its not working the javascript code when I add it to the header section as follows. We can place a javascript code within the body as follows <html> <head> <title> Simple Test </title> </head> <body> <div id="mydiv"> This is the div content </div> <script type="text/javascript" > document.getElementById("mydiv").innerHTML=Date(); </script> </body> </html> But when I place the same JavaScript code in the header section it doesn't work. <html> <head> <title> Simple Test </title> <script type="text/javascript" > document.getElementById("mydiv").innerHTML=Date(); </script> </head> Can Someone please explain the issue. I know I can Write a JavaScript function in header and call it in an event. But can't we Use in this way. If Can't why.

    Read the article

  • Wget works, Ping doesn't

    - by derty
    There are some anomalies on a Virtuozzo virtualized Debian 4 (I know, I'm gonna upgrade this one asap, but there dependences). We run some Websites on this one. And a view Days ago exmi4 wasnt able to send mails to SOME people. I'll use live.com as exampledomain! So some of this people got mails and some didn't. Some of the mails got stuck in the queue, and after 2 days they went out!! My Nagios never showed problems with the internet connection or disk space Now i wanted to install "dig" to look how he's solving the dns request. And this Debian tells me he doesn't know dig.. Long story made short, Debian is able to download sites with exact IP or even with wget live.com, but it is not able to ping live.com. I'm 99% sure that the networking is right and the routing too! Some examples of my tring below: wget live.com downloads the site ping live.com ping http://www.live.com ping http://live.com returns: ping: unknown host live.com EDIT: i now use heise.de not live.com any more. and i found out i can ping the heise.de server by using it's IP-address. myserver:~# ping 193.99.144.85 PING 193.99.144.85 (193.99.144.85) 56(84) bytes of data. 64 bytes from 193.99.144.85: icmp_seq=1 ttl=248 time=12.7 ms 64 bytes from 193.99.144.85: icmp_seq=2 ttl=248 time=12.6 ms 64 bytes from 193.99.144.85: icmp_seq=3 ttl=248 time=12.9 ms 64 bytes from 193.99.144.85: icmp_seq=4 ttl=248 time=13.1 ms 64 bytes from 193.99.144.85: icmp_seq=5 ttl=248 time=13.1 ms --- 193.99.144.85 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4001ms rtt min/avg/max/mdev = 12.671/12.924/13.163/0.238 ms EDIT 2: myserver:/etc/apt# dig heise.de ; <<>> DiG 9.3.4-P1.2 <<>> heise.de ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40551 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 3 ;; QUESTION SECTION: ;heise.de. IN A ;; ANSWER SECTION: heise.de. 2266 IN A 193.99.144.80 ;; AUTHORITY SECTION: heise.de. 1622 IN NS ns.pop-hannover.de. heise.de. 1622 IN NS ns.s.plusline.de. heise.de. 1622 IN NS ns.plusline.de. heise.de. 1622 IN NS ns2.pop-hannover.net. heise.de. 1622 IN NS ns.heise.de. ;; ADDITIONAL SECTION: ns.plusline.de. 265 IN A 212.19.48.14 ns.pop-hannover.de. 5113 IN A 193.98.1.200 ns2.pop-hannover.net. 15150 IN A 62.48.67.66 ;; Query time: 2 msec ;; SERVER: 193.200.112.80#53(193.200.112.80) ;; WHEN: Tue Oct 9 13:03:50 2012 ;; MSG SIZE rcvd: 216

    Read the article

  • iptables prerouting to redirect source ip address on ethernet

    - by Kevin Campion
    I have 2 ip adresses on the Internet who redirect on the same machine. On this machine, one Debian runs on OpenVZ. I can set iptables rules to redirect all http request to the Debian. iptables prerouting -d ip_address_2 DNAT --to ip_address_local_1 +--------------+ | | | V | ip_address_local_1 I| +------+ +----------+ N|ip_address_1 | |-----|Debian1 VE|-- Apache's log T|-----------------|OpenVZ| +----------+ [client ip_address_1] E| | | | R|ip_address_2 | | | N|--------------+ | | E| +------+ T| Iptables' rules : iptables -t nat -A PREROUTING -p tcp -i eth0 -d ip_address_2 --dport 80 -j DNAT --to ip_address_local_1:80 iptables -A FORWARD -p tcp -i eth0 -o venet0 -d ip_address_local_1 --dport 80 -j ACCEPT iptables -A FORWARD -p tcp -i venet0 -o eth0 -s ip_address_local_1 --sport 80 -j ACCEPT When I go to webpage with "http://ip_address_2", I can see the good content but the ip address on access log file is ip_address_1, I would like to see my ISP's ip address. Any ideas?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >