change form action from aspx page to master page behind it
i have a master page and a child aspx page, coneected to each other. the master page has the form in it. Now the child page has checkboxes, whose value i would like to pass to another child page with same master page behind it. Can i change the action=abc.aspx and method=post? How can i send all the checkbox values (checkbox.text = 开发者_如何学Pythonabc@oke.com) to the next page? there are lots of these values that need to pass to nex tpage.
Use Button.PostBackUrl to change the page which the button posts to, and then on the target page, use Page.PreviousPage to get a reference to the source page (and therefore its controls).
By default you can use Page.PreviousPage.FindControl(...)
to find a control on the source page by ID, then cast it to a checkbox and retrieve its values. You can also specify the type of the previous page with a <%@ PreviousPageType %>
directive, and then access the previous page's public properties.
See Cross-Page Posting for details.
精彩评论