PDA

View Full Version : [CLOSED] Ext.NET 2.0 breaks ASP.NET RegisterHiddenField method



jchau
Nov 20, 2012, 9:14 PM
Not sure how you guys were able to hijack asp.net's RegisterHiddenField method but if a page contains Ext's ResourceManager, calling Page.ClientScript.RegisterHiddenField will not output the field to the client. Remove Ext ResourceManager and it's all good.





Private Sub Test30_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Me.ClientScript.RegisterHiddenField("testhid", "1")
End Sub

geoffrey.mcgill
Nov 20, 2012, 9:21 PM
The field might be getting parsed out when we do a final clean-up of all garbage html produced by asp.net.

Are you just calling RegisterHiddenField during the Page_Load?

jchau
Nov 20, 2012, 9:26 PM
The field might be getting parsed out when we do a final clean-up of all garbage html produced by asp.net.

Are you just calling RegisterHiddenField during the Page_Load?

I am actually calling it during PreRender but I also tried Page_Load and they both failed.

Vladimir
Nov 20, 2012, 10:38 PM
Thank you for report. We will investigate it.
At this moment, I suggest to deactivate viewstate removing as workaround


<ext:ResourceManager runat="server" DisableViewState="false" />


I will post here when a fix will be available in SVN

Vladimir
Nov 20, 2012, 10:51 PM
Another workaround,
- find the following line in Ext.Net\Core\ResourceManager\ResourceManager.cs and remove it


writer.Write(ResourceManager.RemoveBlocksToken);

jchau
Nov 21, 2012, 7:46 PM
I think this issue existed in Ext.NET v1.x too but by default viewstate was not disabled. So yes, once I turned back on viewstate for that one page, everything works fine.

I still think this should be fixed for compatibility with 3rd party controls. Alot of older 3rd party controls do use RegisterHiddenField. We only use that control on one of our pages so it wasn't a big deal to turn on viewstate for that one page.

geoffrey.mcgill
Nov 21, 2012, 7:48 PM
I still think this should be fixed for compatibility with 3rd party controls.

As noted above, we are working on a fix.

Daniil
Nov 22, 2012, 12:14 PM
Hi @jchau,

It was fixed in v2. The fix will be included in the upcoming v2.1 release. Thanks again for the report.

I was unable to reproduce it in v1 with the following sample. Could you provide a test case to reproduce?

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
this.ClientScript.RegisterHiddenField("hidden1", "1");
}
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" DisableViewState="true" />
</form>
</body>
</html>