locked
Issue with ViewState when fetching an .aspx page inside a widget on another domain RRS feed

  • Question

  • User1749677234 posted

    I'm trying to get a ticket form that's part of a help desk web app to display in a floating widget. It works if the widget is on the same domain as the .aspx ticket page I'm trying to fetch, but if I put the widget on a different domain, then it doesn't work. There are two stages to the ticket form. First, you select a department, then it saves that and displays the rest of the ticket form. With the widget on a different domain after selecting the department the rest of the ticket form won't display. As I said, this works perfectly if the widget is on the same domain as the .aspx page I'm trying to fetch.

    I get an invalid viewstate error when trying to access the .aspx ticket page when the widget is on a different domain than the .aspx page that I'm trying to fetch. Any idea how to solve this problem?

    Tuesday, February 18, 2020 4:37 AM

All replies

  • User288213138 posted

    Hi 22878,

    I'm trying to get a ticket form that's part of a help desk web app to display in a floating widget. It works if the widget is on the same domain as the .aspx ticket page I'm trying to fetch, but if I put the widget on a different domain, then it doesn't work. There are two stages to the ticket form. First, you select a department, then it saves that and displays the rest of the ticket form. With the widget on a different domain after selecting the department the rest of the ticket form won't display. As I said, this works perfectly if the widget is on the same domain as the .aspx page I'm trying to fetch.

    I get an invalid viewstate error when trying to access the .aspx ticket page when the widget is on a different domain than the .aspx page that I'm trying to fetch. Any idea how to solve this problem?

    Is your domain on the same server? As far as I know, to read the ViewStete, you need to use machinekey to encrypt or hash data, and the machinekey is different for different servers.

    More information about machinekey you can refer to this link:https://docs.microsoft.com/en-us/dotnet/api/system.web.security.machinekey?view=netframework-4.8

    Best regards,

    Sam

    Wednesday, February 19, 2020 8:21 AM
  • User1749677234 posted

    Yes, both sites/pages are on the same server using the same instance of IIS. If I use the widget on site 1, which is the site that has the aspx page on it, then it works, but if I put the widget on site 2, then after selecting the department, the next step of the ticket form won't load. And in the logs it returns an invalid viewstate error. I think it's not saving the department selection, which it needs for the next step to load.

    Wednesday, February 19, 2020 5:28 PM
  • User288213138 posted

    Hi 22878,

    Yes, both sites/pages are on the same server using the same instance of IIS. If I use the widget on site 1, which is the site that has the aspx page on it, then it works, but if I put the widget on site 2, then after selecting the department, the next step of the ticket form won't load. And in the logs it returns an invalid viewstate error. I think it's not saving the department selection, which it needs for the next step to load.

    You can try to modify your machine key.

    About how to modify the machine key you can refer to this link: https://stackoverflow.com/questions/3290279/how-to-modify-machinekey-for-session-state-server

    Best regards,

    Sam

    Thursday, February 20, 2020 9:48 AM
  • User1749677234 posted

    I generated machine keys for one site then copied them to the second site. I checked and each site has the same keys in their web.config files, but it hasn't resolved the issue.

    Thursday, February 20, 2020 6:07 PM
  • User288213138 posted

    Hi 22878,

    I get an invalid viewstate error when trying to access the .aspx ticket page when the widget is on a different domain than the .aspx page that I'm trying to fetch

    Can you tell me how did you access the .aspx ticket page when the widget is on a different domain?

    Best regards,

    Sam

    Wednesday, February 26, 2020 7:35 AM