Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Recording User Agent string in XForms


Hi all

I'm trying to record the user agent string in an xform and gettin git to include it in the generated email. So far I am trying this

        public void control_BeforeSubmitPostedData(object sender, SaveFormDataEventArgs e)
            var formData = e.FormData;
            formData.SetValue("User Agent", Request.UserAgent);

in global.asax.cs. Unfortunately the Request object isn't valid in this context so I'm stuck at this point

My only other thoughts are

1. Some javascript to squirt in a hidden field into form with user agent and let it submit. Seems like it would be very fragile

2. Get the xform to redirect to a custom url and generate the email manually. Mmm - that doesn't sound good

3. Declare it impossible

I'd be grateful for any thoughts or advice

Many Thanks



Nov 13, 2013 15:53

HttpContext.Current.Request.UserAgent should work in that context.


Nov 14, 2013 9:55

Thanks for your response Frederik. Unfortunately HttpContext is null

Nov 14, 2013 12:11
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.