B
Bill Cohagan
I'm a Windows Forms developer, but am trying to get a grip on how things are
done in a web UI (using ASP.Net). So, in a Windows Forms app, I might have a
dialog that displays a listbox populated from the Categories table in
Northwind. Next to that I'd have a button for adding a new category. So,
what's the typical way of doing this via a Web Forms UI?
I've got the listbox on the web form and can populate it. I've got the
associated button for adding a new category, but in the associated event
handler what do I do? What (I think) I want to do is open another page that
has the UI for specifying a new Category. I want to open this page
(replacing the original?), then when the user provides the necessary data
and clicks the Save button I want to save the new record to the database,
then go back to the original page, refreshing the listbox content to reflect
the newly added Category.
So far it's not clear to me the best way to open that second page and, given
that I do get there, how do I know to which page to "return" after the new
category is created? I'd like to be able to use this "new category" page
from several different pages so I can't hard wire the URL to return to? Do I
need to save the "return URL" as session state or is there some built in way
to reference the URL to the "previous" page?
This seems to be a basic pattern (and I see lots of possible ways to try),
but thought I'd ask for a little guidance from those who've no doubt done
this a million times.
Thanks in advance,
Bill
done in a web UI (using ASP.Net). So, in a Windows Forms app, I might have a
dialog that displays a listbox populated from the Categories table in
Northwind. Next to that I'd have a button for adding a new category. So,
what's the typical way of doing this via a Web Forms UI?
I've got the listbox on the web form and can populate it. I've got the
associated button for adding a new category, but in the associated event
handler what do I do? What (I think) I want to do is open another page that
has the UI for specifying a new Category. I want to open this page
(replacing the original?), then when the user provides the necessary data
and clicks the Save button I want to save the new record to the database,
then go back to the original page, refreshing the listbox content to reflect
the newly added Category.
So far it's not clear to me the best way to open that second page and, given
that I do get there, how do I know to which page to "return" after the new
category is created? I'd like to be able to use this "new category" page
from several different pages so I can't hard wire the URL to return to? Do I
need to save the "return URL" as session state or is there some built in way
to reference the URL to the "previous" page?
This seems to be a basic pattern (and I see lots of possible ways to try),
but thought I'd ask for a little guidance from those who've no doubt done
this a million times.
Thanks in advance,
Bill