forum

Home / DeveloperSection / Forums / Javascript bottun click is not work in asp.net

Javascript bottun click is not work in asp.net

Anonymous User 1801 20-Nov-2014

I am trying to call from JS to C# function. I can not use ajax. I have tried to create a ASP.NET button when it clicked it calls the C# function and call the click function from JS:

On HTML:

<asp:Button runat="server" ID="UploadButton" OnClick="Upload_Click" />

JS:

alert("Before CLICK");
document.getElementById("UploadButton").click();
alert("After CLICK");
ASP.NET:
protected void Upload_Click(object sender, EventArgs e)
{
    //CODE
}

The problem is that the click event from JS does not working. I have tried to write after the first line of the JS code an alert to see if the code rich to that line but I can only see "After CLICK".


Updated on 21-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By