1.add this to javascript __doPostback('GetPage', 'myargument1');
2.Then in OnLoad event I can add:
If Request.Form("__EVENTTARGET") = "GetPage" Then
MyFunction1(Request.Form("__EVENTARGUMENT")) 'myargument1 will be passed to MyFunction1
End If
Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...
1 comment:
i. In your code file (assuming you are using C# and .NET 2.0 or later) add the following Interface to your Page Class to make it look like
public partial class Default : System.Web.UI.Page, IPostBackEventHandler{}
ii. This should add (using Tab-Tab) this function to your code file:
public void RaisePostBackEvent(string eventArgument) { }
iii. In your onclick event in Javascript write the following code:
var pageId = '<%= Page.ClientID %>';
__ doPostBack(pageId, argumentString);
This will call the 'RaisePostBackEvent' method in your code file with the 'eventArgument' as the 'argumentString' you passed from the Javascript. Now, you can call any other event you like.
Post a Comment