S
Scott
Hello, I am fairly new to programming. I am trying to get a menu
system to display a blank page for me. The menu manufacturer says I
need to implement the following code and that it may require some
changes for it to work....well I can't get it to work and am looking
for some help as I desparately need to get this working.
It bombs on the first line as the BaseMenu1.DataItem is of type
System.Data.DataRowView all the menu developer will tell me is that I
need to change the IDataRecord to something else...I am getting a
'specified cast is not valid'...
BaseMenu1's datasource is a dataset and I am told by the menu
developer that I have to use the .DataItem method to get at the data I
need to do the comparison against...
The code below runs when I bind the menu to the datasource (dataset).
public void BaseMenu1_ItemDataBound( object sender,
NavigationItemEventArgs e) { IDataRecord record =
(IDataRecord)BaseMenu1.DataItem; if
((bool)record["new_target_window"])
e.NavigationItem.TargetWindow = "_blank"; }
I have set up a new event handler as follows.
this.BaseMenu1.ItemDataBound += new
EO.Web.NavigationItemEventHandler(this.BaseMenu1_ItemDataBound);
I am using .Net 1.1 and ASP.net. Any help would be greatly
appreciated.
system to display a blank page for me. The menu manufacturer says I
need to implement the following code and that it may require some
changes for it to work....well I can't get it to work and am looking
for some help as I desparately need to get this working.
It bombs on the first line as the BaseMenu1.DataItem is of type
System.Data.DataRowView all the menu developer will tell me is that I
need to change the IDataRecord to something else...I am getting a
'specified cast is not valid'...
BaseMenu1's datasource is a dataset and I am told by the menu
developer that I have to use the .DataItem method to get at the data I
need to do the comparison against...
The code below runs when I bind the menu to the datasource (dataset).
public void BaseMenu1_ItemDataBound( object sender,
NavigationItemEventArgs e) { IDataRecord record =
(IDataRecord)BaseMenu1.DataItem; if
((bool)record["new_target_window"])
e.NavigationItem.TargetWindow = "_blank"; }
I have set up a new event handler as follows.
this.BaseMenu1.ItemDataBound += new
EO.Web.NavigationItemEventHandler(this.BaseMenu1_ItemDataBound);
I am using .Net 1.1 and ASP.net. Any help would be greatly
appreciated.