Can web forms communicate with one another directly?

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
D

Dean Slindee

Can one webform reference another webform in the same project? I would like
WebformB to tell WebformA to change the selected tab on a tabcontrol sited
on WebformA.

If not possible, please, just reply it's not possible.
Example: Call WebformA.TabShow("pagBoard"), the
reference to WebformA is not resolved. Thanks, Dean S


Partial Public Class WebformA

Inherits System.Web.UI.Page

'function in WebformA:

Public Sub TabShow(ByVal strTabName As String)

Select Case strTabName

Case "pagSearch"

tab.SelectedTab =
tab.Tabs.IndexOf(tab.Tabs.FromKey("pagSearch"))

Case "pagBoard"

tab.SelectedTab =
tab.Tabs.IndexOf(tab.Tabs.FromKey("pagBoard"))

Case Else

'error message

End Select

End Sub

End Class



Partial Class WebformB

Inherits System.Web.UI.Page

Call WebformA.TabShow("pagBoard")

End Class
 
Um... no... if your WebFormB had a static property for the selected tab
index, you could use that, but your pages aren't always there... they
get instantiated and ripped down again when a user requests them, and
besides if you did it that way, all your users would have the same
selected tab, and I assume that's not what you wanted.

If you want to pass user-specific information between pages,
QueryString and Session State are your friends.
 
Back
Top