S
Simon Harris
Hi All,
I am trying to call a method in a web form, from an event fired in a user
control. My user control displays a map, which has a link button to
enlarge/shrink the map. When the user enlarges the map, I want to hide my
navigation table etc, maximising the viewing area. I've been working on this
for 5 hours now, so far I have as detailed below - Which rund with out
error, but the final function never gets called. Any help/suggestions would
be appreciated.
Heres how far I have got:
==================
1) My user control is called map_display.ascx. This contains a link button,
onclick does the following, which is in map_display.ascx.vb:
Private Sub lbEnlarge_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles lbEnlarge.Click
Dim evt As New EventArgs
Call MyEnlarge(e)
If Me.lbEnlarge.Text = "Shrink" Then
ChangeMapSize(pInitialMapSize)
Me.lbEnlarge.Text = "Enlarge"
Else
ChangeMapSize("700x350")
Me.lbEnlarge.Text = "Shrink"
End If
End Sub
2) 'MyEnlarge' is also within map_display.ascx.vb:
(Note public delegate and event lines, which I also added)
Public Delegate Sub EnlargeButtonHandler(ByVal sender As Object, ByVal e As
EventArgs)
Public Event EnlargeButton As EnlargeButtonHandler
Protected Sub MyEnlarge(ByVal e As EventArgs)
RaiseEvent EnlargeButton(Me, e)
End Sub
3) In my containing aspx page (Called map_and_property_info.aspx), the user
control is included like this:
<uc1:map_display id="Map_display1" runat="server"
onMyEnlarge="ToggleTblNavandInfo"></uc1:map_display>
The plan was to 'catch' the original event of the user clicking the link
button in the user control, then fire a function in the ASPX code behind -
Probably not relevent, but heres the function I wanted to eventually call.
Public Sub ToggleTblNavandInfo()
If Me.TblNavandInfo.Visible = False Then
Me.TblNavandInfo.Visible = True
Else
Me.TblNavandInfo.Visible = False
End If
End Sub
I am trying to call a method in a web form, from an event fired in a user
control. My user control displays a map, which has a link button to
enlarge/shrink the map. When the user enlarges the map, I want to hide my
navigation table etc, maximising the viewing area. I've been working on this
for 5 hours now, so far I have as detailed below - Which rund with out
error, but the final function never gets called. Any help/suggestions would
be appreciated.
Heres how far I have got:
==================
1) My user control is called map_display.ascx. This contains a link button,
onclick does the following, which is in map_display.ascx.vb:
Private Sub lbEnlarge_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles lbEnlarge.Click
Dim evt As New EventArgs
Call MyEnlarge(e)
If Me.lbEnlarge.Text = "Shrink" Then
ChangeMapSize(pInitialMapSize)
Me.lbEnlarge.Text = "Enlarge"
Else
ChangeMapSize("700x350")
Me.lbEnlarge.Text = "Shrink"
End If
End Sub
2) 'MyEnlarge' is also within map_display.ascx.vb:
(Note public delegate and event lines, which I also added)
Public Delegate Sub EnlargeButtonHandler(ByVal sender As Object, ByVal e As
EventArgs)
Public Event EnlargeButton As EnlargeButtonHandler
Protected Sub MyEnlarge(ByVal e As EventArgs)
RaiseEvent EnlargeButton(Me, e)
End Sub
3) In my containing aspx page (Called map_and_property_info.aspx), the user
control is included like this:
<uc1:map_display id="Map_display1" runat="server"
onMyEnlarge="ToggleTblNavandInfo"></uc1:map_display>
The plan was to 'catch' the original event of the user clicking the link
button in the user control, then fire a function in the ASPX code behind -
Probably not relevent, but heres the function I wanted to eventually call.
Public Sub ToggleTblNavandInfo()
If Me.TblNavandInfo.Visible = False Then
Me.TblNavandInfo.Visible = True
Else
Me.TblNavandInfo.Visible = False
End If
End Sub