Formview control

  • Thread starter Thread starter dalholm
  • Start date Start date
D

dalholm

Hi, I'm just starting to poke around with asp.net, and have stumbled on
this problem:

I'm converting an old MS Access database to a web solution. I have
created individual user controls for each table, and added these to my
webpage. Now the master table "cars" has a usercontrol consisting
primarily of a formview and a accessdatasource. A car can be of a type
(bus, sportscar, etc.), data on the type is stored in the "carType"
usercontrol, which has also been added to the page.
Using me.session variables I the "carType" usercontrol is updated
whenever a new car is selected. However, and this is my problem: when I
on the "cars" usercontrol -> formview select "NEW" then I can't figure
out how to get then "carType" usercontrol to update, it still shows the
info for the previously selected car! On the "car" usercontrol ->
formview -> InsertTemplate I have added a dropdownlist listing
everthing in the "carType" table. But I can't trigger an update of the
"carType" usercontrol based on the value selected in this dropdownlist!

It seems, that whenever i can actually access the value of the
dropdownlist, then the "carType" usercontrol has already been
rendered...

Some guidance will be appreciated..

/Anders
 
I'm converting an old MS Access database to a web solution. I have
created individual user controls for each table,

Any particular reason for having an individual user control for each
table...?
 
lol... My initial reason was to keep it simple :D

But, by contrast, it sounds like all you've done is over-complicate it...

WebForms isn't like WinForms at all...
 
Maybe, this is also a learning process...

I think I have solved it if only I can fire a postback event on
fromview modechanged, any ideas

/Anders
 
Maybe, this is also a learning process...

Sure, and don't take this the wrong way, but have you considered getting one
of the ASP.NET beginner's guide books and working your way through it...?
This is really good:
http://www.amazon.com/ASP-NET-Every...ef=sr_1_3/102-6908414-1018537?ie=UTF8&s=books

Nobody is born knowing this stuff, but it makes things so much easier if you
have a good basic grounding. If you get yourself into bad habits and
practices from the beginning, it can be really difficult to unlearn them...

As a jobbing contractor, I'm often called in to fix stuff, and I've seen
some horror stories in my time, though I must confess I've never seen an
ASP.NET app which has an individual UserControl for every table... :-)
 
Mark said:
fromview modechanged ???

modechanged doesn't work since it gets fired before the controls have
acutally been instantiated/loaded, if only...

I actually like the idea of the many usercontrols, since some of them
could potentially be used on other pages. And they are all pretty
selfcontained, only depending on the availability of a session
variable..

/anders
 
It would actually seem that my only problem is making the session
variable available ahead of time...
 
Back
Top