S
smay
I'm trying to raise the click event of a button from my Page_Load event so
that after the Page_Load completes the myBtn_Click event is fired, just as if
a user had clicked the button. I can't just call myBtn_Click, page_load must
complete first just as it would if a user had clicked. I keep getting an
error telling me to set the page's EnableEventValidation to false, but I
don't want to do that. For testing, I did set it to false and used
"DirectCast(myBtn, IPostBackEventHandler).RaisePostBackEvent(Nothing)" to
raise the click event, but myBtn_Click was called immediately, not after
Page_Load.
Can anyone help with a specific VB example?
that after the Page_Load completes the myBtn_Click event is fired, just as if
a user had clicked the button. I can't just call myBtn_Click, page_load must
complete first just as it would if a user had clicked. I keep getting an
error telling me to set the page's EnableEventValidation to false, but I
don't want to do that. For testing, I did set it to false and used
"DirectCast(myBtn, IPostBackEventHandler).RaisePostBackEvent(Nothing)" to
raise the click event, but myBtn_Click was called immediately, not after
Page_Load.
Can anyone help with a specific VB example?