Caching - Exclude Routing Parameters In VaryByParam?

Apr 17, 2010

I have a routing setting in my global.asax file:

routes.MapPageRoute("video-browse", "video/{id}/{title}/", "~/routeVideo.aspx");

My routeVideo.aspx page has caching setting:

<%@ OutputCache Duration="10" Location="ServerAndClient" VaryByParam="id" %>

But when I request http://localhost/video/6/example1 and http://localhost/video/6/example2 after this, the page is created again. So I think VaryByParam works for * but I only want compile when id changes. Is there a way to define routing parameters at VaryByParam?

View 3 Replies


Similar Messages:

Use Any Parameter Value For VaryByParam In Caching Page?

Jan 26, 2011

<%@ OutputCache Duration="10" VaryByParam="Button1" %>

I type the above code to vary text of Button but it does not vary the value .

View 1 Replies

MVC :: URL Routing In Mvc To Exclude Controller/index Name From URL

Oct 21, 2010

I have this url working in my code:

[Code]....

I want to change my url to NOT to include the home/index [Code]....

ie, it should work like

[Code]....

My current Global.asax entry is like:

[Code]....

[Code]....

[Code]....

[Code]....

View 1 Replies

MVC 2 Bug In Routing And Parameters?

Jul 12, 2010

I consider the following an error, and not a feature:

When posting a request, any parameters are held in the HttpContext.Request.Form as key/value pairs. This is perfectly fine for the recipient of the request. Unfortunately, however, further down the chain these values still exist and take precedent in binding over new parameters created during processing.

This is obvious in the RenderAction scenario. If a new parameter is created in a view and passed through RenderAction, if the parameter has the same name as one of the initial request parameters (or a form field for that matter), then MVC Binding will bind the initial request form value to the Action being called, and not the new parameter being defined in the RenderAction call. What's even more frustrating, is there is no easy way to override the initial form values.

It really does not make sense that a value defined in one context, should live throughout the entire processing context... at least without the developer being able to determine it should remain. At a minimum, any new parameter defined in the process with the same name should either a) be received as a parameter and not a form value; or b) override the form value.

View 5 Replies

MVC :: Routing - How To Get URL Parameters With Regex

May 27, 2010

I would like to be able to type in a URL like [URL] arrive at a Details Page which parsed the "M" and the "123" from the query string and used them as params to query a Table in my Database. I've been reading my @$$ off and I can't find anything close :>

View 3 Replies

Routing With Parameters In .NET Application?

Oct 7, 2010

I need to use routing with parameters in my ASP.NET application.

