473,729 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.asp x
and CategoryView.as px? 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.fvProductCat egory
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 1910
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.Visi ble = 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.asp x
and CategoryView.as px? 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.fvProductCat egory
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.Visi ble = 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.asp x
and CategoryView.as px? 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.fvProductCat egory
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
2419
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 approach it takes, but I cant see how it would be beneficial. Could someone tell me what it the point of seperating content from presentation, surely content is stored in the database?? Also, are there such things as forms in XML, or what is the...
0
1358
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 items dynamically added}) All the code works #1 when only the MdiParent form is used, as soon as i open an MdiChild in it, right after the popup event returns, i get this error: ...
2
1695
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 buttons. I need one of the buttons to simply be a back button. I have this button working fine. I need the second and fourth buttons to point to the current CGI script, but I need the third button to point to a different CGI script. I need the...
0
1636
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) { editMoreMenu.MenuItems.Add("New MI " + count); count++; } and get "An unhandled exception of type 'System.NullReferenceException'
5
2024
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 context menus on one form. I had tried to declare two MainMenu items and then simply switch the display accordingly. eg. public void displayPanel1(){ this.Menu = this.mainMenu1; // this.Refresh(); } public void displayPanel2(){ this.Menu =...
18
6877
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 all good as this session variable is used to retrieve data for that user etc. However if I restart the webserver then the users session is lost but the ticket is still active. Therefore the user is not redirected back to the login page.
2
1297
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 exception: CType will not convert a string to a MenuItem. (Line 3) Dim MyShortCut As Integer = 13122 '13122 is integer for Ctrl2 Dim MyMenuItem As String = "MenuItem12" Dim oMnu As Windows.Forms.MenuItem = CType(MyMenuItem,...
5
5130
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# application to authenticate using the same mechanism as the intranet app. Therefore...if I try to login to the c# app, it should redirect me to the intranet login. Once I pass authentication, I should be able to access the c# app. Now. Here is...
3
1385
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 programmatically add more menuitems to the Recently Used Files menuitem they show ok However, if I clear the Recently Used Files menuitem collection and then add more menuitems they do not display. What is weird is that even though they do not display the...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.