views:

15

answers:

1

I have an InfoPath form with codebehind which is going to be hosted in an XmlFormView control on a page in a SharePoint 2007 site.

I will not be able to use codebehind on the page which is hosting the XmlFormView.

Is there any way to access the current HttpContext from the codebehind of the InfoPath form?

Or is there any way to obtain the parameters in the url of the page from within the codebehind of the InfoPath form?

A: 

Well, why don't u use e.InputParameters in FormEvents_Loading event? Something like that:

public void InternalStartup()
        {
            EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading);
}

public void FormEvents_Loading(object sender, LoadingEventArgs e)
        {

string someGETStringValue= string.Empty;

if (e.InputParameters.TryGetValue("SomeGETStringValue", out someGETStringValue)) {

}
}

Also, please, check out ahi acticle - LoadingEventArgs.InputParameters Property. I think it would be helpful.

avishnyakov
InputParameters works on a InfoPath web form, but unfortunately I couldn't get it to work in a InfoPath web form which is embedded in a XMLFormView. Did you manage to make it work in a XMLFormView?
marapet

related questions