473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Form and redirect question

I am working in Visual Studio 2005 and ASP.NET 2.0. I have created a customer form and I need to insert the details into the database as well as when I click the submit button I have to go to another .aspx page.

I have done it in Formview.
The code is
<asp:LinkButton ID="insertButton" runat="server" CauseValidation="True" CommandName="insert" PostBackUrl="`/Clinic.aspx" Text="insert"></asp:LinkButton>

Clinic.aspx is the page I finsih to go after inserting the data into the database.

If I am not giving the "PostUrl" then the data is inserting into the database.But I can't do both in one click.

Hope someone can help me

regards
preeshma
Aug 31 '06 #1
4 3998
nmsreddi
366 256MB
hi

you said the problem is when you are not giving the posturl.what is the problem if you use posturl.why you r avoiding that can you specify the reason so that i can help you




regards

nmsreddi
Sep 1 '06 #2
Using asp button(FormView) I am trying to insert the data from the form into the database and at the same time want to move on to another page indicating the succes of insertion.

My code:
<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
Text="Submit" PostBackUrl="~/ClinicDownload.aspx"></asp:Button>

If I give PostbackUrl it is moving on to another page, but no insertion is taking place. If I don't give the PostBackUrl then I can insert. I want to do both in one click....

Regards
preeshma

hi

you said the problem is when you are not giving the posturl.what is the problem if you use posturl.why you r avoiding that can you specify the reason so that i can help you




regards

nmsreddi
Sep 13 '06 #3
nmsreddi
366 256MB
hello

actually when you are saving data to the database in the button click it self
just check it out ,if not first save data to the database then following write code for redirecting in that button click method only. i think you are giving postback url inline code just avoid it and write the code for redirecting in the button click it self after the save method(method which you write for inswerting in to database)

even now i dint get your problem exactly but hope may help

if problem not solved try to elaporate any post as soon as possible
Sep 14 '06 #4
Hi,

Save the data in the database as u r doing on button click.....then after saving
write the following line of code to redirect on to the next page.

Response.Redirect("YourPage.aspx");

If U R passing values on to the next page then use this line of code as

Response.Redirect("YourPage.aspx?value1="+my_id);

If u want to access this value on the next page then access the value which is in the variable "value1" with this line in the page load:

string abc = Request.Params["value1"];

now u can use abc value on this new page.

Thanks.

Fasih
Oct 5 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Danny Anderson | last post by:
Hola, PHP folk! I have a php page that contains a self-processing form. The form holds search results. The search terms originally came from the previous page, but the user can repeatedly...
2
by: Stephan Bour | last post by:
I have a vexing problem I hope someone can help me with: I have an ASP.Net site that allows users to place orders for biological materials. Once the order is done though, I would like to have two...
11
by: David W. Simmonds | last post by:
I have a form that will prompt for a user name/password. In VS.NET, I have the protected form in a folder named Admin. I have a Web.config file in that folder as well. It contains the following...
4
by: Dave | last post by:
Hello. Sorry me, if it's some basic question, but I'm new in ASP.NET:) How do I show the othe web form from my code? I mean I have a button on form "A" and I want to go to form "B" when I click...
4
by: Andrea De Santi | last post by:
How can I redirect to another page with form data? In asp Classic I write: <form ... action="filename">...</form> and in then target page I write <%=request.form("fieldname")%> ..... but in...
2
by: geodev | last post by:
Hi, I'm building a web form utilizing ASP.NET and VB.NET. The web form has three pages: 1. The first page has a set of text boxes that a user has to fill out and then hit the next button. Once...
9
by: Justin Engelman | last post by:
Hi, I have a website that uses an ISAPI filter that will redirect anyone going to any page on the site to an SSL login page (on a different website with the same root domain) if they do not have...
2
by: neilphan | last post by:
Hi Guys, I need a quick reference to Windows Application Development in dotNet. I'm fairly good at the Web Development using asp.net though i'm new to the Windows Desktop Application...
16
by: whyyyy | last post by:
The script below works fine if the form is filled out and submitted. But a (blank) e-mail is sent whenever the page loads, even when the form is not submitted. I would like to receive the e-mail...
3
by: Athmaus | last post by:
Hello, I have this ecom page that i am making where customers can select to choose additional licenses before they purchase. I have that part working with javascript. Problem is that when the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.