response.redirect("url") does not want to work on my page....its working on my other pages except for one of my pages. i dont understand why not - Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Dim sqlCon As SqlConnection
-
sqlCon = New SqlConnection("connectionstring")
-
Dim sqlCommand As New SqlCommand("INSERT INTO register(companyname,ceo,contactperson,contacttel,fax,emailaddress,address,suburb,city,postalcode,province,username,amount)VALUES('" & txtCompanyName.Text & "','" & txtCEO.Text & "','" & txtContactPerson.Text & "','" & txtContactTel.Text & "','" & txtFax.Text & "','" & txtEmailaddress.Text & "','" & txtAddress.Text & "','" & txtSuburb.Text & "','" & txtCity.Text & "','" & txtPostalCode.Text & "','" & drpProvince.SelectedValue & "','" & txtUsername.Text & "','" & Request.Form("action") & "')", sqlCon)
-
sqlCon.Open()
-
sqlCommand.ExecuteNonQuery()
-
sqlCon.Close()
-
Response.Redirect("debitorderpage.aspx")
-
End Sub
i feel like and idiot
2 1723
response.redirect("url") does not want to work on my page....its working on my other pages except for one of my pages. i dont understand why not - Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Dim sqlCon As SqlConnection
-
sqlCon = New SqlConnection("connectionstring")
-
Dim sqlCommand As New SqlCommand("INSERT INTO register(companyname,ceo,contactperson,contacttel,fax,emailaddress,address,suburb,city,postalcode,province,username,amount)VALUES('" & txtCompanyName.Text & "','" & txtCEO.Text & "','" & txtContactPerson.Text & "','" & txtContactTel.Text & "','" & txtFax.Text & "','" & txtEmailaddress.Text & "','" & txtAddress.Text & "','" & txtSuburb.Text & "','" & txtCity.Text & "','" & txtPostalCode.Text & "','" & drpProvince.SelectedValue & "','" & txtUsername.Text & "','" & Request.Form("action") & "')", sqlCon)
-
sqlCon.Open()
-
sqlCommand.ExecuteNonQuery()
-
sqlCon.Close()
-
Response.Redirect("debitorderpage.aspx")
-
End Sub
i feel like and idiot
hi,
This is a .net question. i am not sure weather the the solution is correct or not....
may be the problem is the values you are giving to the sql statement is not valid (Request.Form("action") for amount ). some where type mismach or not valid data you are getting and throwing exception which is not handled...so debug the application... you will get the result.
hi,
This is a .net question. i am not sure weather the the solution is correct or not....
may be the problem is the values you are giving to the sql statement is not valid (Request.Form("action") for amount ). some where type mismach or not valid data you are getting and throwing exception which is not handled...so debug the application... you will get the result.
the problem is not with the sqlCommand, - '" & request.form("action") & "'
sll that this does is get the value inserted in the textbox called action.....and save it to the database, dont want a static value.
but i see it was the cache that needed to be refreshed and now its working fine.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul |
last post by:
I'm not getting the results I want when I use
Response.Redirct in a ASP page.
I enter this line of code in a asp page from domain1.com.
Response.Redirect...
|
by: JC |
last post by:
Hi,
I have a simple question regarding the Response.Redirect method. Does the
server stop processing the ASP code as soon as it encounters the Redirect
command? Or does it ever continue to...
|
by: TomT |
last post by:
Hi..
I'm redirecting users to another page using:
response.redirect("newpage.asp")
this works... But I need to add a variable to the page specified..
IE: newpage.asp?id=JobID
|
by: Sam |
last post by:
I have some issues with HTTP Headers and I was hoping for
some pointers or references to good articles.
Here is the problem.
I have 6 .aspx pages, each page contains a common .ascx.
This ascx...
|
by: Sehboo |
last post by:
On my ASP page, when I click a button, I want to do three things:
1. Check for some values.
2. Open a new window and pass some values as query string.
3. Redirect to some other page
Here...
|
by: Tim |
last post by:
Hello,
Is there a way to "cancel" a response.Redirect? For example, in the code
below, could I insert anything in the Catch statement that would cancel the
redirect and resume flow after the...
|
by: Niggy |
last post by:
I get an error - any help appreciated.
System.Threading.ThreadAbortException: Thread was being aborted. at
System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort(Object...
|
by: venner |
last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks...
|
by: mike.biang |
last post by:
I have an ASP page that is using an XMLHTTP object to request various
pages from my server. I keep a single session throughout the XMLHTTP
requests by bassing the ASPSESSIONID cookie through the...
|
by: RN1 |
last post by:
When a server encounters the line
Response.Redirect("abcd.asp")
in a ASP script, the server tells the browser that it has to be
redirected to another page (which is abcd.asp, in this case)....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
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...
|
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...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |