routing

Why ASP.NET MVC bothers to have a Default.aspx file?

久未见 提交于 2019-12-23 07:47:57
问题 When create a new ASP.NET MVC project in Visual Studio 2008, there is a Default.aspx page by default. It has one line In its Page_Load function, it just redirects to "/" to go through the routing procedure. public void Page_Load(object sender, System.EventArgs e) { HttpContext.Current.RewritePath(Request.ApplicationPath); IHttpHandler httpHandler = new MvcHttpHandler(); httpHandler.ProcessRequest(HttpContext.Current); } I tried to remove Default.aspx and it turns out that the default URI

Is it possible to change order of routes in routing table when using attribute routing?

限于喜欢 提交于 2019-12-23 06:59:04
问题 So, I'm switching an area over from using AreaRegistration to using Attribute Routing. I'm running into an issue which appears to be caused by the order in which routes are loaded into the routing table. I'd solved the issue in AreaRegistration by loading in the problematic route last, so that only if all other routes didn't match would that route be matched. With Attribute Routing, this doesn't appear to be possible. I have the Order parameter when creating a route, but this doesn't affect

Use Ui-Router's ui-sref Just to Set Query Params

狂风中的少年 提交于 2019-12-23 06:54:39
问题 I have the following link. <a ui-sref="...">Clicking this adds ?test=true to the query params.</a> Is there a way to use the ui-sref attribute to just change query params without reloading the page or directing to another function? 回答1: You should be able to do it by passing the arguments with the state. try:- <a ui-sref="yourStateName({test:true})">Clicking this adds ?test=true to the query params.</a> Usage: ui-sref='stateName' - Navigate to state, no params. 'stateName' can be any valid

Use Ui-Router's ui-sref Just to Set Query Params

谁都会走 提交于 2019-12-23 06:53:51
问题 I have the following link. <a ui-sref="...">Clicking this adds ?test=true to the query params.</a> Is there a way to use the ui-sref attribute to just change query params without reloading the page or directing to another function? 回答1: You should be able to do it by passing the arguments with the state. try:- <a ui-sref="yourStateName({test:true})">Clicking this adds ?test=true to the query params.</a> Usage: ui-sref='stateName' - Navigate to state, no params. 'stateName' can be any valid

Rails3 routing precedence

我的未来我决定 提交于 2019-12-23 05:19:49
问题 I'm creating a simple CMS with Rails 3. In my routes.rb file I have the following entry to catch all routes: match '*url', :controller => 'site', :action => 'dynamic_page' I'm using ckeditor gem for editor support. My rake routes is as follows: root /(.:format) {:action=>"index", :controller=>"site"} /*url(.:format) {:action=>"dynamic_page", :controller=>"site"} ckeditor_pictures GET /ckeditor/pictures(.:format) {:action=>"index", :controller=>"ckeditor/pictures"} ckeditor_pictures POST

Pyramid app: How can I pass values into my request.route_url?

ぃ、小莉子 提交于 2019-12-23 04:54:17
问题 I have this in my views.py file as the view config for my home page: @view_config(route_name='home_page', renderer='templates/edit.pt') def home_page(request): if 'form.submitted' in request.params: name= request.params['name'] body = request.params['body'] page=Page(name,body) DBSession.add(page) return HTTPFound(location=request.route_url('view_page',pagename=name)) return {} Also, here is the form in the edit.pt template: <form action="/view_page" method="post"> <div> <input type="text"

Dart Polymer Routing

无人久伴 提交于 2019-12-23 03:41:49
问题 I have a single page app using Dart and Polymer. I'm trying to add a route to another page with route_hierarchical What I've tried so far was configuring the router like this: router = new Router() router.root ..addRoute(name: 'games', path: '/games') ..addRoute(name: 'login', path: '/login') ..addRoute(name: 'home', defaultRoute: true, path: '/'); router.listen(); I've found that I can use new Router(useFragment: ...); to enable the hashbangs in the URLs or not. The problem is that when I

Dart Polymer Routing

孤街醉人 提交于 2019-12-23 03:41:33
问题 I have a single page app using Dart and Polymer. I'm trying to add a route to another page with route_hierarchical What I've tried so far was configuring the router like this: router = new Router() router.root ..addRoute(name: 'games', path: '/games') ..addRoute(name: 'login', path: '/login') ..addRoute(name: 'home', defaultRoute: true, path: '/'); router.listen(); I've found that I can use new Router(useFragment: ...); to enable the hashbangs in the URLs or not. The problem is that when I

Configuring Restivus POST method for Meteor

怎甘沉沦 提交于 2019-12-23 03:12:40
问题 I have the following Restivus configuration: if(Meteor.isServer){ Restivus.configure({ }); //Allow Restivus to manage Reports Restivus.addCollection('reports'); Restivus.addRoute('newReport/:message', {}, { // POST post: { action: function(){ var response = null; var message = this.urlParams.message; if(message){ console.log("Message received: " + message); return {status: "success", data: message}; } else { console.log("Message empty..."); return {status: "fail", message: "Post not found"};

ASP.NET MVC3 Routing - Same URL for different areas

隐身守侯 提交于 2019-12-23 03:12:18
问题 My MVC3 project has an area called Mobile. Following is the behavior when going to my site from a desktop browser and mobile browser: Desktop browser: URL stays mydomain.com and the default desktop home page is correctly displayed. Mobile (iPhone) browsers: URL changes to mydomain.com/Mobile/Home and the mobile home page is correctly displayed. I would like the URL to stay mydomain.com regardless of whether it is being viewed from a desktop browser or a mobile browser. How do I accomplishing