call a server side function from javascript function

hello i have apage that is contained in MasterPage (contents)

i have a HyperLink and i want to call a serverside function

is it possible?

i am writing C#


If i helped you please mark as answered..
3/25/2008 3:07:14 PM 93655 articles. 6 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 24

in your page_load event, you can reference controls on the masterpage by



Peter Kellner and blogging at
3/25/2008 3:09:04 PM

 Use the "LinkButton" control...  Looks the same as a hyperlink, acts the same, and you can catch events from it.

3/25/2008 3:14:27 PM


ok this is the scenario...

i have a textbox that you could enter date.

if the date is not valid so a validator is raised.

and when i want to click a button that has to clear all fields so the validator dose not let me submit.

SO that is why i want to change the button to hyperlink and call the js function and from the JS function call server side func

i know this is a mess but any solution is welcome.


If i helped you please mark as answered..
3/25/2008 3:27:18 PM

 If you want a button NOT to execute your validators, you can just set "CauseValidation" to false.  If you then click your button, it will ignore validators even if they would normally interrupt your program.

3/25/2008 3:47:48 PM
thanks nirniron
If i helped you please mark as answered..
3/26/2008 5:51:40 AM

Similar Artilces:

How to call server side(C#) function from Client side(Javascript) function?
Hi i have used below functions,  function HandleOnClose() {// this function will be called after clicking browsers close button in Internet explorer if (event.clientY < 0) { event.returnValue = 'Are you sure you want to leave the page?'; } // if he clicks ok then i need to call one server side function in this instance.. else not. } <body onbeforeunload="HandleOnClose()" leftmargin="0" rightmargin="0">other controls in page..</div>  How to achieve this? Thanks MS AJAX Extensions would be the option of choice here. Combined with webservices you can...

how to call server side function in javascript function
right now I have a question. I have a javascript function which created a textfield. what I want to do is when the user type in the value into the textfield, it will call the function in the server side and search the data in the database. I wonder is it possible to do that? And how to do it, can anyone some me some example..thx    look into ajax autocomplete Liming XuJumptree ASP.NET 2.0 Project Management - With Source Code, Free to Non Profit Org and Effectively Manage Projects/Tasks/Milestones Superwong-You definitely want to use Ajax (as was suggested). Since you're u...

How to call a javascript function from a server-side function
Hi. I'd like to know if it's possible to call a javascript function from within a server-side function. I know it's possible to associate a javascript function with a control event but I'd like to call it from within an function.  Thanks, Samir Zattar Hey, There are several ways to do it, all through the Page.ClientScript property.  You can write a script through RegisterClientScriptBlock or RegisterStartupScript, or if you have a script file you can write a reference to that file.Brian"Trust in the Lord and do what is good; dwell in the land and ...

How to call server side function by javascript using Ajax.Net
Sir, I want to call the server side function by javascript function. Is it possible using Ajax.Net (System.Web.Extensions.dll or AjaxControlToolkit.dll)? If yes then please give me the code or URL. I found some article using Ajax.dll but I want to use System.Web.Extensions.dll or AjaxControlToolkit.dll. Please help me. Thanks in advance Paresh        Hi, Ajax.NET and ASP.NET AJAX, what you want, are completely different implementations so please be sure to use the correct terminology in the future as there are already 100+ AJAX frameworks aroun...

i need help --can i call function written on server side insid (run at server) inside function written on clinet side
hi every one.i am using java script to call  setTimeout() functionand i want to call myfunction () inside setTimeout()setTimeout(myfunction(); time)but the myfuction() is written in Codebehindplease i want to know if i can do that if it is possible, how i can do that This might work:<JavaScript>setTimeout("timedFunction()", time) function timedFunction(){ __doPostBack('TimerFunction', '');}</JavaScript> // CodeBehind Page_Load event handlerprivate void Page_Load(object sender, System.EventArgs e){ // Insure that the JavaScript __doPostBack method is a...

Call javascript function from a server function
Hi, I have as server button on the page and onclick i am calling a server function (check()) In between the function how to call the javascript function <script runat=server> Function check() Some code here ************* CALL JAVASCRIPT FUNCTION HERE************ End Function </script> Can any one help me please Thanks Why do you need to call the javascript. Can't you implement javascript's logic in your language(VB)? Also, javascript can be server or client side. Problem is, you cannot use both Javascript and VB as the server script so you...

Call server side function from client side javascript
I have a javascript where I either need to call an onclick even of a server link button or I need to be able to call a server side function.   The only thing is I cant use AJAX.  Is there any way I can do this or am I spinning my wheels. Thanks!-------------Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. I have a similar problem.  In my case, I would like to set a server-side session object from JavaScript.  Any suggestions?  Thanks.  Dan Sure, y...

How to call server side function from client side JavaScript?
I want to call a server-side function, like a button's click event or just another private or public function , from a client-side JavaScript function. How do I do that? thanX AnzIf this post was useful to you, please mark it as answer.ClientSideAsp.Net | Blog Maybe alittle more that you need, but....... 1) Put a button on the page. Lets say its id is Button1. Make sure that its has causesValidation=false 2) Write the code for the button. 3) Write the following in the PAge_Load event Button1.Attributes.Add("onClick", "myJSFunction(); return false") 4) Copy this javascript...

how to call server side function from client side javascript?
Hi all, I have a image button in the update panel. I would like to call a method from server side (not from webservice) to get the variable when Onclick on the image button is invoked. Is there any way that I can able to access this function from the client script? In using the UpdatePanel, in essence, you're already doing this because there will not be a full postback.  You can make an asynchronous call to your Click method of your ImageButton.  So, what do you want to do with this "variable"?Christopher Reed"The oxen are slow, but the earth is patient."...

Can you call a c# on the server side from javascript functions on client side
Hello guys This is something intresting I have come across during development. I have a javascript written in a .JS file , to my knowledge the .js files are executed on the server side. But security concerns with java script that these .js files can be access by connecting to port 80 of the server . So an ultimate alternative reminas to call c# code from a java script function. Can anyone Help me on this matter Regards Nihar Hi Nihar, Usually .js files executed on client side. Please explain your configuration.Leon LangleybenMCSD, ASP.NET MVPBlog...

How to call server side function in javascript
HiI have created a function called "function1" and i want to call it in java script when user select the choice "ok" in confirm box.How to do it?Please HelpThanks in anticipation.Kapil Naker okButton.Attributes.Add("onclick", "JavaScript:function1()");NC... thanks for your tip Sorry but I could not explain my problem properly. Let me explain again. I have one server side function say "serversidefunction()". Now I want to call that function in java script but only after user click java script's confirm "ok" option. I have used the code as follows <scr...

Calling a server side function with javascript
I have some client side code I need to run, and depending on the outcome I need to execute a specific function on the server side? Is there an easy way to do this? Currently I am setting up a text box (hidden) with a string, then submitting the page, and on the page_load on the server I check the string to see what function to call. This is working, but I was wondering if there was a more direct way to do it. thanks -- Jean.Jean Hi Jean, I'm sure there is a much more elegant solution that can be used, could you share more information about what exactly you are doing?Ask and it will b...

call javascript after server side function
Hi I've created a modual dialog window to collect user data. What I want to be able to do is add the data to the database and then close the window passing a calue back to the parent page. I can get each individual part to work on their own, but I can't get the javascript to activate after the server side function. The code is: Private Sub btSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btSubmit.Click 'function to add data to db  addAction() 'close window and pass value back to parent Dim strScript, strKey strKey = "AddAction" strScript = "...

Call Server Side Function from Javascript
I wan to call Serverside function from Javascript function . We can use it by using AjaxPro.dll Assembly. Can anybody have an idea how can we do that in new extensions. I dont want to use Webservice . just want to call the web page class fucntion from html page using javascript. use PageMethods.   there's a tutorial for it under the /docs web services section (all the way at the bottom).  Basically, you flag a public static method in your codefile with the WebMethodAttribute and then your javascript can find it by claling PageMethods.myMethodName(params,...

Web resources about - call a server side function from javascript function -

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

Lightbox (JavaScript) - Wikipedia, the free encyclopedia
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
about dmoz - help Top : Computers : Programming : Languages : JavaScript : Tools : Obfuscators Tools for obfuscation/compression JavaScript code. ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript SDK - Facebook-Entwickler
Overview The JavaScript SDK provides a rich set of client-side functionality for accessing Facebook...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken .… ...

Resources last updated: 12/12/2015 8:28:56 AM