views:

48

answers:

1

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 invoked 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

A: 

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
);
Guffa
You can also add subject, cc and body to the email message. Just add ?body=hello world to the mailto:[email protected]. mailto:[email protected]?subject=helloworld. Here's a complete list of what you can do: http://www.ianr.unl.edu/internet/mailto.html
fredrik
i apologize for a very late reply, Thank you so much for the reply, i will try and let you know... Thanks again...
v-6vesan