bungpeng Posted May 14, 2004 Posted May 14, 2004 In code-behind Page_Load event, If "IsPostBack = True", Is there anyway I can know the 'Submit' or 'PostBack' process is trigger by which buttons? or if it is trigger by Javascript code like Form1.submit()? How to know? (VB.NET) Quote
Arch4ngel Posted May 14, 2004 Posted May 14, 2004 I don't know think you'll be able to know... since Form1.submit() will do the same as a Submit Button. Unless I've not seen something... Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Moderators Robby Posted May 14, 2004 Moderators Posted May 14, 2004 do you mean non-ASP buttons? Quote Visit...Bassic Software
bungpeng Posted May 14, 2004 Author Posted May 14, 2004 Yes, you can treat it as non-ASP buttons. I use a normal HTML button to trigger my javascript process, under some conditions, this javascript process will force the page to Submit (postback). So in my server side Page_Load event, I want to capture this event. But my page also has ASP button which will trigger the PostBack process, so is it possible I can know who trigger the postback process? Quote
tate Posted May 14, 2004 Posted May 14, 2004 Maybe this would work; Place some ASP.NET label or text box on your form that is made almost invisible by a 1px X 1px size. Within your JavaScript function or event triggered by the ASP.NET button assign a value to the label or text box. Then just check the value of the label or text box during the Page_Load event and make the decision what to do. Tate :D Quote
bungpeng Posted May 15, 2004 Author Posted May 15, 2004 This is what currently I am doing, I use normal html hidden textbox to keep my event value, as you said, it will assign by Javascript. I just want to know if there is other better solution. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.