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
HttpContext.Current.Request.UserAgent should work in that context.
Frederik
Thanks for your response Frederik. Unfortunately HttpContext is null
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