This topic is locked

select action add button ( ASPRUNNER 5.1 or 6.2)

11/8/2010 7:24:05 AM
ASPRunnerPro General questions
C
claudioparmelli author

hi,
in list page of a table, we have button ADD NEW for new record referred to XXXX_add.asp.

I need to change action to another file ( es. XXXXX_newadd.asp) when a session variable as == "T" ( or a paricular field of a related table is setting to TRUE).
more easy: if X= true then action == XXXX_add.asp else XXX_newadd.asp
many thanks
claudio

Sergey Kornilov admin 11/8/2010

Probably the best approach is to display Add button using 'ASP code snippet'. In this case you can analyze session variable state and build the link you need to.
Example:



if Session("X")="T" then

Response.write "<span class='buttonborder'><input type='button' id='addButton1' href='Cars_add.asp' value='Add new' class='button'></span>"

else

Response.write "<span class='buttonborder'><input type='button' id='addButton1' href='Cars_newadd.asp' value='Add new' class='button'></span>"

end if
C
claudioparmelli author 11/8/2010



Probably the best approach is to display Add button using 'ASP code snippet'. In this case you can analyze session variable state and build the link you need to.
Example:



if Session("X")="T" then

Response.write "<span class='buttonborder'><input type='button' id='addButton1' href='Cars_add.asp' value='Add new' class='button'></span>"

else

Response.write "<span class='buttonborder'><input type='button' id='addButton1' href='Cars_newadd.asp' value='Add new' class='button'></span>"

end if



Thanks Sergey, but I need to change the href of ADD NEW button displaied in LIST PAGE ( ASPRUNNER 6.2)
bye

Sergey Kornilov admin 11/8/2010

That's exactly what supplied code does. You can insert it anywhere, on any page.

C
claudioparmelli author 11/9/2010



That's exactly what supplied code does. You can insert it anywhere, on any page.


Tanks, now the button is displaied in list page, but clicking on it there is no redirection. I see the hyperlink cursor on it, but nothing happen.
apologize me for noise.

Sergey Kornilov admin 11/9/2010

Claudio,
post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.