[Gambas-user] How to load a new page on gb.web by code

T Lee Davidson t.lee.davidson at gmail.com
Wed Sep 20 16:24:12 CEST 2023


On 9/19/23 16:10, Mayost Sharon wrote:
> Hello first thanks But I tried to put the code as you say, and it's still not good. 1. When I click the button on the second 
> page it returns to the Main.webpage page 2. It is very inconvenient to write a lot of code inside Wabpage because if you can't 
> stop and check for bugs, etc. Maybe I don't understand the process of the gb.web, but my expectation was that every page when I 
> click on submit buttons that are supposed to perform an action should have been conducted on the page itself that was loaded, 
> unless I specifically say in the action to go to another page What I currently understand is that every time he performs an 
> action he always returns to the main page The question is, does it have to be this way? Thank you

Well, since I don't have time at present to analyze the gb.web code to determine how to answer your original question posed in 
the subject line, all I can suggest at the moment is that you use Javascript to validate the form data prior to it being 
submitted, and use Main.webpage as a main controller similar to this:
<%
   If Request.Post.Fields.Count > 0 Then
     Select Request.Post["gb_action"] ' gb_action will be defined differently in each distinct page
       Case "Webpage1"
         'Render or Include Webpage1
       Case "Webpage2"
         'Render or Include Webpage2'
     End Select
   Endif
%>


-- 
Lee



More information about the User mailing list