In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "how to implement the form POST to other pages in ASP.Net". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In ASP, we usually submit the form to another page (accept the data page). But in ASP.NET, server-side forms are usually submitted to this page, if I set the
The copy code is as follows:
Form1.action= "test.aspx"
Then it will result in the error of view validation error, because of the Asp.net security mechanism. We can also turn off this validation and add the header (test.aspx) to the acceptance page.
The copy code is as follows:
But this is not very safe. In fact, asp.net 2.0 also provides a way to submit to other pages. The server button control provides a property: PostBackUrl, which is written like this.
The copy code is as follows:
Button1.PostBackUrl= "test.aspx"
In this way, it will not cause the problem of validation errors, and it is safe.
-
By the way, there are some ways to dynamically modify form form properties, which have nothing to do with the above: for example, modify the target property
Normal page:
The copy code is as follows:
((System.Web.UI.HtmlControls.HtmlForm) this.FindControl ("form1")) .Target = "_ blank"
Or
The copy code is as follows:
Form1.Attributes ["target"] = "_ blank"
With master page master:
The copy code is as follows:
((System.Web.UI.HtmlControls.HtmlForm) this.Master.FindControl ("form1")) .Target = "_ blank"
Front desk modification:
The copy code is as follows:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.