473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 1886
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Colum | last post by:
Hi, I am a complete newcommer to XML. I am planning to build a website with html, interacting with an Oracle db through Jsp. I want to use Xml, mainly because Ive heard about the kind of OO...
0
by: Deutsche Dogge | last post by:
Hi. I'M having a weird problem with addign menuitems to a menu dynamically on the popup event of the menuitem containing the container of the menuitems i wanna add (tools -> external -> {list of...
2
by: JR | last post by:
Hi. I have a CGI script that will need to call itself an unknown number of times, to add rows, run queries, etc. At the bottom of the output that is produced by the script, there are four...
0
by: Brian | last post by:
Create a simple MDI form and a child form, and try the following simple code to add a new menu item on the Edit menu popup: private void editMenu_Popup(object sender, System.EventArgs e) {...
5
by: Davie | last post by:
I'm developing an application on the smartphone. To reduce the size of the application i'm using panels where appropriate instead of forms. As a result of the design, I need to have different...
18
by: Rippo | last post by:
Hi I am using role base forms authentication in asp.net and have come across a problem that I would like advice on. On a successful login a session variable is set to identify a user. This is...
2
by: genojoe | last post by:
I have a table (about 50 rows that populate the variables shown below in lines 1 and 2) of shortcuts that I would like to read into a Windows Form. The following code would work with one big...
5
by: djhexx | last post by:
Hi. We have an asp.net intranet application written in VB that uses forms authentication for all it's pages. I have a C# asp.net application that I just wrote. The company would like the C#...
3
by: active | last post by:
I have a mainmenu menuitem that contains a Recently Used Files menuitem If at design time I include a menuitem in the Recently Used Files menuitem collection it will display OK If I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.