DataField and PostBackURL

  • Thread starter Thread starter cider123
  • Start date Start date
C

cider123

Is there a way to add a Datafield value to a PostBack URL in another
column of the same row ?

In my case I have this hidden value of SystemID:

<Columns>
<asp:BoundField DataField="SystemID" HeaderText="SystemID"
InsertVisible="False"
ReadOnly="True" SortExpression="SystemID"
Visible="False" />



I want to add that (int) SystemID value to the Postback of another
column in the same row:

<asp:Button ID="cmdPorts" runat="server" Text="Ports" PostBackUrl=
"~/Ports.aspx?ID=" />

This happens to be a TemplateField where I added a button for postback.
 
Ahh I figured it out by a fluke while playing around with the Grid Edit
Columns feature..

Just had to change the PostBackUrl to the following:

PostBackUrl= '<%# "~/Ports.aspx?ID=" + Eval("SystemID") %>'
 
Back
Top