Datagrid, redirect and Form

  • Thread starter Thread starter Lionel
  • Start date Start date
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.
 
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
 
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 ?
 
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
 
Back
Top