Alternative to Hyperlinkfield?

T

TJHerman

I'm needing to do an insert function on a Formview and then go to another
page, passing an ID along with it.

I know how to do this with a hyperlinkfield control, but since I need to do
another function first (the insert) before I open the other page, I'm
assuming I'll need to pass my ID in the query string to open the next page.
Can anyone tell me what the best way to accomplish this might be?
 
P

Phillip Williams

You might use a button and style it to look like a hyperlink.

<asp:Button runat="server" ID="btnInsert" CssClass="LinkStyle"
CommandName="InsertARow" CommandArgument='<%#Eval("PK_ID") %>' Text="Insert"
/>

Then you process the Insert while handling the ItemCommand event and
Response.Redirect("newPage.aspx")
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top