如何显示"成功"消息上提交? [英] How to show "success" message on submit?
问题描述
使用C#与ASP.NET,我怎么显示成功的消息时,我的用户提交表单?而在同一时间说的形象已经成功保存,用一个链接,使创建的图像可以通过点击链接来查看?
Using C# with ASP.NET, how do I show a "success" message when my user submits a form? And at the same time say "The image has successfully saved", with a link, so that the image created can be viewed by clicking the link?
推荐答案
总结表单中的< ASP:面板>
并创建另一个 < ASP:面板>
与可见=FALSE
为您的感谢消息。一旦提交表单,更改每个面板的知名度,表格设置为可见=FALSE
,并感谢消息面板可见=真
。
Wrap your form in an <asp:Panel>
and create another <asp:Panel>
with Visible="False"
for your Thank you message. Once the form is submitted, change the visibility of each panel, setting the form to Visible="False"
, and the thank you message panel to Visible="True"
.
希望是有道理的,这里有一个例子:
<asp:Panel ID="pnlFormFields" runat="server">
... form fields here ...
</asp:Panel>
<asp:Panel ID="pnlThankYouMessage" runat="server" Visible="False">
... Thank you message here ...
</asp:Panel>
那么你的$ C $内cbehind
protected void btnSubmit_Click(object sender, EventArgs e) {
// Hook up uploaded image and assign link to it
pnlFormFields.Visible = false;
pnlThankYouMessage.Visible = true;
}
这篇关于如何显示&QUOT;成功&QUOT;消息上提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!