Connecting Tech Pros Worldwide Help | Site Map

ASP / Redirect

SyrUser03
Guest
 
Posts: n/a
#1: Jul 22 '05
I am new to ASP, still learning.

I have a page that has a submit button.

<form action="move.asp" method="GET">
<input type="submit" value="Query">

The form is sending values to the move.asp page. Which will in turn be
inserted into a database. My questions is can I do the insert without
having to go/see the another page.

For example.
I click on the submit button, it adds the record and then goes back to the
original page.

Thanks in advance







Roji. P. Thomas
Guest
 
Posts: n/a
#2: Jul 22 '05

re: ASP / Redirect


Ofcourse, you can post back to the same page,

Here is the psudo code for you.
<%
If Request.Form("Someformfield") <> "" Then --Poor mans IsPostback() ;)
' Save record
End If

Render your page here

%>



--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


"SyrUser03" <syruser03@syr.edu> wrote in message
news:O0tZWuZHFHA.2132@TK2MSFTNGP14.phx.gbl...[color=blue]
>I am new to ASP, still learning.
>
> I have a page that has a submit button.
>
> <form action="move.asp" method="GET">
> <input type="submit" value="Query">
>
> The form is sending values to the move.asp page. Which will in turn be
> inserted into a database. My questions is can I do the insert without
> having to go/see the another page.
>
> For example.
> I click on the submit button, it adds the record and then goes back to the
> original page.
>
> Thanks in advance
>
>
>
>
>
>
>[/color]


McKirahan
Guest
 
Posts: n/a
#3: Jul 22 '05

re: ASP / Redirect


"Roji. P. Thomas" <thomasroji@gmail.com> wrote in message
news:#y7uf1ZHFHA.4060@TK2MSFTNGP14.phx.gbl...[color=blue]
> Ofcourse, you can post back to the same page,
>
> Here is the psudo code for you.
> <%
> If Request.Form("Someformfield") <> "" Then --Poor mans IsPostback() ;)
> ' Save record
> End If
>
> Render your page here
>
> %>
>
>
>
> --
> Roji. P. Thomas
> Net Asset Management
> https://www.netassetmanagement.com
>
>
> "SyrUser03" <syruser03@syr.edu> wrote in message
> news:O0tZWuZHFHA.2132@TK2MSFTNGP14.phx.gbl...[color=green]
> >I am new to ASP, still learning.
> >
> > I have a page that has a submit button.
> >
> > <form action="move.asp" method="GET">
> > <input type="submit" value="Query">
> >
> > The form is sending values to the move.asp page. Which will in turn be
> > inserted into a database. My questions is can I do the insert without
> > having to go/see the another page.
> >
> > For example.
> > I click on the submit button, it adds the record and then goes back to[/color][/color]
the[color=blue][color=green]
> > original page.
> >
> > Thanks in advance[/color][/color]

However, since the OP uses "GET", it would be:

<%
If Request.QueryString() <> "" Then
' Save record
End If

' Render your page here

%>


Roland Hall
Guest
 
Posts: n/a
#4: Jul 22 '05

re: ASP / Redirect


"McKirahan" wrote in message news:UP6dnbxVcJ-Rtr7fRVn-hw@comcast.com...
: "Roji. P. Thomas" <thomasroji@gmail.com> wrote in message
: news:#y7uf1ZHFHA.4060@TK2MSFTNGP14.phx.gbl...
: > Ofcourse, you can post back to the same page,
: >
: > Here is the psudo code for you.
: > <%
: > If Request.Form("Someformfield") <> "" Then --Poor mans IsPostback() ;)
: > ' Save record
: > End If
: >
: > Render your page here
: >
: > %>
: >
: >
: >
: > --
: > Roji. P. Thomas
: > Net Asset Management
: > https://www.netassetmanagement.com
: >
: >
: > "SyrUser03" <syruser03@syr.edu> wrote in message
: > news:O0tZWuZHFHA.2132@TK2MSFTNGP14.phx.gbl...
: > >I am new to ASP, still learning.
: > >
: > > I have a page that has a submit button.
: > >
: > > <form action="move.asp" method="GET">
: > > <input type="submit" value="Query">
: > >
: > > The form is sending values to the move.asp page. Which will in turn
be
: > > inserted into a database. My questions is can I do the insert without
: > > having to go/see the another page.
: > >
: > > For example.
: > > I click on the submit button, it adds the record and then goes back to
: the
: > > original page.
: > >
: > > Thanks in advance
:
: However, since the OP uses "GET", it would be:
:
: <%
: If Request.QueryString() <> "" Then
: ' Save record
: End If
:
: ' Render your page here
:
: %>

