URL Routing With Category Variable?

Mar 16, 2011

I just learned routing and basic routing works, like /topics/people but I am not having any luck implementing like topics/people/{id} or any other variable. It just won't show.

So how do I go and fill that id from a listbox? I googled and people did it without even doing any coding, or did they skip that step? my listbox is in my master page and content pages will use that listbox value in their url too. And then later on I'll add username and stuff too. so for now I just want to know how to set that variable to my listbox. This is what I have for testing:

void RegisterRoutes(RouteCollection routes)

[Code].....

View 7 Replies


Similar Messages:

MVC :: Create Routing - Products/Category/Electronics?

Jul 27, 2010

i have a product page that can potentially take in the following optional query string params:

Category, OrderBy, Page

How do I create my route so the urls show up like this:

Products/Category/Electronics

Products/Category/Electronics/OrderBy/Price

Products/Category/Electronics/OrderBy/Price/Page/1

basically, im trying to not use the ? for my query string params.

View 1 Replies

ADO.NET :: Entity Framework 3.5 / Select Category From Dropdownlist Bind Gridview To All Products Related To This Category?

Nov 5, 2010

i create example using Northwind database so i create a new website and add new ADO.Net Entity Data Model (.edmx) called Northwind.edmx and i add Categories and Products table inside this (.edmx) file

and add new ADO.Net Data Servuce called "ADODataService" and add it as WebReferences called NorthwindService

so i add new web page and drag DropdownList and Gridview as i want to bind Dropdownlist to all categories and when i select category from Dropdownlist bind Gridview to all Products related to this category

so my code

[Code]....

and my code
[Code]....

