By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,480 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,480 IT Pros & Developers. It's quick & easy.

MenuItems point to two different forms, what is best approach

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.