开发者

first invoke server side code then client side script without using AJAX

开发者 https://www.devze.com 2022-12-30 13:55 出处:网络
in a form i have a buttoin, when click both OnclientClick and postback should happen. on clicking the \"Email\" button a client side \"mailto\" tag should do the work and pull a new message window on

in a form i have a buttoin, when click both OnclientClick and postback should happen. on clicking the "Email" button a client side "mailto" tag should do the work and pull a new message window on the client's machine.

whereas, the email addresses should be invo开发者_JAVA技巧ked by the post back. so , when clicking the button the server side post should happen and on return the client side script should be invokded with the values read during post back, and populate all the email addresses.

i need know how to first do a server hit take the values and then execute the client script with those values without using AJAX


You can use the RegisterStartupScript method to add a script to the page from the code behind. Example:

Page.ClientScript.RegisterStartupScript(
  this.GetType(),
  "mail",
  "window.location.href='mailto:" + emailAddress + "';",
  true
);
0

精彩评论

暂无评论...
验证码 换一张
取 消