In my current project using ASP.NET, I have a MasterPage that includes a navigation bar with different options. One of the options leads to another page where the company now requires me to pass a parameter through the link. After some research, I managed to set up a property in the Main.Master class to handle this. However, the tricky part is that the parameter needs to be based on the value selected from a dropdown menu on the main page, and it should update the property as soon as a selection is made by the user.
The challenge arises because I can't utilize the onChange event directly due to the element not being an ASP component. Additionally, the element must remain unchanged for compatibility with an API (Select2) which requires it to be a regular HTML element. If there is a workaround for this issue, I would greatly appreciate any insights or suggestions.
I attempted to retrieve the selected value using JavaScript and then pass it to the master page through AJAX, but encountered difficulties as it only allowed me to call a static method. Unfortunately, a static method cannot make use of the MasterType reference required to modify the Main.Master file.
Therefore, I am seeking advice on whether there is a feasible solution to achieve the desired functionality. I apologize for not providing code snippets, as this information is considered confidential.