mojo99
May 10th, 2005, 04:18 AM
This is my first post on these forums so I apologise if it's a common problem. I'm fairly new to ASP.NET.
The situation is as follows:
On one web page, I have created some textboxes where users can search for records in a db (SQL Sever 2005 Beta). The results of their search are then displayed in a datagrid.
The datagrid also has two 'hyperlink' columns which the user can click to be redirected to other pages where related data is displayed. I use the 'URL format string' property of the hyperlink column to display the correct record by using the following string: NameOfForm.aspx?patid={0}. All of this works fine.
One of the hyperlink columns takes the user to a second aspx page which contains a datagrid and shows the many records related to the record the user originally searched for. This second datagrid also has two 'hyperlink' columns, 'Add' and 'Edit'.
These do pretty much as they say. 'Add' allows the user to add a record to the many end of a database relationship, and 'Edit' displays the specific record selected for editing\viewing. Once again all works well so far.
The problem comes when the datagrid on the second web form is empty (i.e. there are no records in the related table in the db) and the hyperlink columns are not visible. I thought I'd get around this by adding a 'Hyperlink' control to my web form. This redirects the user to a web form where a related record can then be added.
This also works but I what I need is the correct 'patid' to be passed onto this page, which is required as the foreign key of the relationship. How can I pass this variable to the next page?
I hope I've described the problem clearly enough.
TIA,
Mo
The situation is as follows:
On one web page, I have created some textboxes where users can search for records in a db (SQL Sever 2005 Beta). The results of their search are then displayed in a datagrid.
The datagrid also has two 'hyperlink' columns which the user can click to be redirected to other pages where related data is displayed. I use the 'URL format string' property of the hyperlink column to display the correct record by using the following string: NameOfForm.aspx?patid={0}. All of this works fine.
One of the hyperlink columns takes the user to a second aspx page which contains a datagrid and shows the many records related to the record the user originally searched for. This second datagrid also has two 'hyperlink' columns, 'Add' and 'Edit'.
These do pretty much as they say. 'Add' allows the user to add a record to the many end of a database relationship, and 'Edit' displays the specific record selected for editing\viewing. Once again all works well so far.
The problem comes when the datagrid on the second web form is empty (i.e. there are no records in the related table in the db) and the hyperlink columns are not visible. I thought I'd get around this by adding a 'Hyperlink' control to my web form. This redirects the user to a web form where a related record can then be added.
This also works but I what I need is the correct 'patid' to be passed onto this page, which is required as the foreign key of the relationship. How can I pass this variable to the next page?
I hope I've described the problem clearly enough.
TIA,
Mo