Trying to override functionality of UpdateButton in FormView for EditItemTemplate
Posted on 2006-11-12
I want a page with a FormView to save the record but to go to some other page (not the current page).
At first I tried setting the PostBackUrl to the new page. It went to the new page but was not saving the form data.
So then I tried capturing the UpdateButton_Click event. This is what it looks like:
protected void UpdateButton_Click(object sender, EventArgs e)
LinkButton lb = (LinkButton)FormView1.FindControl("UpdateButton");
lb.PostBackUrl = "Deal.aspx?BookId=" + Request["BookId"];
I put a Breakpoint in this routine and it does hit this but it must be too early (or too late) for the PostbackUrl to be changed.
I don't have to do it like above if someone has a better way of doing it.