Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Event not fired

Dear,
I do not know why event cannot be fired below, after having clicked the button.

<input type="submit" name="LoginButton" value="登录" id="LoginButton" class="LoginButton" onclick="LoginButton_Click" style="font-weight: bold; position:fixed; top:30%;left:50%; z-index:1000"/>

Open in new window

Avatar of HainKurt
HainKurt
Flag of Canada image

link please...

if this is a client side, you should use

onclick="LoginButton_Click()"
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peter Chan

ASKER

I do not use

<asp:button ...

Open in new window

due to that I want to put style to it. And AutoEventWireup is not available to this "<input ..." line.
I do not use

why?

<asp:button id="LoginButton" runat="server" style="...you can add style here..." cssClass="your_button_class_here" ...>

Open in new window


then

LoginButton_click(...)

Open in new window


will be automatically fired!
Avatar of Leonidas Dosas
Check if the LoginButton_Click() function is defined in the global context.If not then you can do the following:
window.LoginButton_Click=function(){
//your code here...  
};

Open in new window

Obviously the wired event is a server side event, so you should use <asp:Button....> instead of the normal input, and for the styling, why don't you wrap all the these css rules into a proper class and just assign it to the button using the CssClass attribute.
You can also assign the style attribute to an asp server control using jQuery or plain JavaScript , you will just have to assign an ID to the button and set ClientIDMode="Static".

If you insist for some reason to use html control, you can submit your form via ajax.