Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email - To field 1

Status
Not open for further replies.

mailzero28

Programmer
Oct 22, 2001
47
0
0
GB
I have a form, which when I press send will send an email.
This works - that's a fact.

All the fields are populated from a database.

My problem is this: The To field will be initally populated with e.g. 'martin@email.com; paul@email.com; peter@email.com'

However, the user may want to change this to simply 'martin@email.com' - simple enough, just delete the other two names. Not quite - while the form looks like only one name is in the To field - it will actually send the email to all three names that were initially loaded into the To field in the first place.

I am new to asp.net, how do I make sure that when I press the send button that it actually picks up what is in the To field, not what was in it initially.

Many thanks in advance.
 
It sounds like you are populating the To field in the Page load event. You should change your page load event to only populate the fields if the page is not a postback e.g.
Code:
If Not Page.IsPostBack Then
   ' Populate fields here
End If


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ca8msm - many thanks for the quick response. You are right, I am populating it on the Page Load event - to a novice it seemed like right thing to do. I'll let you know how I get on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top