Datagrid, redirect and Form

L

Lionel

Hi,

I have a datagrid in page1.aspx
I would like, when the user clicks on the Edit button
(<asp:EditCommandColumn for ex.), to redirect him to the page2.aspx with the
value of the first column passed as a parameter (equivalent of POST method
in ASP, Request.Form in page2.aspx...).
I know the datagrid as to be located in a FORM with runat=SERVER ; so,
anything i write in the *action=* (page2.aspx.....) in the FORM is ignored.

How can i do this in ASP.Net. It was simple in ASP= ? I must be wrong in my
way of thinking.

Thanks.
 
E

Eliyahu Goldin

I recommend doing this on client side with a bit of javascript programming.
You can have just one edit button rather than an editcommandcolumn. You can
select a row on the grid, store the value from the first column in a
client-side variable, and than, in the edit button onclick event, open
another window with the stored value as a parameter.

Eliyahu
 
L

Lionel

Thanks.
I would like to avoid to use the URL to send the parameters.
Is there a way to do this on the server-side ?
 
E

Eliyahu Goldin

You don't have to put parameters into url. window.open, .showModalDialog and
..ShowModalessDialog methods accept an object where you can pass parameters.

Anyway, you can always do it on server side in code behind with
Response.Redirect or Server.Transfer calls.

Eliyahu
 

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

Top