AI OnAI Off
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.
Yes, its an MVC based site. Any ways , if i want to modify my xForm before loading whats the best pratiese??
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.
Am actually want to replace text box with file upload control , when ever I find perticular css class name in text box control .
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.