Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
URL Format String for a foreign (surrogate) key
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00832557
Message ID:
00832789
Views:
21
>Boy, I don't understand "choice 2" at all. Howeveer "choice 1" looks like the ticket, but I'm too much of a newbie to understand the syntax of the function call, or where the function call goes:
>
>
><% FormatURL(Container.DataItem("UserID") )>
>
You know, I just reread that page and I'm not sure I understand it either. So I'll give you another way of doing this:

Add another column to the data grid, except make it a "Template" column. It's probably easiest to do this just by viewing the HTML code of the ASPX page. Inside this template column, you can add a normal asp:HyperLink control and set it's values dynamically anyway you'd like. Here's some sample code:
<Columns>
<asp:BoundColumn LotsOfStuffRemoved/>
<asp:TemplateColumn>
  <ItemTemplate>
     <asp:HyperLink ID="HyperLink1" Runat="server" NavigateUrl='<%# "MyPage.aspx?id=" + DataBinder.Eval(Container.DataItem,"SomeID").ToString().TrimEnd()%>'>
     <%# DataBinder.Eval(Container.DataItem, "SomeDescriptiveField").ToString().TrimEnd() %>
     </asp:HyperLink>
   </ItemTemplate>
</asp:TemplateColumn>
</Columns>
Notice that inside of the <%# stuff of the asp:HyperLink control that you can add together as many parameters as you'd like. I'm just showing one parameter, but you can add more just by tacking on the "&" + Variable Name + "=" + value.

(dang, it looks like the UT is hosing the "less than" symbol into the & lt ; stuff. Just replace it with a normal less than for the "real" code)
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform