November Happy Hour will be moved to Thursday December 5th.

XForm even (BeforeLoadingForm ) is not firing

Vote:
 

In the start page, am able to display XForm property however, the event(BeforeLoadingForm ) in XFormInitialization is not firing up when form loads. Any specific reason not firing?? or am i missing anything in the configuration. Basically i need to modify the form before it shows up.

[InitializableModule]

[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]

public class XFormInitialization : IInitializableModule
{
public void Initialize(InitializationEngine context)
{
XFormControl.ControlSetup += XFormControl_ControlSetup;
}

void XFormControl_ControlSetup(object sender, System.EventArgs e)
{
XFormControl control = (sender as XFormControl);
control.BeforeLoadingForm += control_BeforeLoadingForm;
}

void control_BeforeLoadingForm(object sender, LoadFormEventArgs e)
{
//hidden..!
}
public void Preload(string[] parameters) { }
public void Uninitialize(InitializationEngine context){}
}

Thanks in advance.

#120678
Apr 22, 2015 13:03
Vote:
 

Hi Raghu!

Is this an MVC based site? The event in question is only valid for WebForms and I'm not sure if there is a corresponding event for MVC.

#120683
Apr 22, 2015 13:30
Vote:
 

Yes, its an MVC based site. Any ways , if i want to modify my xForm before loading whats the best pratiese??

#120686
Apr 22, 2015 13:43
Vote:
 

Hi!

I checked a bit more and there is no direct match to the Web Forms event. What is it you are trying to achieve? Knowing that might make it easier to suggest an approach.

#120690
Apr 22, 2015 14:16
Vote:
 

Am actually want to replace text box with file upload control , when ever I find perticular css class name in text box control .

#120778
Apr 24, 2015 8:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.