i want to connect one aspx webpage to another
I want to connect one webpage t开发者_StackOverflow中文版o another using a command button called email. When the user clicks on the email button it should take them to another webpage where the user can select the emails they want to send to. Then they will click the OK button and it will return them to the previous webpage where they can type in their email and write a message and hit submit.
To do this, you can use the asp.net Session
object. Session allows you to save information, such as a list of email addresses into memory, and retrieve them on another page.
Here's the basic article on Session, including a bunch of how-to's.
From a logic flow perspective:
- Main form page loads
- User completes one or more fields
- User clicks "Select Emails" button
- In the button click event handler, store all completed form values in
Session
, and redirect to second .aspx page - User selects some email addresses and clicks Okay
- In code behind of email .aspx page, in your okay button click event handler, store which email addresses were selected in
Session
, then redirect back to the Main form. - During page load on the Main form, check for page is not postback, and if the session values exist, use them to populate the form.
- During form submission (where an email should be created), use the email list previously set it Session, to populate the 'to' list.
精彩评论