当使用 Azure 应用服务部署到 Web 服务器时,MaxRequestBodySize 不起作用,但它在我的本地工作。我尝试对 .net core 3.1 的program.cs 和startup.cs 进行以下更改,但没有一个起作用。仍然收到 413(请求实体太大)错误。
Program.cs:
1. webBuilder.ConfigureKestrel(serverOptions =>
{
serverOptions.Limits.MaxRequestBodySize = long.MaxValue;
})
2. .UseKestrel(options =>
{
options.Limits.MaxRequestBodySize = long.MaxValue;
}
Startup.cs
services.Configure<IISServerOptions>(options => options.MaxRequestBodySize = long.MaxValue);
Run Code Online (Sandbox Code Playgroud) 如何从 ant d 模态隐藏顶部的 X 按钮,以及如何禁用使用 ESC 键关闭模态的行为
return (
<Modal
title={modalHeader}
okText="EXIT"
cancelText="CONTINUE"
visible={visible}
onCancel={onCancelHandler}
onOk={exitUser}
width={600}
cancelButtonProps={{hidden:isExFlag}}
>
<DescriptionParagraph>
{modalBodyText}
</DescriptionParagraph>
</Modal>
);
Run Code Online (Sandbox Code Playgroud) 我有一个 antd Modal,我正在尝试验证一个字段并为其提供验证。如何根据验证启用/禁用“确定”按钮。如果验证成功,则应启用按钮,否则应禁用。
<Form>
<Modal
title={modalHeader}
okText="ADD FIELD"
cancelText="CANCEL"
visible={visible}
onCancel={onCancelHandler}
onOk={() => onAddFieldHandler(fieldName)}
width={600}
okButtonProps={{disabled:true}}
>
<p>Please provide name</p>
<Form.Item
name="fieldName"
rules={[{ required: true, message: 'Please enter name' }]}
>
<FieldNameInput
placeholder="Field name..."
value={fieldName}
onChange={(event) => setFieldName(event.target.value)}
/>
</Form.Item>
</Modal>
</Form>
Run Code Online (Sandbox Code Playgroud)