Formatting Text in URL

blabla123

New Member
Hello everyone and thaks for your help in advance. I am working with a<BR>datagrid in which I want to create a hyperlink with text Last Nmae, First<BR> Name with the text being the individuals last name and first name<BR> separated by a comma. I ave used the DataTextField prpperty to<BR> successfuly bind one column to the text, but cannot seem to get it to<BR> handle more than one column. I have tried:<BR><BR> DataTextField="<%# Container.DataItem("LastName") & Container.DataItem<BR> ("FirstName") %>"<BR><BR> but this gives me an error<BR>Parser Error Message: Literal content ('View File</b>" DataNavigateURLField="ID" DataNavigateURLFormatString="chart/demographics.aspx?ID={0}" Target="chart/demographics.aspx?PatientID={0}" DataTextField="') is not allowed within a 'System.Web.UI.WebControls.HyperLinkColumn'<BR><BR><BR>Any help would be greatly appreciated.<BR> Thanks.<BR>Kindly go the site for your clarification.<BR>http://samples.gotdotnet.com/quickstart/aspplus/Default.aspxI asked a similar question before and I think I understand the answer. The real answer to your question is not to add two columns to the URL. But instead to use one as a "primary key" to look up the rest of the data when it is needed. You should only need to render "buttons" and then have a way to know which button they have pressed. The page does not need the rest of the information until the user "presses" the button.<BR> <BR>Example code <BR>http://samples.gotdotnet.com/QuickStart/aspplus/default.aspx<BR><BR>Under the Link<BR>Web Forms Controls Reference<BR>datagrid4.aspx<BR><BR>http://samples.gotdotnet.com/QuickStart/aspplus/default.aspx?url=/quickstart/aspplus/samples/webforms/ctrlref/webctrl/datagrid/doc_datagrid.aspx<BR><BR>
 
Back
Top