S_A
Posts: 29
|
| Posted: 07/29/2004, 1:41 AM |
|
Hi, I have a need to redirect to a specific page to edit a record based on a field value in that grid record which is not the PK.
For example, there could be two values in thie field say "bought" or "hired". What I would need it to do is to redirect to a page either by naming the pages to coincide with the value and inserting that into the URL dynamically or some other method that I have not thought about. I'm a newbie, so forgive me if it's obvious.....
Thanks.
|
 |
 |
dataobjx
Posts: 181
|
| Posted: 07/30/2004, 7:44 AM |
|
In your grid you have a link control. That link is has a href source in the properties. If you click on the elipsis (...) box, you can select the name of the page you want to send it to - then you can click the "+" and add whatever link params you want to send.
If you are saying that you want to 'dynamically' have the link point to a different page depending on a certain value in the record then you need to;
Change the link to a label.
Create a BeforeShow for the label.
In the LabelName_BeforeShow event add the following code, modifying it according to your gridname/db name values.
Dim lngID
Dim sTitle
Dim sValue
Dim blnBought
Dim blnHired
Dim sHREF
lngID = YourGridName.Datasource.recordset.fields("id_PK")
sTitle = YourGridName.Datasource.recordset.fields("title")
sValue = YourGridName.Datasource.recordset.fields("bought_hired_FieldName")
If sValue = "Bought" Then blnBought = True
If sValue = "Hired" Then blnHired = True
If blnBought Then
sHREF = "<a href=""./Bought.asp?id=" & lngID & """ class=""AquaDataLink"">" & sTitle & "</a>"
ElseIf blnHired Then
sHREF = "<a href=""./Hired.asp?id=" & lngID & """ class=""AquaDataLink"">" & sTitle & "</a>"
Else
Response.write "Unable to determine whether bought or hired.<br>Execution halted<br>Debug Me"
End If
YourGridName.YourLabelName.value = sHREF
_________________
www.DataObjx.net
www.mydigitalapps.com |
 |
 |
|