The Page_Load will always fire, so that has to be taken out of the equation.
If the Click event is not firing, see if the "Handles XXX.Change" (or
whatever) is missing. Sometimes the events get out of sync. To resync, you
can either type this in or you can reset the event up (normally double
clicking on the control in question).
I still have not found the unique circumstances that cause this to happen,
but the VS IDE messes up event handlers from time to time.
If that is not it, post a follow up.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************
Think Outside the Box!
************************************************
"Ryan Ternier" <> wrote in message
news:%...
> Yes, I have that implemented right now, but it still seems to want to
reload
> the page on that button click, without fireing the click event.
>
> This is how I currently have it:
>
> If Not IsPostBack Then
> 'On the first load
> Page.RegisterStartupScript("MyScriptKey",
> "<script>parent.frames.IFrameAdvance.resizeTo
> (760,500);</script>")
> ....more l33t code.
> Else
> Dim test As String
> test = "WHY ARE YOU GOING HERE J00 m34n c0mp1l3r"
> End If
>
> I really do nothing in the else, but always have a breakpoint set there
> incase it hits it, so I can keep track on what
> .NET is doing for performance reasons.
>
> I'll see if I can work something out like a reload or refresh of the page
> and see if that can stop the first click fiasco.
>
> /RT
>
>
> "Cowboy (Gregory A. Beamer) [MVP]" <>
wrote
> in message news:...
> > That is normal behavior, as Page_Load is called when the page is loaded,
> > prior to checking why the page is being loaded. It is the reason most
> coders
> > have:
> >
> > If (Page.IsPostBack = False) Then
> > 'run load code
> > Else
> > 'run postback code
> > 'I hate this part of the IF myself, at least as I most
> > 'commonly see it implemented
> > End If
> >
> >
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >
> > ************************************************
> > Think Outside the Box!
> > ************************************************
> > "Ryan Ternier" <> wrote in message
> > news:...
> > > I have a button event:
> > >
> > >
> > > Public Sub SwitchItem(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs)
> > > Dim btnTest As New Button
> > > Dim astrTest As String()
> > > btnTest = CType(sender, Button)
> > > astrTest = btnTest.ClientID.Split("_")
> > > strControlsToEdit = astrTest(2)
> > > 'Find out what button was pressed, then pass the flags to the
> > > TraverseControls method.
> > > If btnTest.Text.ToLower = "allow" Then
> > > TraverseControls(Page, False, True)
> > > ElseIf btnTest.Text.ToLower = "disallow" Then
> > > TraverseControls(Page, False, False)
> > > End If
> > > End Sub
> > >
> > >
> >
> >
>
>
|