Click here to Skip to main content
15,910,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Am using a HyperLinkField Id to pass selected value is a gridview, Not sure if am doing the right thing here but this code only sends the value inside "name" to another page, below is the Hyperlinkfield:

XML
<Columns >

             <asp:HyperLinkField HeaderText="Create Appointment"  Text="Create Appointment"
              DataNavigateUrlFormatString="AddPatients.aspx?name=GridViewRow.SelectedRow.Cells[2].Text" DataNavigateUrlFields="name" />



              </Columns>
Posted

Hi,

Please change the your code as following.

XML
<Columns >
             <asp:HyperLinkField HeaderText="Create Appointment"  Text="Create Appointment"
              DataNavigateUrlFormatString="AddPatients.aspx?name='<% Eval('name') %>'" DataNavigateUrlFields="name" />

              </Columns>


Hope this will help you.

Regards,
Kiran.
 
Share this answer
 
Comments
Anele Ngqandu 13-Jun-11 9:46am    
helo Sir... Are we not suppose to use that when we using the databounds, because my values are retrieved using c# code, not the binding
try with the following code

C#
<asp:HyperLinkField DataNavigateUrlFields="Name"
DataNavigateUrlFormatString= "Default2.aspx?name={0}=" Text="Transfer values to other page" />



hope it helps
 
Share this answer
 
Comments
Anele Ngqandu 13-Jun-11 9:55am    
Stunning!!!!!!!!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900