T
T. J. Fan
I've posted the following problem in this group but got no
answers. It seems to me that no one knows (or cares) why
this is happening. Is this a known VB.Net bug? Help please.
I was trying to call from a web page a routine defined in
another page (to reload that page). More specifically, I
need to be able to reload the first page after user did
something on the second page. Both pages are in frames so
both are visible. I followed the VS samples (Web forms,
pass information between pages) but got an
InvalidCastException. Here is a snapshot of my code:
First Page:
menu.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="menu.aspx.vb"
Inherits="MyProgram.MyProgram.vb.menu.menu"%>
menu.aspx.vb:
.....
Public Class menu
.....
Public Sub Reload()
'Reload the page here, e.g., reset the menu
....
End Sub
.....
End Class
Second Page:
login.aspx:
<%@ Page ... %>
<%@ Reference Page="menu.aspx" %>
login.aspx.vb:
.....
Public fp as menu.menu
.....
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
fp = CType(context.Handler, menu.menu)
End If
End Sub
The exception occurs on the fp = ... statement.
Any help is appreciated.
p.s. I don't understand why VS automatically generates
inherits statements like
this "MyProgram.MyProgam.vb.menu.menu" instead of
just "MyProgram.vb.menu".
..
answers. It seems to me that no one knows (or cares) why
this is happening. Is this a known VB.Net bug? Help please.
I was trying to call from a web page a routine defined in
another page (to reload that page). More specifically, I
need to be able to reload the first page after user did
something on the second page. Both pages are in frames so
both are visible. I followed the VS samples (Web forms,
pass information between pages) but got an
InvalidCastException. Here is a snapshot of my code:
First Page:
menu.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="menu.aspx.vb"
Inherits="MyProgram.MyProgram.vb.menu.menu"%>
menu.aspx.vb:
.....
Public Class menu
.....
Public Sub Reload()
'Reload the page here, e.g., reset the menu
....
End Sub
.....
End Class
Second Page:
login.aspx:
<%@ Page ... %>
<%@ Reference Page="menu.aspx" %>
login.aspx.vb:
.....
Public fp as menu.menu
.....
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
fp = CType(context.Handler, menu.menu)
End If
End Sub
The exception occurs on the fp = ... statement.
Any help is appreciated.
p.s. I don't understand why VS automatically generates
inherits statements like
this "MyProgram.MyProgam.vb.menu.menu" instead of
just "MyProgram.vb.menu".
..