Some time ago with the kindeditor-3.4 this js Rich Text Editor! I used <asp: LinkButton/> to submit the file and cannot get the value! Depressed for a long time! Later, a colleague of mine changed the LinkButton into a Button to get the value! (Though you may not believe it), I don't believe it either. I don't know how he thinks that the LinkButton is changed to the Button. I always thought there is no difference between them! At least the difference is not that big! Facts are facts. The difference between Google and Google.
Code:
<div> <asp:Button ID="Btn" runat="server" Text="Button" /> <asp:LinkButton ID="Lbtn" runat="server">LinkButton</asp:LinkButton> <asp:ImageButton ID="ImgBtn" runat="server" /> <asp:HyperLink ID="Hlink" runat="server" NavigateUrl="~/TestButton.aspx">HyperLink</asp:HyperLink> </div>
Generate the customer service code after running:
There is no difference between Button and ImageButton. The form is submitted directly! LinkButton is A tag that uses JS to manually submit A form and assigns the Control ID to _ EVENTTARGET. Other controls do not assign values! HyperLink is just A redirection, just like the tag on the customer service end! In fact, I still did not clarify their differences here. If kindeditor is used in your project, please note that!
Microsoft msdn:
Note:
The LinkButton control presents JavaScript to the client browser. The client browser must enable JavaScript to make the control work normally. For more information about client scripts, see client scripts on the ASP. NET web page.
Warning:
This control can be used to display user input, which may contain malicious client scripts. Before displaying any information sent from the client in the application, check whether they contain executable scripts, SQL statements, or other code. ASP. NET provides the input request verification function to prevent users from entering scripts and HTML. The server control is also provided to verify user input. For more information, see verify the Server Control syntax.
By default, page verification is performed when you click the LinkButton control. Page verification determines whether the input control associated with the verification control on the page passes the verification rules specified by the verification control. To disable page verification, set the CausesValidation attribute to false.
In addition, when we click Button, LinkButton, ImageButton, and HyperLink, a dotted line (box) may appear. Here we will solve this problem for you!
Introduce JQuery js first!
<Script src = "js/jquery.3.2.min. js "type =" text/javascript "> </script> <script type =" text/javascript "> // function onloadFun () {if (window. $) {$ (document ). ready (function () {/* remove the dotted box when tag A, Button, and imageButton are clicked */$ ("a, input [type = 'click'], input [type = 'image'], input [type = 'submit '], area, img "). bind ("focus", function () {if (this. blur) {this. blur ();}})})}
} onloadFun(); </script>
The above test is feasible! Clicking the dotted line is indeed gone!
Technorati labels: js, Button, LinkButton