•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 401,685 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,646 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 49700 | Replies: 3
![]() |
Not directly, no. Server-side functions live server-side, client-side functions live on the client.
In fact, the only way to get ANY server-side code to run, is to submit the form. ASP.NET unrolls the HTTP headers, unpackages the hidden ViewState variable, re-instantiates objects, and then decides what events to raise based on all of the above.
What you can do is have your JavaScript function set a hidden form variable, then do a form.submit().
Then, in your Page_Load handler on the server, use the Request object to check for the presence and/or value of this variable, and call the appropriate server-side method.
In fact, the only way to get ANY server-side code to run, is to submit the form. ASP.NET unrolls the HTTP headers, unpackages the hidden ViewState variable, re-instantiates objects, and then decides what events to raise based on all of the above.
What you can do is have your JavaScript function set a hidden form variable, then do a form.submit().
Then, in your Page_Load handler on the server, use the Request object to check for the presence and/or value of this variable, and call the appropriate server-side method.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- ASP.NET and JavaScript (ASP.NET)
- How to transfer values between ASP.NET pages (ASP.NET)
- variables from javascript in asp.net (ASP.NET)
- help with asp.net/JS and cookies (ASP.NET)
- Javascript:How to transfer values between ASP.NET pages (JavaScript / DHTML / AJAX)
Other Threads in the ASP.NET Forum
- Previous Thread: indeterminate progress bar
- Next Thread: video conferencing




Linear Mode