Search Results

Search found 6523 results on 261 pages for 'route planning'.

Page 78/261 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • How to use ASP.NET Routing in a Quote of the Day Website

    - by SidC
    Good Afternoon, A client is interested in creating an ASP.NET 2.0 website whose purpose is to serve up a "quote of the day". He wants the quotes on static content pages all attached to the same master page. The quote pages must be viewed in a certain sequence, and site browsers cannot view any other pages than the starting page when browsing to the site. That is, everyone must go to page 001.aspx when entering the site. Two Questions: 1. The content pages are going to be created by the client using an excel data source and a merge process by which each quote page is created eg. 001.aspx, 002.aspx etc. This seems clunky to me at best. Would ASP.NET Dynamic Data be a better solution here? I'm new to ASP.NET Routing and URL Rewriting as a whole. How would I setup a route table to ensure that users always entered the site on the same entry page, and create a route table such that default.aspx resolves to 001.aspx? Thanks, Sid

    Read the article

  • How can i Execute a Controller's ActionMethod programatically?

    - by Pure.Krome
    Hi folks, I'm trying to execute a controller's Action Method programatically and I'm not sure how. Scenario: When my ControllerFactory fails to find the controller, I wish it to manually execute a single action method which i have on a simple, custom controller. I don't want to rely on using any route data to determine the controller/method .. because that route might not have been wired up. Eg. // NOTE: Error handling removed from this example. public class MyControllerFactory : DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType) { IController result = null; // Try and load the controller, based on the controllerType argument. // ... snip // Did we retrieve a controller? if (controller == null) { result = new MyCustomController(); ((MyCustomController)result).Execute404NotFound(); // <-- HERE! } return result; } } .. and that method is .. public static void Execute404NotFound(this Controller controller) { result = new 404NotFound(); // Setup any ViewData.Model stuff. result.ExecuteResult(controller.ControllerContext); // <-- RUNTIME // ERROR's HERE } Now, when I run the controller factory fails to find a controller, i then manually create my own basic controller. I then call the extension method 'Execute404NotFound' on this controller instance. That's fine .. until it runs the ExecuteResult(..) method. Why? the controller has no ControllerContext data. As such, the ExecuteResult crashes because it requires some ControllerContext. So - can someone out there help me? see what I'm doing wrong. Remember - i'm trying to get my controller factory to manually / programmatically call a method on a controller which of course would return an ActionResult. Please help!

    Read the article

  • kohana project structure

    - by user176217
    Hello Guys. I'm investigating using Kohana for my next project. The site will consist of user registration (and hence user profiles) where users will have certain privileges. The site will also have an admin section where administrators can go to say block a user or delete a post or look at usage statistics for example. A good comparison site would be a multi-user blog, where each blogger depending on her/his permissions can post/edit/delete blogs...just as an example. Firstly, I'm not sure about how to set up the controller/view structure in order to separate the admin section from the front facing site. I'm using Kohana 3, so I was thinking of a controller structure like so: application/classes/controller/front (front facing)...and application/classes/controller/admin (for administrative section). Or I notice you may be able to use the Route class to set up routes, so I could set up an "admin" route. for example: www.example.com/admin will lead to the admin logon screen. www.example.com --- front controller. As well, can I somehow separate the "Admin" views and controllers from the "front facing" views and controllers like divide them up based on folder structure? Any help is very much appreciated. Thank you.

    Read the article

  • How to architect Rails site that can be edited while running?

    - by Chris Kimpton
    Hi, I am writing a Rails app that "scrapes/navigates" some other websites and webservices for content. I am using Mechanize and Savon to do the heavylifting. But given the dynamic nature of the web, I'd like to make my calls to these editable by the admin users of the site - rather than requiring me to release a new version of the site. The actual scraping thread happens async to the website, using the daemons gem. My requirements are: Thinking that the scraping/webservice calling code is quite simple, the easiest route is to make the whole class editable by the admins. Keep a history of the scraping code - so that we can fairly easily revert if we introduce a problem. Initially use the code from the file system, but as soon as thats been edited and stored somewhere, to use that code instead. I am thinking my options are: Store the code in the db (with a history table for the old versions) Store the code in a private git repo somewhere and access that for the history/latest versions. I am thinking the git route might be easiest, given its raison d'etre is to track file history... But perhaps there is a gem/plugin that does all this for me, out of the box? Thanks in advance for any tips/advice. ~chris

    Read the article

  • Does Security Trimming work with Web Forms Routing?

    - by Slauma
    In my web.config I have configured a SiteMapProvider with securityTrimmingEnabled="true" and on my main master page is an asp:Menu control bound to an asp:SiteMapDataSource. In addition I have configured restricted access to all pages in a subfolder "Admin" (using another web.config in this subfolder). If I put a sitemapNode in Web.sitemap... <siteMapNode url="~/Admin/Default.aspx" title="Administration" description="" > ... only users in role "Admin" will have the menu item related to that siteMapNode. So this is working fine and as intended. Now I have defined a URL route in Global.asax to map the physical file to a new URL: System.Web.Routing.RouteTable.Routes.MapPageRoute("AdminHomeRoute", "Administration/Home", "~/Admin/Default.aspx"); But when I use this route-URL in the SiteMap file... <siteMapNode url="Administration/Home" title="Administration" description="" > ... it seems that security trimming does not work: The menu item is visible for all users. (Access to the page is still restricted though, so selecting the menu item by non-Admin users does not navigate to the restricted page.) Question: Is there any setting I've missed so far to make security trimming working with URL routing in ASP.NET 4.0 Web Forms? Did I do something wrong? Is there any work-around? Thank you for help!

    Read the article

  • ZF2: Get url parameters in controller

    - by koko
    I have experienced Zend Framework 1 and I've build some apps with that framework. Now, I'm experimenting Zend Framework 2, but I'm stuck on the url parameters. I've setup my routing like this: // Setup for router and routes 'Zend\Mvc\Router\RouteStack' => array( 'parameters' => array( 'routes' => array( 'default' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => '/[:slug]', 'constraints' => array( 'slug' => '[a-zA-Z][a-zA-Z0-9_\/-]*' ), 'defaults' => array( 'controller' => 'Htmlsite\Controller\BootController', 'action' => 'index', 'slug' => 'home' ), ), ), 'home' => array( 'type' => 'Zend\Mvc\Router\Http\Literal', 'options' => array( 'route' => '/', 'defaults' => array( 'controller' => 'Htmlsite\Controller\BootController', 'action' => 'index', ), ), ), ), ), ), As you can see, I've tried to make a variable slug. How can I access this variable?

    Read the article

  • ASP.NET MVC 2.0 + Implementation of a IRouteHandler does not fire

    - by Peter
    Can anybody please help me with this as I have no idea why public IHttpHandler GetHttpHandler(RequestContext requestContext) is not executing. In my Global.asax.cs I have public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.Add("ImageRoutes", new Route("Images/{filename}", new CustomRouteHandler())); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } //CustomRouteHandler implementation is below public class CustomRouteHandler : IRouteHandler { public IHttpHandler GetHttpHandler(RequestContext requestContext) { // IF I SET A BREAK POINT HERE IT DOES NOT HIT FOR SOME REASON. string filename = requestContext.RouteData.Values["filename"] as string; if (string.IsNullOrEmpty(filename)) { // return a 404 HttpHandler here } else { requestContext.HttpContext.Response.Clear(); requestContext.HttpContext.Response.ContentType = GetContentType(requestContext.HttpContext.Request.Url.ToString()); // find physical path to image here. string filepath = requestContext.HttpContext.Server.MapPath("~/logo.jpg"); requestContext.HttpContext.Response.WriteFile(filepath); requestContext.HttpContext.Response.End(); } return null; } } Can any body tell me what I'm missing here. Simply public IHttpHandler GetHttpHandler(RequestContext requestContext) does not fire. I havn't change anything in the web.config either. What I'm missing here? Please help.

    Read the article

  • google maps not working anymore at the drop of a hat

    - by Vordreller
    2 days ago, I was working on a project that involves google maps. The website showed the maps on the pages just fine. Now, I come back to my workstation, nothing has changed, expect for the fact that the google maps won't show up anymore. The code is identical, nobody has touched my machine since I was gone, I've checked the html, everything is perfect and still this isn't working... The Javascript console is giving no errors and the code is identical to a backup I make everytime I call it a day. 2 days ago it was working, today it isn't. I've even copied the source code, put it into an html file and tried that, but the same result. I'm at a loss here. This is my code: <script type="text/javascript"> //<![CDATA[ var map; var directionsPanel; var directions; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GScaleControl()); map.addControl(new GMapTypeControl()); //the route description directionsPanel = document.getElementById("route"); directions = new GDirections(map, directionsPanel); directions.load({COMMAND}); } } //]]> </script> The {COMMAND} is something that the PHP template will parse, I've checked it, the format is 100% correct and like I allready said, code now is identical to the backup, and if it worked back then, it should work now. Did google update their API overnight and did a function that I use here become deprecated? I don't know what's going on here...

    Read the article

  • Mixing RewriteRule and ProxyPass in Apache

    - by Taylor L
    I was working on debugging an issue today related to mixing mod_proxy and mod_rewrite together and I ended up having to use balancer://mycluster in the RewriteRule in order to stop receiving a 404 error from Apache. I have two questions: 1) Is there any other way to get the rewritten URL to go through the balancer without adding balancer://mycluster into the RewriteRule? 2) Is there a way to define all the parameters I defined in ProxyPass (stickysession=JSESSIONID|jsessionid scolonpathdelim=On lbmethod=bytraffic nofailover=Off) in either the <Proxy> or RewriteRule? I'm concerned the requests that match the new RewriteRule won't load balance in the same fashion as those that go through ProxyPass (like /app1/something.do)? Below are the relevant sections of the httpd.conf. I am using Apache 2.2. <Proxy balancer://mycluster> Order deny,allow Allow from all BalancerMember ajp://my.domain.com:8009 route=node1 BalancerMember ajp://my.domain.com:8009 route=node2 </Proxy> ProxyPass /app1 balancer://mycluster/app1 stickysession=JSESSIONID|jsessionid scolonpathdelim=On lbmethod=bytraffic nofailover=Off ProxyPassReverse /app1 ajp://my.domain.com:8009/app1 ... RewriteRule ^/static/cms/image/(.*)\.(.*) balancer://mycluster/app1/$1.$2 [P,L]

    Read the article

  • T4MVC and duplicate controller names in different areas

    - by artvolk
    In my application I have controller named Snippets both in default area (in application root) and in my area called Manage. I use T4MVC and custom routes, like this: routes.MapRoute( "Feed", "feed/", MVC.Snippets.Rss() ); And I get this error: Multiple types were found that match the controller named 'snippets'. This can happen if the route that services this request ('{controller}/{action}/{id}/') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter. The request for 'snippets' has found the following matching controllers: Snippets.Controllers.SnippetsController Snippets.Areas.Manage.Controllers.SnippetsController I know that there are overloads for MapRoute that take namespaces argument, but there are no such overloads with T4MVC support. May be I'm missing something? The possible syntax can be: routes.MapRoute( "Feed", "feed/", MVC.Snippets.Rss(), new string[] {"Snippets.Controllers"} ); or, it seems quite good to me to have namespace as T4MVC property: routes.MapRoute( "Feed", "feed/", MVC.Snippets.Rss(), new string[] {MVC.Snippets.Namespace} ); Thanks in advance!

    Read the article

  • Dual usage of asp.net mvc and php under same domain

    - by jim
    Hello all, I've got a scenario where we have a customer who has a linux hosted php app (joomla) that they wish to integrate with some back-end asp.net mvc functionality that was created for a 'sister' site. Basically, the mvc site has prices and stock availability methods which (in the sister site) populates dropdown lists and other 'order' style info on the pages. I've been tasked with looking at the integration options to allow the php site to use this info as a 'service'. (as ever, these guys are looking at cost of ownership, maintenence etc, so this is their preferred route) Has anyone done anything similar with success?? I'd imagine (much like the sister site) liberal doses of ajax will be employed in order to populate portions of the page on demand. So this may have a bearing on any suggestions that you may have. Also, the methods that are being called ultimately end up populating the same database, so there are no issues with correlating the ID's across the different platforms. I don't really want to go down any 'iframe' type route if at all possible, tho' reality may dictate this as being an option. I'm possibly (naively) imagining that i could simply invoke the mvc functions directly from the php app with some sort of 'session' variable being passed for authentication. pretty tall order or pretty straightfwd?? cheers jim

    Read the article

  • What is the form_for syntax for nested resources?

    - by Kris
    I am trying to create a form for a nested resource. Here is my route: map.resources :websites do |website| website.resources :domains end Here are my attempts and the errors: <% form_for(@domain, :url => website_domains_path(@website)) do | form | %> <%= form.text_field :name %> # ArgumentError: wrong number of arguments (1 for 0) # form_helper.rb:290:in 'respond_to?' # form_helper.rb:290:in 'apply_form_for_options!' # form_helper.rb:277:in 'form_for' <% form_for([@website, @domain]) do | form | %> <%= form.text_field :name %> # ArgumentError: wrong number of arguments (1 for 0) # form_helper.rb:290:in 'respond_to?' # form_helper.rb:290:in 'apply_form_for_options!' # form_helper.rb:277:in 'form_for' <% form_for(:domain, @domain, :url => website_domains_path(@website)) do | form | %> <%= form.text_field :name %> # ArgumentError: wrong number of arguments (1 for 0) # wrapper.rb:14:in 'respond_to?' # wrapper.rb:14:in 'wrap' # active_record_helper.rb:174:in 'error_messages_for' <% form_for(:domain, [@website, @domain]) do | form | %> <%= form.text_field :name %> # UndefinedMethodError 'name' for #<Array:0x40fa498> I have confirmed both @website and @domain contain instances of the correct class. The routes also generate correctly is used like this for example, so I dont think their is an issue with the route or url helpers. <%= website_domains_path(1) %> <%= website_data_source_path(1, 1) %> Rails 2.3.5

    Read the article

  • jscript1.js error in webforms when applying routing

    - by Sean N
    Hello I have a project using webforms. I applied routing on one of the page. My route is structure like this : http://localhost:3576/Request/Admin/Rejected/ = http://localhost:3576/Request/{role}/{action}/{id} Everything works great but i have a javascript error: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Timestamp: Fri, 7 May 2010 13:35:54 UTC Message: Syntax error Line: 3 Char: 1 Code: 0 URI: http://localhost:3576/Request/Admin/Rejected/JScript1.js I think it's trying to route to the file where i stored my javascript functions. Any suggestion?

    Read the article

  • diffuculty in appending images dynamically in an Custom List View

    - by ganesh
    Hi I have written an custom List view which binds images according to the result from a feed @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.row_for_stopnames, null); holder = new ViewHolder(); holder.name = (TextView)convertView.findViewById(R.id.stop_name); holder.dis = (TextView)convertView.findViewById(R.id.distance); holder.route_one=(ImageView)convertView.findViewById(R.id.one); holder.route_two=(ImageView)convertView.findViewById(R.id.two); holder.route_three=(ImageView)convertView.findViewById(R.id.three); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.name.setText(elements.get(position).get("stop_name")); holder.dis.setText(elements.get(position).get("distance")); String[] route_txt=elements.get(position).get("route_name").split(","); for(int i=0;i<route_txt.length;i++) { if(i==0) { holder.route_one.setBackgroundResource(Utils.getRouteImage().get(stop_txt[0])); } else if(i==1) { holder.route_two.setBackgroundResource(Utils.getRouteImage().get(stop_txt[1])); } else if(i==2) { holder.route_three.setBackgroundResource(Utils.getRouteImage().get(stop_txt[2])); } } convertView.setOnClickListener(new OnItemClickListener(position,elements)); return convertView; } class ViewHolder { TextView name; TextView dis; ImageView route_one; ImageView route_two; ImageView route_three; } for every stop name there may be route_names, maximum of three routes.I have to bind images according to the number of route names.This is what I tried to do by the above code .This works fine until I start scrolling up and down .When I do so the route images gets displayed where it does not want to be,this behaviour is unpredictable.I will be glad if someone explain me why this happens,and the best way to do this.The getRouteImage method of Utils class returns HashMap with key String and value a drawable

    Read the article

  • Postback not working with ASP.NET Routing (Validation of viewstate MAC failed)

    - by Robert
    Hi. I'm using the ASP.NET 3.5 SP1 System.Web.Routing with classic WebForms, as described in http://chriscavanagh.wordpress.com/2008/04/25/systemwebrouting-with-webforms-sample/ All works fine, I have custom SEO urls and even the postback works. But there is a case where the postback always fails and I get a: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Here is the scenario to reproduce the error: Create a standard webform mypage.aspx with a button Create a Route that maps "a/b/{id}" to "~/mypage.aspx" When you execute the site, you can navigate http://localhost:XXXX/a/b/something the page works. But when you press the button you get the error. The error doen't happen when the Route is just "a/{id}". It seems to be related to the number of sub-paths in the url. If there are at least 2 sub-paths the viewstate validation fails. You get the error even with EnableViewStateMac="false". Any ideas? Is it a bug? Thanks

    Read the article

  • properly format postal address with line breaks [google maps]

    - by munchybunch
    Using V3 of the google maps API, is there any reliable way to format addresses with the line break? By this, I mean something like 1600 Amphitheatre Parkway Mountain View, CA 94043 should be formatted as 1600 Amphitheatre Parkway Mountain View, CA 94043 Looking through the response object from geocoding, there is an address_components array that has, for the above address, 8 components (not all of the components are used for the address): 0: Object long_name: "1600" short_name: "1600" types: Array[1] 0: "street_number" length: 1 1: Object long_name: "Amphitheatre Pkwy" short_name: "Amphitheatre Pkwy" types: Array[1] 0: "route" length: 1 2: Object long_name: "Mountain View" short_name: "Mountain View" types: Array[2] 0: "locality" 1: "political" length: 2 3: Object long_name: "San Jose" short_name: "San Jose" types: Array[2] 0: "administrative_area_level_3" 1: "political" length: 2 4: Object long_name: "Santa Clara" short_name: "Santa Clara" types: Array[2] 0: "administrative_area_level_2" 1: "political" length: 2 5: Object long_name: "California" short_name: "CA" types: Array[2] 0: "administrative_area_level_1" 1: "political" length: 2 6: Object long_name: "United States" short_name: "US" types: Array[2] 0: "country" 1: "political" length: 2 7: Object long_name: "94043" short_name: "94043" types: Array[1] 0: "postal_code" length: 1 I was thinking that you could just combine parts that you want, like sprintf("%s %s<br />%s, %s %s", array[0].short_name, array[1].short_name, array[2].short_name, array[5].short_name, array[7].short_name) [edit]I just realized that sprintf isn't defined by default in JavaScript, so just a concatenation would do I guess.[/edit] But that seems awfully unreliable. Does anyone know the details on the structure of address_components, and if it's reliably similar like that for street addresses in the US? If I wanted to, I guess I could look for the proper types (street_number,route, etc) as well. I'd love it if anyone had a better way than what I"m doing here...

    Read the article

  • Static content not displayed with Zend FW

    - by shin
    I am trying to display a static content with Zend framework. When I go to http://square.localhost/content/services, I get an error message. Could anyone tell me how to fix this please? Thanks in advance. application.ini .... .... resources.layout.layoutPath = APPLICATION_PATH "/layouts" resources.layout.layout = "master" resources.router.routes.home.route = /home resources.router.routes.home.defaults.module = default resources.router.routes.home.defaults.controller = index resources.router.routes.home.defaults.action = index resources.router.routes.static-content.route = /content/:page resources.router.routes.static-content.defaults.module = default resources.router.routes.static-content.defaults.controller = static-content resources.router.routes.static-content.defaults.action = display application/modules/default/controllers/StaticContentController.php class StaticContentController extends Zend_Controller_Action { public function init() { } // display static views public function displayAction() { $page = $this->getRequest()->getParam('page'); if (file_exists($this->view->getScriptPath(null) . "/" . $this->getRequest()->getControllerName() . "/$page." . $this->viewSuffix)) { $this->render($page); } else { throw new Zend_Controller_Action_Exception('Page not found', 404); } } } application/modules/default/views/scripts/static-content/services.phtml some html ... ... Error message An error occurred Page not found Exception information: Message: Page not found Stack trace: #0 /var/www/square/library/Zend/Controller/Action.php(513): StaticContentController->displayAction() #1 /var/www/square/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('displayAction') #2 /var/www/square/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 /var/www/square/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() #4 /var/www/square/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #5 /var/www/square/public/index.php(26): Zend_Application->run() #6 {main} Request Parameters: array ( 'page' => 'services', 'module' => 'default', 'controller' => 'static-content', 'action' => 'display', )

    Read the article

  • Delete ONE SPECIFIC table of a database - leave the rest intact

    - by Jayomat
    Hi, I have a database where I store two different kinds of data. One table is for favorite routes, the other stores the retrieved routes from a server. I can retrieve the routes etc just fine. But after retrieving the first Route, pressing back or HOME, and then retrieving another route, the routes table is filled with all the old routes plus the new ones. So my question: how do I delete ONLY the routes table and not the whole database because I don't want to delete the added favorites....?! I found the following function in the android docs: public int delete (String table, String whereClause, String[] whereArgs) and I tried to implement it, but I must pass a SQLiteDataBase as an argument. But how? I implemented: public void deleteTableRoutes(SQLiteDataBase db){ db.delete("routes", null, null); } But I want to call this function from a different class where I have no reference to the database.. so what do I have to pass as an argument? Or how do I get a reference to my database? I build my database upon the code example of the NotePadExample from the dev docs. How to solve this problem? thanks

    Read the article

  • How can I properly handle 404s in ASP.NET MVC?

    - by Brian
    I am just getting started on ASP.NET MVC so bear with me. I've searched around this site and various others and have seen a few implementations of this. EDIT: I forgot to mention I am using RC2 Using URL Routing: routes.MapRoute( "Error", "{*url}", new { controller = "Errors", action = "NotFound" } //404s ); The above seems to take care of requests like this (assuming default route tables setup by initial MVC project): "/blah/blah/blah/blah" Overriding HandleUnknownAction() in the controller itself: //404s - handle here (bad action requested protected override void HandleUnknownAction(string actionName) { ViewData["actionName"] = actionName; View("NotFound").ExecuteResult(this.ControllerContext); } However the previous strategies do not handle a request to a Bad/Unknown controller. For example, I do not have a "/IDoNotExist", if I request this I get the generic 404 page from the web server and not my 404 if I use routing + override. So finally, my question is: Is there any way to catch this type of request using a route or something else in the MVC framework itself? OR should I just default to using Web.Config customErrors as my 404 handler and forget all this? I assume if I go with customErrors I'll have to store the generic 404 page outside of /Views due to the Web.Config restrictions on direct access. Anyway any best practices or guidance is appreciated.

    Read the article

  • Implementing a 1 to many relationship with SQLite

    - by Patrick
    I have the following schema implemented successfully in my application. The application connects desk unit channels to IO unit channels. The DeskUnits and IOUnits tables are basically just a list of desk/IO units and the number of channels on each. For example a desk could be 4 or 12 channel. CREATE TABLE DeskUnits (Name TEXT, NumChannels NUMERIC); CREATE TABLE IOUnits (Name TEXT, NumChannels NUMERIC); CREATE TABLE RoutingTable (DeskUnitName TEXT, DeskUnitChannel NUMERIC, IOUnitName TEXT, IOUnitChannel NUMERIC); The RoutingTable 'table' then connects each DeskUnit channel to an IOUnit channel. For example the DeskUnit called "Desk1" channel 1 may route to IOunit name "IOUnit1" channel 2, etc. So far I hope this is pretty straightforward and understandable. The problem is, however, this is a strictly 1 to 1 relationship. Any DeskUnit channel can route to only 1 IOUnit channel. Now, I need to implement a 1 to many relationship. Where any DeskUnit channel can connect to multiple IOUnit channels. I realise I may have to rearrange the tables completely, but I am not sure the best way to go about this. I am fairly new to SQLite and databases in general so any help would be appreciated. Thanks Patrick

    Read the article

  • MySQL 1064 error, works in command line and phpMyAdmin; not in app

    - by hundleyj
    Here is my query: select * from (select *, 3956 * 2 * ASIN(SQRT(POWER(SIN(RADIANS(45.5200077 - lat)/ 2), 2) + COS(RADIANS(45.5200077)) * COS(RADIANS(lat)) * POWER(SIN(RADIANS(-122.6942014 - lng)/2),2))) AS distance from stops order by distance, route asc) as p group by route, dir order by distance asc limit 10 This works fine at the command line and in PHPMyAdmin. I'm using Dbslayer to connect to MySQL via my JavaScript backend, and the request is returning a 1064 error. Here is the encoded DBSlayer request string: http://localhost:9090/db?{%22SQL%22:%22select%20*%20from%20%28select%20*,%203956%20*%202%20*%20ASIN%28SQRT%28POWER%28SIN%28RADIANS%2845.5200077%20-%20lat%29/%202%29,%202%29%20+%20COS%28RADIANS%2845.5200077%29%29%20*%20COS%28RADIANS%28lat%29%29%20*%20POWER%28SIN%28RADIANS%28-122.6942014%20-%20lng%29/2%29,2%29%29%29%20AS%20distance%20from%20%60stops%60%20order%20by%20%60distance%60,%20%60route%60%20asc%29%20as%20p%20group%20by%20%60route%60,%20%60dir%60%20order%20by%20%60distance%60%20asc%20limit%2010%22} And the response: {"MYSQL_ERRNO" : 1064 , "MYSQL_ERROR" : "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(RADIANS(45.5200077)) * COS(RADIANS(lat)) * POWER(SIN(RADIANS(-122.6942014 - lng' at line 1" , "SERVER" : "trimet"} Thanks!

    Read the article

  • ASP.NET MVC URL Routing problem

    - by Sadegh
    hi, i have defined a route as below: context.MapRoute("SearchEngineWebSearch", "search/web/{query}/{index}/{size}", new { controller = "search", action = "web", query = "", index = 0, size = 5 }); and action method to handle request match with that: public System.Web.Mvc.ActionResult Web(string query = "", int index = 0, int size = 5) { if (string.IsNullOrEmpty(query)) return RedirectToRoute("SearchEngineBasicSearch"); var search = new Search(); var results = search.PerformSearch(query, index, size); ViewData["Query"] = query; if (results != null && results.Count() > 0) { ViewData["Results"]= results; return View("Web"); } else return View("Not-Found"); } and form to sent parameter to action method: <% using (Html.BeginForm("Web", "Search", FormMethod.Post)) { %> <input name="query" type="text" value="<%: ViewData["Query"]%>" class="search-field" /> <input type="submit" value="Search" class="search-button" /> <input type="hidden" name="index" value="2" /> <input type="hidden" name="size" value="2" /> <%} %> now after click on submit and sending value to action method all route values updated but url values still is equals to first time of sending parameter. for example if i sent for first time request such as http://localhost/search/web/google and for next time http://localhost/search/web/yahoo, query parameter which passed to action method is yahoo but url after postback is http://localhost/search/web/google still! can anybody help me plz? ;)

    Read the article

  • String Parameter in url

    - by Ivan90
    Hy Guys, I have to pass in a method action a string parameter, because I want to implement a tags' search in my site with asp.net MVC but everytime in action it is passed a null value. I post some code! I try to create a personal route. routes.MapRoute( "TagsRoute", "Tags/PostList/{tag}", new {tag = "" } ); My RouteLink in a viewpage for each tag is: <% foreach (var itemtags in item.tblTagArt) {%> <%= Html.RouteLink(itemtags.Tags.TagName,"TagsRoute", new {tag=itemtags.Tags.TagName})%>, <% } %> My method action is: public ActionResult PostList(string tag) { if (tag == "") { return RedirectToAction("Index", "Home"); } else { var articoli = artdb.GetArticoliByTag(tag); if (articoli == null) { return RedirectToAction("Index", "Home"); } return View(articoli); } } Problem is value tag that's always null, and so var articoli is always empty! Probably my problem is tag I have to make a route contrainst to my tag parameter. Anybody can help me? N.B I am using ASP.NET MVC 1.0 and not 2.0!

    Read the article

  • Determining the popularity of a video with ratings and views

    - by user295825
    I am about to embark on a new project - a video website. Users will be able to register, and vote on videos by clicking "like" or "dislike", or something to that effect. In any event, it will be a 2-option voting system, not a 5-star system. Every X number of days, I will be generating a "chart" of the most popular videos. So my question is: how should I determine the popularity of a given video? If I went the route of tallying up the videos with the most views, this could have the effect of exceptionally bad videos making it to the of the charts (just because they're so bad). If I go the route of a scoring system based on the amount of "like" and "dislike" votes (eg. 100 like votes, and 50 dislike votes equals a score of 2), videos with few views could appear on the top of the charts. So, what I need to do is a combination of the two. Barring, of course, spammy views and votes. What's your guys' thoughts on the subject?

    Read the article

  • ASP.NET MVC 2.0 + Implementation of a IRouteHandler goes not fire

    - by Peter
    Can anybody please help me with this as I have no idea why public IHttpHandler GetHttpHandler(RequestContext requestContext) is not executing. In my Global.asax.cs I have public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.Add("ImageRoutes", new Route("Images/{filename}", new CustomRouteHandler())); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } //CustomRouteHandler implementation is below public class CustomRouteHandler : IRouteHandler { public IHttpHandler GetHttpHandler(RequestContext requestContext) { // IF I SET A BREAK POINT HERE IT DOES NOT HIT FOR SOME REASON. string filename = requestContext.RouteData.Values["filename"] as string; if (string.IsNullOrEmpty(filename)) { // return a 404 HttpHandler here } else { requestContext.HttpContext.Response.Clear(); requestContext.HttpContext.Response.ContentType = GetContentType(requestContext.HttpContext.Request.Url.ToString()); // find physical path to image here. string filepath = requestContext.HttpContext.Server.MapPath("~/logo.jpg"); requestContext.HttpContext.Response.WriteFile(filepath); requestContext.HttpContext.Response.End(); } return null; } } Can any body tell me what I'm missing here. Simply public IHttpHandler GetHttpHandler(RequestContext requestContext) does not fire. I havn't change anything in the web.config either. What I'm missing here? Please help.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >