Developer forum

Forum » Development » Modules and frontend forms

Modules and frontend forms


Reply

Hi,


 


Can anybody tell me how to make a frontend form, which on submit triggers a method in my module? Seems like its not possible using simple postbacks - but maybe im wrong?!


 


If you have a simple example module I can have a peek at I would be gratefull...


 


thanks in advance


Replies

 
Nicolai Høeg Pedersen
Reply
rjm wrote:


Hi,




 




Can anybody tell me how to make a frontend form, which on submit triggers a method in my module? Seems like its not possible using simple postbacks - but maybe im wrong?!




 




If you have a simple example module I can have a peek at I would be gratefull...




 




thanks in advance





Hi


 


For the time being it is not possible to create an asp.net webform (

) and use the built in postback mechanism to fire methods. It will be there soon though.


 


That does not mean it is not possible - it just has to be done the "old way".


 


In a Default Custom module project, you have a hook In Default.aspx.vb/cs on the CMEvent which calls a method in your module which then returns a string of HTML generating the module output. In that method you can call different methods based on postbacks og querystring values:


 


Like this:


 


public string Render(DataRow ParagraphRow, Dynamicweb.Frontend.PageView Pageview)


{


if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString("DealerID")))


{


int DealerID = (Int32)HttpContext.Current.Request.QueryString("DealerID");


return Show(DealerID);


}


else


{


return List();


}


}

 
Reply

Hi,


 


Thanks for your answer. It was the approach I'we taken, but nice to know that it was the right way...

 

You must be logged in to post in the forum