CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Is it possible to get {gridvalue} into a URL?

Print topic Send  topic

Author Message
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.
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.