Can web forms communicate with one another directly?

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
 
F

Flinky Wisty Pomm

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top