J
jenileo
Hello!
I'm fairly new to asp.net and I am struggling with getting my form to
post to the database and transfer the user to a new page. I am using
the FormView control. After the user completes the form, they click the
insert button. The insertbutton has command="insert" which is auto
generated when you use the formcontrol. I tried to add an onclick event
as well that does a server.transfer and it seems the onclick event
overrides the command event. I am redirected to a new page but the
database is not updated. I also tried the onunload event, while it
worked for both redirection and database update, it also put page2 on
page1. So I added an if ispostback to the transfer event and it worked
beautifully! However, I have another button that shows a calendar and
puts the date in textbox and what does that do, it fires a postback, so
I get an error on the page. Hopefully this can be understood. The goal
here is to have the user push a button that will insert data into the
database as well as take the user to a new page. I think the key also
is this should be done using the formview control, from my experience
things work a little differently with in the formview control. Let me
know if I can post more info. Thanks!!
I'm fairly new to asp.net and I am struggling with getting my form to
post to the database and transfer the user to a new page. I am using
the FormView control. After the user completes the form, they click the
insert button. The insertbutton has command="insert" which is auto
generated when you use the formcontrol. I tried to add an onclick event
as well that does a server.transfer and it seems the onclick event
overrides the command event. I am redirected to a new page but the
database is not updated. I also tried the onunload event, while it
worked for both redirection and database update, it also put page2 on
page1. So I added an if ispostback to the transfer event and it worked
beautifully! However, I have another button that shows a calendar and
puts the date in textbox and what does that do, it fires a postback, so
I get an error on the page. Hopefully this can be understood. The goal
here is to have the user push a button that will insert data into the
database as well as take the user to a new page. I think the key also
is this should be done using the formview control, from my experience
things work a little differently with in the formview control. Let me
know if I can post more info. Thanks!!