DataField and PostBackURL

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.
 
C

cider123

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") %>'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top