button onclick method written in javascript
-
-
Hi, I have a button in my .aspx file and i have written a method called btnGetDetails() in javascript. But when i run the file, its saying ASP.something_aspx does not contain a definition for btnGetDetails(). Can anybody help me please........
scarface
You need to understand what happens on the server and what happens on the client. OnClientClick is what you want to call. Return false to stop a postback.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
Hi, I have a button in my .aspx file and i have written a method called btnGetDetails() in javascript. But when i run the file, its saying ASP.something_aspx does not contain a definition for btnGetDetails(). Can anybody help me please........
scarface
you need to call btnGetDetails() onClentClick event ,and stop the postback.... ;)
prabhakar dwivedi
-
Hi, I have a button in my .aspx file and i have written a method called btnGetDetails() in javascript. But when i run the file, its saying ASP.something_aspx does not contain a definition for btnGetDetails(). Can anybody help me please........
scarface
You can also do like this: YoubtnID.Attributes.Add("onclick","return btnGetDetails()"); Then put the code in Page_Load Event