public class Global : System.Web.HttpApplication
{
void Application_Start(object sender, EventArgs e)

Then, by navigating to "/Profile" I want to get on Page_Load method Request.Params["Id"] as null and by navigating to "/Profile/1", Request.Params["Id"] as "1".

View 1 Replies

4.0 URL Routing With Two Or Multiple Querystring Parameters

Aug 16, 2010

How can I pass two querysting parameters in URL routing using ASP.NET 4.0? I have gone through many articles, but everywhere it shows only one parameter. I'd like the display URL to be: [URL] The first parameter is ID: 1 The second is Name: This is my first report I am trying following route, but it is not working

routes.MapPageRoute(
"MarketReports", // Route name
"Reports/{*i}-{*n}", // Route URL
"~/pageControl2.aspx" // Web page to handle route
);

How can I make this work as described?

View 1 Replies

.net MVC Routing To Controller With Optional Parameters

Apr 9, 2010

I have a controller method that is called with many different combinations of URL's. To overcome issue i am using optional parameters.here is my controller method signature...public ActionResult localMembersSearch(string Gender, string calling, [Optional]string Region, [Optional]string County, [Optional]string Town, [Optional]string queryvalues)the first two parameters are not optional but always expect

View 1 Replies

.net Webforms Routing Optional Parameters

Sep 23, 2010

I want to add optional parameters in my routing table.For example I would like the users to browse a product catalog like this:http://www.domain.com/browse/by-category/electronics/1,2,3 etc

routes.MapPageRoute(
"ProductsBrowse",
"browse/{BrowseBy}/{Category}",
"~/Pages/Products/Browse.aspx"

View 1 Replies

Handle Optional Parameters In URL Routing?

Jun 2, 2010

I've already implemented URL routing in my app but there are cases where I may or may not get a paramter. In particular, I'm trying to come up with a good way to handle multi-language support. For example, if my regular URL is /SomeCategory/Friendly-Topic-URL, I want to have an optional language selector at the end but I'd like to be optional. So, if I get /SomeCategory/Friendly-Topic-URL/es, that should bring up the topic in Spanish but if get nothing, that should bring up English.

View 6 Replies

Mvc Routing With 2 Parameters/unable To Show The Picture

Nov 15, 2010

I want to do a hyper link such as this

<img src="../Thumb/1342526/1" alt="" /><br />
/thumb(controler)/item number/picture number within item number

my route as I thought is could be [Code]....
it does not show the picture so I assume this is not correct?!#@*(#!&@

View 3 Replies

MVC Routing - Multiple (Optional) Search Parameters

Nov 26, 2010

I'm trying to implement a search function on an incident logging page that is working fine. Currently I am only able to search against one criteria at a time, using the following route:

View 2 Replies

C# - How To Point URL From Global File Using URL Routing 3.5 Without Parameters

Nov 26, 2010

How to point url from Global file using URL routing 3.5 asp.net without parameters?

For example:

[code]....

View 1 Replies

Configuration :: WebForms Routing In 4.0 Multiple Parameters?

Oct 18, 2010

Simple enough I have a search feature I am wanting to impliment Routing for.Here is the routing table for it.

[Code]....

Now I want to set the postback URL for a linkbutton to go to the search page with all parameters filled in but the last one or for that matter any one of the parameters to be left blank

[Code]....

You will see in this example I left the very last one blank. Now when I do that the link does not work. If I fill in all attributes it does workso can anyone tell me how to work around this issue?

View 2 Replies

Web Forms :: How To Use Same Number Of Parameters For Two Pages In URL Routing

May 7, 2015

I have some routes defined in global.asax according to which the page is redirected.

 Global.asax
void Application_Start(object sender, EventArgs e) {
RegisterRoute(System.Web.Routing.RouteTable.Routes);
} void RegisterRoute(RouteCollection routes) {
routes.MapPageRoute("MainCategory", "{state}/{mcat}", "~/MainCategory.aspx");
routes.MapPageRoute("carriers", "{state}/{mcat}/{dcat}", "~/carriers.aspx");
routes.MapPageRoute("carrierdevices", "{state}/{mcat}/{dcat}/{carrier}", "~/carrieritems.aspx");
routes.MapPageRoute("cellphone", "{state}/{mcat}/{dcat}/{carrier}/{device}/{id}", "~/Catalog.aspx");
//New Rout with same parameters
routes.MapPageRoute("iphones", "{state}/{mcat}/{dcat}", "~/iphones.aspx");
}

i mean to say how to decide the destination page depending on URL Eg:1.routes.MapPageRoute("carriers", "{state}/{mcat}/{dcat}", "~/carriers.aspx"); 2.routes.MapPageRoute("iphones", "{state}/{mcat}/{dcat}", "~/iphones.aspx");

if value in URL second parameter i.e mcat=cellphone then it must redirect to carriers.aspx. and if mcat=iphone then it must redirect to iphones.aspx page.

Problem:currently if in URL there are 3 parameters then it always goes to carriers.aspx as it searches in route table for 3 parameters it redirects to carriers.aspx which need to be conditionally redirected depending on mcat valuehow to do?

View 1 Replies

Web Forms :: Pass Multiple Parameters In URL Routing

May 7, 2015

I have seen demo on remove .aspx extension from url in asp.net, its a great articale, but i have few queries which i would like to ask.

How we can use same approcah when we are passing multiple values in a query string like:

"www.localhost/Category.aspx?Id=1&Name=abc"

In example shown that we need to write below code in global file like :

 routes.MapPageRoute("CustomerDetails", "Customers/{CustomerId}", "~/CustomerDetails.aspx");

but what about in above case?

View 1 Replies

MVC :: Routing Is Correct, But Parameters Don't Reach The Action Method.

Jul 1, 2010

I've been struggling for some time now with an MVC routing issue, but I have finally reached a point where the basic routing is correct; that is, the application is invoking the correct action method and .aspx page, but the action method fails because no parameters are passed to it.

Before I show detailed screenshots of the problem, I had better provide some background. This is a bibliographic application which, among other things, analyzes text abstracts to identify unique words and the number of occurrences for each word in each document. This data will eventually be inserted into a SQL Server database, but for the time being I only want to do the calculation and display the results, on a document-by-document basis, in an .ASPX view set up for the purpose. The data structure of the application is as follows:

Collections -this is a set of fifty or so CollectionDetails items.CollectionDetails represent individual documents, in this case books in an academic library. Attributes of the CollectionDetail record are those typical of a library book--author, call number, title, year, and so on. The title and subject catalog headings are combined to form a quasi-abstract, which becomes the basis of the text analysis. In a few cases, I added additional text from Google Books or Amazon synopses and reviews.

MasterStopList contains common words such as pronouns and prepositions that we want to exclude from consideration.

View 8 Replies

State Management :: Caching The User Control Data Based On Multiple Parameters?

Feb 10, 2011

i have a usercontrol called navigationmenu whose data is static but varies with loged in1.empID 2.empType 3 Country my question is how can i cache the data of usercontrol based upon combination of these 3 parameters

View 9 Replies

Asp - User Controls VaryByParam?

Sep 23, 2010

Does VaryByParam also take into account the control properties and the logged in user? Let's say, I have a custom property: will VaryByParam cache based on unique values to that property?

Update:

I've added the <%@ OutputCache Duration="500" VaryByParam="*" %> to my user control. In the page the control is embedded in, I have this code:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
MyControl1.MyId = Convert.ToInt32(DropDownList1.SelectedValue);
}

I am getting sporadic null values for MyControl1 since I added the caching. Not quite determined why this is the case, yet. My additional question is why am I getting these null reference exceptions? It seems to only occur when I've added the caching code to the user control.

View 1 Replies

State Management :: Partial Page Caching (user Control Caching) And Button Events?

Jun 14, 2010

I have a page with a number of user controls, In one of my user controls I have a button event. I turn on output cache for the user control that has the button and vary by control using the ID property of a hidden field control in the user control. whenever I turn on the output cache my button event doesn't fire.

View 2 Replies

WCF / ASMX :: Implement Caching Using System.Web.Caching?

May 15, 2010

how to implement caching in wcf service using System.Web.Caching

View 2 Replies

Web Forms :: Web.Routing Doesn't Work On Server On IIS Routing

Jul 20, 2010

I tried everything I could find, but still does not work on IIS routing.

View 2 Replies

Routing With Web Forms - Could Not Load System.Web.Routing

Dec 12, 2010

I am using:

ASP.NET 3.5 SP1 with Web Forms Routing thru Global.asax (System.Web.Routing and RegisterRoutes)IIS 7

Everything is working fine in my local machine, but it gives the following error in my hosting environment:

Could not load file or assembly 'System.Web.Routing, Version=3.5.0.0, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I did everything inside my web.config file mentioned in the following link:

[URL]

But I am still getting the above error.

What else am I supposed to do fix the error?

View 1 Replies

Rest WCF Url Routing & Web Forms Routing?

Feb 22, 2011

I have a Web application where i have added a reference to a RESTful WCF. I got the WCF url Routing to work in my webapplication by adding Inherits="RestService.Global" to the Web applications Global.asax.

<%@ Application Codebehind="Global.asax.cs" Inherits="RestService.Global" Language="C#" %>

But then i tried to create url Routing for the Web application and it does not work with the Inherits="RestService.Global" in the Global.asax. If i take it away it works fine. Is there a correct way to do this.

View 1 Replies

Web Forms :: URL Routing And Dynamic Routing?

Jan 31, 2011

I'm trying to create my own CMS and I've gotten a little bit stuck at the stage of URL routing.

I want clean URLs without extensions and I'd like to be able to create and modify them in a web based interface without any messing around with IIS or actual files.

I've seen how to create a static route, but for that I need to go into my Global.asax file and manually add it.I would like to have all of these routes stored in a database so that I can easily modify them later.

Does anyone know how this can be achieved?

Just for extra information, I will be attempting to create a feature so that if a path exists, but is later changed, a 301 redirect is created to the new URL, is this also possible? (My first problem is the main issue, but thought I might ask this as well just in case it makes a difference)

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved