MenuItems point to two different forms, what is best approach

K

kbutterly

All,

I have a menu which contains Category as the master and Product as the
child.

When I click on a Category in the menu, I want one formView control,
fvpc, to show, and then when I click on a Product, I want a different
formview, fvp, to show.

Is it best to have the two forms on separate pages, productView.aspx
and CategoryView.aspx? The reason I ask is that I have a problem with
my current page design and that usually means I am going about
something incorrectly.

I currently have everything, the menu and the two formview controls, on
one page. The problem is when I click a product, its form shows, but
when I click a category after picking a product, the product form still
is on the screen along with the category form.

This is the code I have for MenuItemClick

Dim fvpc As FormView = Me.fvProductCategory
Dim fvp As FormView = Me.fvProduct
If e.Item.Depth = 0 Then
fvpc.DataBind()
ElseIf e.Item.Depth = 1 Then
fvp.DataBind()
End If

So I guess my question is twofold. Is doing all this on one page best
practice? If so, how do I 'unbind' one formview control?

Thanks,
Kathryn
 
B

bpd

Best pratice is always hard to define, in my opinion. I am always
looking for best practice in alot of different .Net areas, but find
there a are several ways to accomplish a task and the best practice is
"what works best for you."

With that said, in your scenario, I would probably break into two
separate pages. But, I don't know all of the requirements and how the
two pages are related.

If you want to keep in the same page, you can put Products in a panel
and Categories in a panel and show/hide (PanelName.Visible = true or
false) as needed.
 
K

kbutterly

bryan,

thanks for the reply. I ended up splitting them into two pages. Keeps
the code 'cleaner' (easier for another programmer to follow)

thanks again,
kathryn
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top