Formview control

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
 
M

Mark Rae

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...?
 
M

Mark Rae

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...
 
D

dalholm

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
 
M

Mark Rae

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... :)
 
D

dalholm

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
 
D

dalholm

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FormView 3
FormView 0
Get Data value in FormView 5
Gridview and Formview Integration 1
FormView out of sync 3
adding a table to formview 3
GridView and FormView 1
user control in formview 0

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top