473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirect Problem

Hi Sir

I'm in my 2nd year in M.Sc. degree & I made a project about the
powerful tools SQLXML 3.0 & updategram, so I made a list of programs
which r they so similar to the example that using updategram with ASP
That exist in the documentation of the Microsoft SQL Server XML Tools
as the following page:
Sample ASP Application
This ASP application allows you to update customer information in the
Customers table in the Northwind database. The application does the
following
Ask user to enter a customer ID. Using this customer ID value, execute
a template to retrieve customer information from Customers table. This
information is displayed using an HTML form.
The user is then allowed to update customer information (not the
Customer ID because it is the primary key and also to keep the
application simple). Once the user hits the submit button, an
updategram (which is also a template) is executed. All the form
parameters are passed to the updategram.
This is the first template (GetCustomer.xml). Save this template in the
directory associated with virtual name of template type.
<root xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<sql:header>
<sql:param name="cid"></sql:param>
</sql:header>
<sql:query>
SELECT *
FROM Customers
WHERE CustomerID=@cid
FOR XML AUTO
</sql:query>
</root>
This is the second template (UpdateCustomer.xml). Save this template in
the directory associated with virtual name of template type.
<ROOT xmlns:updg="urn:schemas-microsoft-com:xml-updategram">
<updg:header>
<updg:param name="cid"/>
<updg:param name="companyname" />
<updg:param name="contactname" />
<updg:param name="contacttitle" />
<updg:param name="address" />
<updg:param name="city" />
<updg:param name="region" />
<updg:param name="postalcode" />
<updg:param name="country" />
<updg:param name="phone" />
<updg:param name="fax" />

</updg:header>
<updg:sync >
<updg:before>
<Customers CustomerID="$cid" />
</updg:before>
<updg:after>
<Customers CustomerID="$cid"
CompanyName="$companyname"
ContactName="$contactname"
ContactTitle="$contacttitle"
Address="$address"
City="$city"
Region="$region"
PostalCode="$postalcode"
Country="$country"
Phone="$phone"
Fax="$fax" />
</updg:after>
</updg:sync>
</ROOT>
This is the ASP application (SampleASP.asp). Save it in the directory
associated with a virtual root created using Internet Services Manager
utility (this virtual root is not created using IIS Virtual Directory
Management for SQL Server utility because the handle of it does not
understand asp applications).
<% LANGUAGE=VBSCRIPT %>
<%
Dim CustID
CustID=Request.Form("cid")
%>
<html>
<body>
<%
'if cust id value is not yet provided, display this form
if CustID="" then
%>
<!-- the CustID has not been specified so we display the form that
allows users to enter an id -->
<form action="SampleASP.asp" method="POST">
<br>
Enter CustID: <input type=text name="cid"><br>
<input type=submit value="Submit this ID" ><br><br>
<-- Otherwise, we have already entered an customerID, so display the
second part of the form where the user can change cust info -->
<%
else
%>
<form name="Customer"
action="http://localhost/nwind/Template/UpdateCustomer.xml"
method="POST">
You may update customer information below.<br><br>
<!-- comment goes here to separate the parts of the application or page
-->
<br>
<%
' Let us load the document in the parser and extract the values to
populate the form.
Set objXML=Server.CreateObject("MSXML2.DomDocument")

objXML.async=False
objXML.Load("http://localhost/nwind/Template/GetCustomer.xml?cid="
& CustID)
set objCustomer=objXML.documentElement.childNodes.Item (0)
' In retrieving data form the database, if a value in the column is
NULL,
' we don't get any attribute for the corresponding element. In this
' case we want to skip the error generation and go to the next
attribute
On Error Resume Next

' get the cid attribute value
Response.Write "Cust ID: <input type=text readonly=true
style='background-color:silver' name=cid value="""
Response.Write objCustomer.attributes(0).value
Response.Write """><br><br>"

' get the companyname attribute value
Response.Write "Company Name: <input type=text name=companyname
value="""
Response.Write objCustomer.attributes(1).value
Response.Write """><br><br>"

