开发者

Access URL parameters from InfoPath form in XmlFormView

开发者 https://www.devze.com 2023-01-14 04:52 出处:网络
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 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开发者_C百科 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消