P
poolguard
I have posted this problem a few times before and gotten responses about not
enough information about the Problem so this time I will give a lot of info.
I am having a problem with some Web User Controls in a new web app I am
developing.
Here is the situation:
I have a Base Page (Form.aspx), Form.aspx loads 2 web user controls
Menu.ascx, Warn.ascx that never change and a web user control that is
selected dynamically at runtime and contains the body of the page/form. On
each of the body web user controls I have a bunch of server controls and a
few functions on of the functions is for validating the page Val(). So when
the page gets submitted back the Val() function gets called and if true goes
onto the next part of code.
If Val() = True Then
GoNext("SelectOne")
End If
At that point the code works fine however what I need to do is when an image
button is clicked on the Menu.ascx I need to Fire off Val() in the Body
control. So something like this
Private Sub IbnLogIn_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles IbnLogIn.Click
If Parent.Something.Somthing.Val() = True Then
Parent.Something.Somthing.GoNext(“Marketingâ€)
End Sub
So my problem is I need to fire off a function of one control from another
control.
What I have tried:
I have tried to as s session var to the application that would hold true and
the one parameter for GoNext to run in the Page_Load Event like this
If Session.Item("NeedVal") = True and Val() = True Then
GoNext(Session.Item("GoNext"))
End If
The problem I have with this is I have to load the body web control before I
load the menu.ascx control so by the time the click event for the image
button on the menu.ascx has fired the page_load event on the body control is
long over. If I put the menu control before the body control then the body
state is not retained between postbacks.
Is this possible or am I still confusing everyone by making no sense?
Any ideas.
Thanks
Poolguard
enough information about the Problem so this time I will give a lot of info.
I am having a problem with some Web User Controls in a new web app I am
developing.
Here is the situation:
I have a Base Page (Form.aspx), Form.aspx loads 2 web user controls
Menu.ascx, Warn.ascx that never change and a web user control that is
selected dynamically at runtime and contains the body of the page/form. On
each of the body web user controls I have a bunch of server controls and a
few functions on of the functions is for validating the page Val(). So when
the page gets submitted back the Val() function gets called and if true goes
onto the next part of code.
If Val() = True Then
GoNext("SelectOne")
End If
At that point the code works fine however what I need to do is when an image
button is clicked on the Menu.ascx I need to Fire off Val() in the Body
control. So something like this
Private Sub IbnLogIn_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles IbnLogIn.Click
If Parent.Something.Somthing.Val() = True Then
Parent.Something.Somthing.GoNext(“Marketingâ€)
End Sub
So my problem is I need to fire off a function of one control from another
control.
What I have tried:
I have tried to as s session var to the application that would hold true and
the one parameter for GoNext to run in the Page_Load Event like this
If Session.Item("NeedVal") = True and Val() = True Then
GoNext(Session.Item("GoNext"))
End If
The problem I have with this is I have to load the body web control before I
load the menu.ascx control so by the time the click event for the image
button on the menu.ascx has fired the page_load event on the body control is
long over. If I put the menu control before the body control then the body
state is not retained between postbacks.
Is this possible or am I still confusing everyone by making no sense?
Any ideas.
Thanks
Poolguard