I am trying to implement an Ajax.Beginform on my page but when I try to run the code, on postback I get the following alert
htmlfile: Unknown runtime error
I've tried trawling the web for a solution but no joy so far. Seems the problem is caused uite often by having multiple forms on the page but the Ajax form is the only one I have on there. My code is as below
<% Using Ajax.BeginForm("About", New AjaxOptions With {.UpdateTargetId = "divChart"})%>
<input type="submit" value="ChangeChart" />
<div id="divChart">
--Contains html
</div>
<%
End Using%>
Any ideas what could be causing this? Cheers
for anyone still interested, I dont have/know/understand the solution, but have found what seems to work for my implementation.
For me, moving the div tags (of the section you are trying to replace) outside of the ajaxform declaration seems to fix the problem. So for the above example:
<div id="divChart">
<% Using Ajax.BeginForm("About", New AjaxOptions With {.UpdateTargetId = "divChart"})%>
<input type="submit" value="ChangeChart" />
<!--Contains html -->
<%
End Using%>
</div>
I don't know why. Also I would think this probably wouldn't necessarily get along with the your intended design of the page...
Also this post seems to have some insight.
Hope that helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With