This topic is locked

Redirect to another page

3/13/2007 9:46:12 AM
ASPRunnerPro General questions
Z
zion4ever author

Hi folks,
Is there a way to go to the VIEW page direcly after editing or adding a record?

I've tried the before record updated and after record updated by inserting a response.redirect "supportweb_view.asp"

But I'm keep getting an error:
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/hkc/hkcsupportweb/include/commonfunctions.asp, line 198
Is there a workaround or something?

J
Jane 3/13/2007

Hans,
to redirect to the View page after editing use following code:

Sub AfterEdit()

Response.Redirect "TableName_view.asp?editid1=" & keys("KeyField")
End Sub



where TableName is your actual table name, KeyField is your primary key.
The After record added code is dependent on table structure and database type you use.

Z
zion4ever author 3/13/2007

Hans,

to redirect to the View page after editing use following code:
where TableName is your actual table name, KeyField is your primary key.
The After record added code is dependent on table structure and database type you use.


Jane,
It still give the error I mentioned previously.

It seems that all variables in the url are filled in ok except for keys("keyfield")

This returs an empty value resulting in editid1=

instead of for example editid1=1
Any tips?
TIA

Z
zion4ever author 3/13/2007

Oke fixed it.

I replace the part keys("keyfield")
with Dim Knr

Knr = GetRequestForm("editid1")
Thus creating a variabele for it.
Thnx