yasser777 / nettiers

Automatically exported from code.google.com/p/nettiers
0 stars 0 forks source link

netTiers doesn't support RouteParameters in auto-generated admin website #324

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Generate NetTiers admin website
2. Set up url routing (eg, as you normally would when working with other .NET 
4.0/web forms projects, including defining routes in Global.asax)
3. Change type of datasource parameter from QueryStringParameter to 
RouteParameter in admin page

What is the expected output? What do you see instead?

I expected that a properly formed route url (eg, "user/edit/1") would prompt 
the multiformview to display the appropriate record in EditMode.  Instead, no 
records are displayed.  

Instead, routing can be made to work by taking the following 2 steps:

1. Converting the multiformview to a formview with the necessary 
item/insert/edit templates
2. Removing/adapting the method beginning with FormUtil.SetDefaultMode... in 
the code-behind

What version of .netTiers and CodeSmith are you using?

.netTiers 2.3.0 & CodeSmith 5.2.2

Please provide any additional information below.

Ideally, (but perhaps only justified if enough people are wanting to use 
routing in their projects), it would be nice to have an option within NetTiers 
to automatically-generate routes based on the db schema for the admin website.  
I'd imagine this would be a low priority though, since naming a given route is 
a matter of personal preference.  It would save an hour or two in development 
time though.

Original issue reported on code.google.com by shaungei...@gmail.com on 4 Aug 2010 at 2:32

GoogleCodeExporter commented 9 years ago
http://community.codesmithtools.com/nettiers/f/16/p/11213/42752.aspx#42752

A bit more background on this problem.  In the code behind:

FormUtil.SetDefaultMode(FormView1, "OfficeId");

must be removed (or the method adapted) in order for things to work with url 
routing.  This was the problem that prevented me from seeing a record in the 
first place, and why I had to have a querystring even with routing enabled.

Original comment by bniemyjski on 4 Aug 2010 at 3:43