asp.net - jQuery and LinkButtons, or Regular Buttons and CSS -
On my master page I have a small login control on the login control, I am using a LinkButton for the submit button Because I like the way it looks.
However, I'm also using jQuery when pressing in any of the 'Enter' to capture the login control text box with the click of the link button with jQuery in every browser is difficult to trigger is. I've also tried hard-code __doPostBack, but LinkButton ID is just a little different from what is built on the control href = "__ doPostBack" attribute. It is not responding to .trigger (), click (), etc.
On the other hand, a regular button control works fine with jQuery click (). But the way I'm not a big fan of watching the button, and my CSS skills are limited. Is there a simple way to look like a normal ASP.NET button control like a link? Or is linkbutton an easy way to deal with jQuery? Whatever method I need to try less I :)
Thanks in advance.
You can get precise javascript by using the fire linkButton:
string postbackFunction = this.Page.ScriptManager.GetPostBackEventReference (myLinkButton, ""); String jQueryBlock = @ "$ ('# loginbox') Pressing key (function (e) {if (e.which == 13) {." + PostbackFunction + ";}}); // jQueryBlock print on page
This will output a JS function call that looks like this:
__ doPostBack ('linkButtonID', '', 0);
Comments
Post a Comment