471,595 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

MenuItems point to two different forms, what is best approach

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

Jan 16 '07 #1
2 1802
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.

kbutterly wrote:
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
Jan 17 '07 #2
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

bpd wrote:
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.

kbutterly wrote:
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
Jan 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Colum | last post: by
reply views Thread by Deutsche Dogge | last post: by
5 posts views Thread by Davie | last post: by
18 posts views Thread by Rippo | last post: by
3 posts views Thread by active | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.