' the contactname attribute
Response.Write "Contact Name: <input type=text name=contactname
value="""
Response.Write objCustomer.attributes(2).value
Response.Write """><br>"

' get the Contacttitle attribute value
Response.Write "Contact Title: <input type=text name=contacttitle
value="""
Response.Write objCustomer.attributes(3).value
Response.Write """><br><br>"

' get the address attribute value
Response.Write "Address: <input type=text name=address value="""
Response.Write objCustomer.attributes(4).value
Response.Write """><br><br>"

' the city attribute
Response.Write "City: <input type=text name=city value="""
Response.Write objCustomer.attributes(5).value
Response.Write """><br>"

' get the region attribute value
Response.Write "Region: <input type=text name=region value="""
Response.Write objCustomer.attributes(6).value
Response.Write """><br><br>"

' get the postalcode attribute value
Response.Write "PostalCode: <input type=text name=postalcode
value="""
Response.Write objCustomer.attributes(7).value
Response.Write """><br><br>"

' the country attribute
Response.Write "Country: <input type=text name=country value="""
Response.Write objCustomer.attributes(8).value
Response.Write """><br>"

' get the phone attribute value
Response.Write "Phone: <input type=text name=phone value="""
Response.Write objCustomer.attributes(9).value
Response.Write """><br><br>"

' the fax attribute
Response.Write "Fax: <input type=text name=fax value="""
Response.Write objCustomer.attributes(10).value
Response.Write """><br>"

set objCustomer=Nothing
Set objXML=Nothing
%>
<input type="submit" value="Submit this change" ><br><br>
<input type=hidden name="contenttype" value="text/xml">
<input type=hidden name="eeid" value="<%=CustID%>"><br><br>
<% end if %>
</form>
</body>
</html>

So, as u see this ASP program is so helpful for me & I depend on it not
only on my study but also in business jobs that I want to made

My problems is that if we want to execute this ASP file it'll work
very well but redirect the user after he made the submit to the
execution of the updateCustomer.xml because the action in the form is
set to this page to make the execution , so please help me to
execute the ASP file without showing the user the execution page of the
updateCustomer.xml page instead of that I can redirect the user to any
other page or the same

Sep 19 '05 #1
0 1686

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2173
by: Steve Lutz | last post by:
Hello, I have a page that creates a class, and then on certain conditions, redirects user to another page. The class has a Class_Terminate() function that saves itself to a database. The class...
3
3883
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...
4
14592
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
1
15268
by: Peter Kirk | last post by:
Hi there I have a program written by another company (it's a "web control" which returns a web-page: can I compare this to a servlet in the Java world?), which they think is causing problems on...
2
5920
by: news://news.microsoft.com/microsoft.public.de.germ | last post by:
Hallo! Ich habe ein Frameset mit 3 Frames. Im 1. Frame wird eine ASPX-Seite geöffnet. In dieser werden einige Steuerelemente angezeigt. Nun soll bei bestimmten Benutzeraktivitäten eine andere...
5
2008
by: Alan Silver | last post by:
Hello, I have a page that is supposed to do some checking, and if OK, set a session variable before redirecting to another page. The following code is a simplified version, I have hard-coded the...
5
4544
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...
5
4839
by: =?Utf-8?B?d2ViZ3V5QGNvbW11bml0eS5ub3NwYW0=?= | last post by:
We have been running into some problems where using Response.Redirect causes the page to hang and it never actually redirects. Here's the scenario: User opens the page, selects an item from the...
12
3441
by: =?Utf-8?B?cGI=?= | last post by:
I am having trouble doing a redirect in an async asp.net implemention. Most of the time it works, but when it doesn't it just "hangs", the browser never gets any return page. If I run it under the...
6
3168
by: sjledet | last post by:
I'm trying to figure out what I have wrong in the following code. It's located at http://www.ledet.com/locations/location.aspx If I call this page with...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.