Description of bug
When the querystring looks like this: ?asid=2&rrid=3&apid= the ScriptResource.axd is failing in browser console when loading the page.
Steps to reproduce
List the steps to reproduce the behavior:
- Go to any page with a querystring that ends in
id=
- Open the browser console
- Find the error from ScriptResource.axd
- Go to "Elements" and see the DOM of the page
- Find
<form method="Post" .. > just under <body id="Body" ..> (practically, the form of the page)
- Notice the form element looking like this:
<form method="post" action="/en-us/Assessments/Take-Assessment?asid=10&irid=15&rmp=3&rrid=&apid=" form"form" enctype="multipart/form-data">. More exactly the form"form" part of the element
Current result
The ScriptResource.axd is failing on page load
Expected result
ScriptResource.axd should not fail at all
Error log
ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5 Uncaught TypeError: Cannot read property 'onsubmit' of null at Sys.WebForms.PageRequestManager._initializeInternal (ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5) at Function.Sys.WebForms.PageRequestManager._initialize (ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5) at Take-Assessment?asid=10&irid=15&rmp=3&rrid=&apid=:567
Additional context
Looking through the source where this might happen, i have found the code in class DotNetNuke.Common.Controls.Form in the file ActionLessForm.cs where the Form control id is rewritten in an old way which is based on finding the string id=" on the line 54.
See the ActionLessForm.cs code
Affected version
Tested only with 9.2.2 but seeing the blame makes me think that this might occur on older versions too.
Description of bug
When the querystring looks like this:
?asid=2&rrid=3&apid=the ScriptResource.axd is failing in browser console when loading the page.Steps to reproduce
List the steps to reproduce the behavior:
id=<form method="Post" .. >just under<body id="Body" ..>(practically, the form of the page)<form method="post" action="/en-us/Assessments/Take-Assessment?asid=10&irid=15&rmp=3&rrid=&apid=" form"form" enctype="multipart/form-data">. More exactly theform"form"part of the elementCurrent result
The ScriptResource.axd is failing on page load
Expected result
ScriptResource.axd should not fail at all
Error log
ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5 Uncaught TypeError: Cannot read property 'onsubmit' of null at Sys.WebForms.PageRequestManager._initializeInternal (ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5) at Function.Sys.WebForms.PageRequestManager._initialize (ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5) at Take-Assessment?asid=10&irid=15&rmp=3&rrid=&apid=:567Additional context
Looking through the source where this might happen, i have found the code in class DotNetNuke.Common.Controls.Form in the file ActionLessForm.cs where the Form control id is rewritten in an old way which is based on finding the string
id="on the line 54.See the ActionLessForm.cs code
Affected version
Tested only with 9.2.2 but seeing the blame makes me think that this might occur on older versions too.