May 21, 2013, 10:10 PM
v2.1.1 - FileUpload (bug?) and Disabled Fields
Hello,
I have found this issue on v2.1.1:
- By default disabled fields are submitted, but if you put a fileupload field inside a form tag all disabled fields are not submitted regardless of resource manager configuration.
Here's an example:
Now, if you put a fileupload field inside the form tag, for instance bellow the textfield:
<ext:FileUploadField runat="server" ID="fupload" />
and submit, the message shows the value ''.
Can you please provide a workaround this issue (i really need the disabled state instead readonly)?
Best regards.
I have found this issue on v2.1.1:
- By default disabled fields are submitted, but if you put a fileupload field inside a form tag all disabled fields are not submitted regardless of resource manager configuration.
Here's an example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestFileUpload.aspx.cs" Inherits="Test.TestFileUpload" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" SubmitDisabled="true" />
<ext:Button runat="server" Text="Submit">
<DirectEvents>
<Click OnEvent="Submit_Click" />
</DirectEvents>
</ext:Button>
<ext:TextField ID="txtField1" runat="server" Disabled="true"/>
</form>
</body>
</html>
Server-side code:using System;
using Ext.Net;
namespace Test
{
public partial class TestFileUpload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
txtField1.Text = "test123";
}
}
protected void Submit_Click(object sender, DirectEventArgs e)
{
X.MessageBox.Alert("Result", string.Format("Result: '{0}'", txtField1.Text)).Show();
}
}
}
In the above code you can see the message with the value 'test123' when you submit.Now, if you put a fileupload field inside the form tag, for instance bellow the textfield:
<ext:FileUploadField runat="server" ID="fupload" />
and submit, the message shows the value ''.
Can you please provide a workaround this issue (i really need the disabled state instead readonly)?
Best regards.