so when i select category from Dropdownlist nothing happen :(

also you will find commented code in method BindCategory whuch is not work also.

View 1 Replies

Get An Error A String (selected Category In The Ddl) Cannot Be Converted To A Category Object?

Feb 7, 2010

I'll try to explain as simple as I can in text what my problem is. I don't see any other way to make my issue clear.

I have a GridView that uses an ObjectDataSource.

The ObjectDataSource has an DataObjectTypeName defined, so I pass/get complete objects or list of objects to/from the data access methods.

The objects I'm working with, let's say we work with Book objects, contain a Title and a Category, BUT the Category is an object itself. When the Select method is called, we get a List of Book objects, which is perfectly displayed, overridden ToString method in the Category objects within the Book objects.

The problem I face is that I can't find a way to update the category in my GridView. What I did already accomplish is:I used a template field in the GridView for the Category so I could use a DropDownList for that field in Edit mode.

I bound the DropDownList to another ObjectDataSource that gives me a list of CategoryObjects.

So when I enter Edit mode... the row shows a nice ddl with the available categories. It even selects the right original category.

So far so good... but when I want to save my new selection, I get an error that a string (the selected category in the ddl) cannot be converted to a Category object (that's what the Book object, that is going to be used for the update, expects).

View 5 Replies

Forms Data Controls :: How To Display Category Name Without Category Id

Mar 30, 2011

I am working in a project that is a musical website. I want to display the web page with all categories I have. In my database , named Category_Master, I have two fields like Category_Id (which is a primary key ) and Category_Name. I have generated category_Id with NEWID() function. The category_Id is not supposed to display on the web page. But, i have to select Category_Name and according to that , I have to get the category_Id. If I am using Static connection with SqlDataSource, i am able to make visible=false property so that the category_id won't be visible. But , at that time, I can't write code to Select the category_id of the selected index.

If i am using disconnected approach, I filled the dataset with the Category_Master, and binded it to GridView. But, at that time, I can't hide the category_id from the user. I want to select category_id by clicking on the category_name with out displaying category_id ..?

View 4 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

Handle MVC Routing Along With Webform Routing

Sep 2, 2010

How to handle asp.net mvc routing along with asp.net webform routing. I have merged my mvc app into my existing web application. In my web application i have implement routing as below:

routes.Add("View Product Details", new Route("Product/{City}/{Manufacturer}/{Name}/{ProductID}/{*ProductType}"));

Similarly i have implemented routing in mvc as below

routes.MapRoute("Product Details",
"Product/{City}/{Manufacturer}/{Name}/{ProductID}/{ProductType}",
new
{
controller = "Home",
action = "ProductDetails",
City= UrlParameter.Optional,
Manufacturer= UrlParameter.Optional,
Name= UrlParameter.Optional,
ProductID= UrlParameter.Optional,
ProductType= UrlParameter.Optional
});

How to handle both pages, as one is custom web form while other is asp.net mvc view?

View 1 Replies

MVC :: How To Permanently Redirect Url From Old Routing Rule To New Routing Rule

Nov 30, 2010

Response.RedirectPermanent(Url); can redirect permanently to a url.

However, during my SEO process, I decided to change my routhing rule.

For example,

I change "/tag/{tag}-quotes" routing rule to "quoes-about/{tag}", but I don't want to lose all the traffic to old routing url.

What is the best way to handle this permanent redirection?

View 4 Replies

MVC :: How To Display Category Name Instead Of CategoryID

Sep 18, 2010

I have class Item & Category

[Code]....

How can I display Category Name? Do I have to add CategoryName into Item class and bind it on aspx page or is there something similar to Html.DropDownList?

[Code]....

View 2 Replies

Web Forms :: How To Filter A Category

Jan 11, 2011

we are currently running a website in which the home page has recent tab section which contains list of category list i need to block a category.

View 1 Replies

MVC :: How To Add Product To Category (Many-to-many Relation)

Feb 16, 2011

I'm trying to add a product to one or more categories, but I'm going nowhere slow.

Table layout:

[Code]....

[Code]....

[Code]....

I been trying everything to add a product to a category, but without luck. I would have though this was the "right" way:

[Code]....

On my "Create" product page, the product is created but I just can't find a way to link a product to one or more categories. It just skips back to the Create page, even though I have put a Redirect in the Controller.

View 12 Replies

How To Change Order In Category

Jun 17, 2010

I am buiding web application about news.My problem i need to change order of articles in that category.
Example :

+ Article A ----> position 1
+ Article B ----> position 2
+ Article C ----> position 3
+ Article D ----> position 4
+ Article E ----> position 5
+ Article F ----> position 6

All articles A -> F are inside category. Sometime i want to Article E is position 1, or article C in position 6 ...and so on Now i can't imagine what i have to do ?

View 9 Replies

Access :: How To Show Category And Forum

Aug 25, 2010

I would like to make script that show category and all its forum that 's why I have created table 'cat' ( id , CAT_TITLE )( table for category) and an other table for forum name ' s 'forum' ( id , name,CAT_ID)

my question how I can show category and the forum by using repeater or another control like http://forums.asp.net/

View 2 Replies

ADO.NET :: Retrieve Records In Category - Basic SQL Way?

Sep 9, 2010

I have the following code that retrieves a bunch of records in a category, but I need it to retrieve them in a basic SQL way with a WHERE and ORDER BY.

var people = FnesseFitness.Categories.Include("People").Single(g => g.CategoryName == category

View 4 Replies

C# - How To Implement A Category Hierarchy Using Collections

Apr 14, 2010

I have about 200 categories that are nested. I am currently reading the documention on the C5 generics library. I am not sure if the C5 library is overkill or not. I am looking at converting all my custom algorithms to the C5 implemention.

This is what I need. If a certain category is chosen i need to find its parents, siblings, direct children, and all children.

This is the way I have it set up. To find the:

Parents: I start from the current location then loop through the list and find the current parent. When I find the parent I loop through the whole list again to find the next parent and so on.

Siblings: I loop through the whole list and find all the nodes that have the same parent as the choosen node.

direct children: I loop through the whole list and find all nodes that is a parent of the choosen node.

All Children: This one took me a while to figure out. But I used recursion to find all children of the choosen node.

View 1 Replies

Web Forms :: Databind CheckboxList By Category?

Jun 3, 2010

I'm databinding the checkbox list to a db table which has a category assigned for multiple records. I can list the checkbox but I can't sort them by category using the checkbox list control. Can somebody post an example on how to achieve this? Category 1chk Record 1 chk Record 2 chk Record 3Category 2chk record 4 chk record 5 Etc

View 3 Replies

C# - Order A List / No Other Fields Associated With A Category?

Oct 26, 2010

I have a function in sitefinity that returns a list of categories.

//return list of categories
private IList<ICategory> GetCategoryDataSource() {
var cntManager = new ContentManager(CaseStudyManager.DefaultContentProvider);
IList allCategories = cntManager.GetCategories();
List<ICategory> filteredList = new List<ICategory>();
foreach (ICategory category in allCategories) {
filteredList.Add(category);
}
return filteredList;
}

What I want to know is how to sort this list.

Categories in Sitefinity are as far as i can tell just a string, there are no other fields associated with a category. Therefore I have nothing to sort the categories on, other than appending each category with a number, like:

1 - Legal
2 - Financial
3 - Property

When these categories are displayed on the website I can then at least trim the parts i need.

View 2 Replies

Autodetect The Category Depending On ReferenceMappingExpression?

Sep 14, 2010

I have following entities: Every time i update or insert a transaction i would like to autodetect the category depending on ReferenceMappingExpression or DescriptionMapppingExpression in CategoryMappings Entity. I mean i want to match Transaction.Description to CategoryMappings.DescriptionMapping and if it matches get the FkCategoryID from CategoryMapping and save the transactions. It is possible to loop throug every transaction in list and categorymapping list but i dont think its good idea.

View 1 Replies

Web Forms :: Image Gallery By Category?

Jan 25, 2013

I want to make Image Gallery for products By Category

for example clothes, books,...

I want doing it with the two links

Image-Gallery-using-ASP.Net-DataList-Control-Part-I
Image-Gallery-using-ASP.Net-DataList-Control-Part-II

without Category it works fine

but I changed this line 

FROM tbl_product ) AS tbl WHERE Row >= '
to
FROM tbl_product ) AS tbl WHERE cat_id=@cat_id Row >= '
andI added

[Code]....

and now I face this messageProcedure or function spx_Pager has too many arguments specified.

View 1 Replies

Web Forms :: Put 4 Category On Axis X Of LineChart

May 7, 2015

I would like to put 4 categories (fixed) on my chart (example: 1,2,3,4 quarter on the x-axis) and display data from the database in the right category.

// AVG correspond à moyenne et on multiplie par 100 puisque à la base la colonne est de type Decimal
string query = string.Format("select Entite, AVG(AvancementQuantitatifT1 * 100) FROM reponse WHERE ObjectifStrategique = '{0}' GROUP BY Entite", Objectif_strategique.SelectedItem.Value);

[Code]..... 

For example I want to do something like that :

select Progressquarter1, Progressquarter2,Progressquarter3, Progressquarter4 and put respectively in quarter 1 quarter 2 quarter 3 and quarter 4.

View 1 Replies

JQuery :: Grab A Global Variable Or Session Or View State Variable In The Javascript?

Dec 9, 2010

can we grab a global variable or Session or View State variable in the javascript or using jquery?

View 2 Replies

State Management :: Public Variable Vs Session Variable To Store Logged In UserID

May 17, 2010

I have a web application which uses a session variable to store the logged in userid. If no user is logged in, of course this variable will be empty and the contents displayed on my website are meant for guests. If there is a user logged in, the user specific controls/access/links will then be a displayed.

I am now having issues with my hosting where on shared application pool, the worker recycle is triggered every 90 minutes, this will clear sessions causing all my users to be logged out. I opted for a dedicated application pool, which got worse because I am only allocated 50MB memory limit and if this is reached, the worker recycle is triggered and I lose my sessions again. I have tried as much as possible optimization techniques, e.g. dispose where possible, close connections, disable viewstate for static controls etc but my memory per instance keeps building up from page to page without any signs of improvement. I don't use loops nor store huge objects like bitmaps etc but my sessions are now gone even faster than 90 minutes in shared application pool before.

I have considered using SQL Session State but there isn't a simple guide on using this with MySQL. I am getting desperate and considering using a public variable, a string as a replacement to store logged in user id instead of in a session variable. I am pretty sure this will solve my issue with sessions being recycled but are there any negative consequences of doing this? One problem I can think of is if the user closes the browser, the system will never know that the user is now logged out and this public variable should be nothing. In this scenario, will the GC eventually clear this abandoned public variable.

View 10 Replies







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