I thought for QueryString is was preferable to use:
<%
if len(request.queryString) <> 0 then
'Save record
end if

' Render your page here
%>

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


Roji. P. Thomas
Guest
 
Posts: n/a
#5: Jul 22 '05

re: ASP / Redirect


I dont think that approach is safe because
len(request.queryString) can be greater than zero even when the page
is not post backed.

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


"Roland Hall" <nobody@nowhere> wrote in message
news:eCc6mYaHFHA.2132@TK2MSFTNGP14.phx.gbl...[color=blue]
> "McKirahan" wrote in message news:UP6dnbxVcJ-Rtr7fRVn-hw@comcast.com...
> : "Roji. P. Thomas" <thomasroji@gmail.com> wrote in message
> : news:#y7uf1ZHFHA.4060@TK2MSFTNGP14.phx.gbl...
> : > Ofcourse, you can post back to the same page,
> : >
> : > Here is the psudo code for you.
> : > <%
> : > If Request.Form("Someformfield") <> "" Then --Poor mans IsPostback()
> ;)
> : > ' Save record
> : > End If
> : >
> : > Render your page here
> : >
> : > %>
> : >
> : >
> : >
> : > --
> : > Roji. P. Thomas
> : > Net Asset Management
> : > https://www.netassetmanagement.com
> : >
> : >
> : > "SyrUser03" <syruser03@syr.edu> wrote in message
> : > news:O0tZWuZHFHA.2132@TK2MSFTNGP14.phx.gbl...
> : > >I am new to ASP, still learning.
> : > >
> : > > I have a page that has a submit button.
> : > >
> : > > <form action="move.asp" method="GET">
> : > > <input type="submit" value="Query">
> : > >
> : > > The form is sending values to the move.asp page. Which will in turn
> be
> : > > inserted into a database. My questions is can I do the insert
> without
> : > > having to go/see the another page.
> : > >
> : > > For example.
> : > > I click on the submit button, it adds the record and then goes back
> to
> : the
> : > > original page.
> : > >
> : > > Thanks in advance
> :
> : However, since the OP uses "GET", it would be:
> :
> : <%
> : If Request.QueryString() <> "" Then
> : ' Save record
> : End If
> :
> : ' Render your page here
> :
> : %>
>
> I thought for QueryString is was preferable to use:
> <%
> if len(request.queryString) <> 0 then
> 'Save record
> end if
>
> ' Render your page here
> %>
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
> http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>[/color]


Iain Norman
Guest
 
Posts: n/a
#6: Jul 22 '05

re: ASP / Redirect


On Mon, 28 Feb 2005 08:44:11 -0500, "SyrUser03" <syruser03@syr.edu>
wrote:
[color=blue]
>I am new to ASP, still learning.
>
>I have a page that has a submit button.
>
><form action="move.asp" method="GET">
><input type="submit" value="Query">
>
>The form is sending values to the move.asp page. Which will in turn be
>inserted into a database. My questions is can I do the insert without
>having to go/see the another page.
>
>For example.
>I click on the submit button, it adds the record and then goes back to the
>original page.
>
>Thanks in advance
>[/color]
Send the values to the move.asp page, have it do what it needs to do
then if everything is okay finish the move.asp page with a
response.redirect to the original page.

eg. Response.Redirect("form.asp")

You don't even need any html in the move.asp page, unless you want to
report an error.


I

--
Iain Norman | http://www.eliteforum.org
Closed Thread


Similar ASP / Active Server Pages bytes