Calling server-side code from client-side

Hi, 

I´m implementing some shortcut functionality in my web forms and wanna know where i can find something that explains, for example, how to call the handler event "onclick" of a button. I´m using this library to add shortcuts to my controls:

http://www.openjs.com/scripts/events/keyboard_shortcuts/

 

And I want to "link" some key combination for the event handlers of the controls.

Does anybody knows?

 Thanks.

0
braudes
6/25/2007 6:31:12 PM
asp.net.client-side 24353 articles. 2 followers. Follow

2 Replies
1526 Views

Similar Articles

[PageSpeed] 14
Get it on Google Play
Get it on Apple App Store

You could attach an AJAX event to the Javascript shortcut event handler so, for example, the shortcut function will trigger a button click which in itself is registered for an AJAX postback.  I tested it and it works...

<script>

shortcut("Ctrl+Shift+X",function() {

 

document.getElementById(
"Button1").click();

});

</script>

 

<asp:ScriptManager EnablePartialRendering="True" ID="ScriptManager1" runat="server" />

<asp:UpdatePanel ID="up1" runat="server">

<ContentTemplate>

<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

</ContentTemplate>

</asp:UpdatePanel>


"Never argue with an idiot; He will drag you down to his level and beat you with experience"
0
javiguillen
6/26/2007 3:43:19 PM

javiguillen,

thank you for the reply. It really works, but once per refresh. I wanna know what´s going on, because it executed once and after doesn´t work any more. I guess that the AJAX library are ovewriting the events used by the shortcut method. Can you or anyone give me some help? I tried to register the script via ScriptManager.RegisterClientScriptBlock but didn´t work either, because i was thinking that if I registered the script in every refresh I will have the shortcut method linked with the right event.

 Any help will be appreciate.

 Thanks

0
braudes
6/28/2007 3:04:31 PM
Reply:

Similar Artilces:

Is it possible to call client side function from server side code without initial client request?
Atlas is great. I'm using timer to periodically check database changes on server to populate client side controls with new data. Is it possible to do it without a lot of client requests to server which takes a huge useless network traffic? Server should call client side function on all connected clients when, for example, 'database updated' event occurs on server. Thanks. Hi~ Just for your interest, I think you could have a look at Comet, many web IM like Gmail's embeded Gtalk and meebo.com are built on this architecture你好! Just FYI o_O...

Problem call a server-side code from Client-side
Hi; I want to call a server-side code from client-Side at javascript function. must me use from Ajax or Http Requests in Javascript?   Thanks,mohsen  You'll have to make an AJAX call form your client side to acheive thisRegards,Muhammed Saleem P---------------------------------------------Please do not forget to click "Mark As Answer" on the posts that helped you.Happy Programming !!! I answered a question with sample code very similar to this one here: http://forums.asp.net/p/1358277/2799269.aspx#2799269 NC...  ...

call server side funciton from client side code.
how can i call a server side fuction which is a button click event "btnSave_click(object serder, EventArgs e) " from java script function ? there is an ifram on a master page, the javascript.js file is included on master page while the page that has function btnSave_click(object serder, EventArgs e) is loaded in iframe.  you just can'tasp.net is server side technologies and javascript a client side technologies the only way for the server to know what's happening on the client is to posback the page for instancethey are workaround to do thischeck out this post,...

Call client side function from server side code
My problem is that in some point of the VB.Net code I need to call a function defined in vbScript, for example: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click   'There's some code here....   ' ...   If (SomeCondition) Then   'HERE'S WHERE I NEED TO CALL THE JAVASCRIPT FUNCTION... SO HOW CAN I DO THAT?   Else     '...   End If   ' ... End Sub The asp.net code runs to generate the html and when it is done the html is rendered in your browser. So you can't access cli...

client side code & server side code
what is the difference between client side coding & server side coding ? when to use client side & server side code? Client side code runs on the user's browser and includes languages such as javascript and vbscript. Server side code runs on the web server and can be written in languages such as ASP.NET, PHP, ASP, ColdFusion etc. Website Design Darlington - http://mdssolutions.co.ukhttp://lessthandot.com - Experts, Information, Ideas & Knowledgehttp://aspnetlibrary.com - An online resource for professional ASP.NET developersPlease remember to click "Mark as Answer...

client side and server side code
Making things clear:When creating a web application one must know the difference between client side code and server side code.client side code is the code that is executed on the computer of the user. server side code is the code that is executed on the ....server.why is there client side code and server side code?well... server side code exist for the reason of sharing data with multiple users. for example: accessing a database.ASP.NET is a server side technology. in ASP.net you can use different languages such as VB.NET or C#.client side code is used to perform tasks on the computer of th...

Firing both Client side event and server side event for server side button
I am having some difficulties getting this to work.. I have button_click (Asp.net) and ClientClick (Javascript).  Javascript is firing fine.  Server script is not. may be you have return return false in the in the javascript which is why its not firing server side event.You should add javascript evelt like thisbutton1.onclientclick = "functionname" Function should nopt return false. Vikram www.vikramlakhotia.comPlease mark the answer if it helped you...

Execute the client side and server side code
Hi, Hi, I have two drop down lists one ddl1, ddl2. when ddl1 index is changed I have to change the label before the ddl1 and contents of ddl2. 1) to change the label before ddl2, I am using the javascript like this:ddl1.Attributes.Add("onchange", "changeLabelText(this); return false;"); Javascript function<script language="javascript"> function changeLabelText(ddl) { var indx = ddl.selectedIndex; var lbl = document.getElementById('<%= lblSelect.ClientID %>'); if(indx == 0) lbl.innerHTML = "Select A:"; if(indx == 1)lbl.i...

Client side to execute server side code
I am maintaining an ASP.NET C# application written by someone else.  I am essentially a newbie to web development especially client side stuff.  Based on reading these forums I understand that I can't directly call a server side method from the client side and I have to use post pack in some way (using a webservice is not an option here).  My confusion comes from the HTML setup being used.The page has three frames; a header, body and footer.  Each frame is filled by it's own ASPX page.  The footer contains buttons for navigating to another page and some of the b...

How to call server side function on client side
Hi,   How to call server side function on client side? here i want to call change() function on textbox onchange event.   <script language="javascript">    function serverfunction()    {    }    </script><input id="Text1" onchange="javascript:serverfunction();"  type="text" /> code behind:  public void change()    {        Response.Write("hello");    } <script type=&quo...

Call server side method from client side...
I'm using Jquery to call a modal popup dialog and depend on what user select i nead to call a method to populate my generic list can that be don or is no posible way to do that...     Sorry for my bad english...Florim Maxhuni  If you need to call the server from the clientside, you need to look into Ajax Eric Pascarello.com | Twitter epascarello | LinkedIn...

Calling server side scripts from client side
Hello, Can Anyone help out from the following : It is regarding calling server side scripts from client side events. I am able to instantiate a jaguar component in the server side script written in the body of the HTML page as follows : <% var mycomp = java.CreateComponent ("pkg_dispatch/n_jaguar", "iiop://jaguar:9000", "Jagadmin", "" ); if (mycomp == null) { document.writeln("ERROR: failed to instantiate !"); return; } %> I want to use the instance of the jaguar component else wher...

How to Excecute Server side code in Client Side
I have a Textbox with linkButton on right side.  if i click linkbutton i have one text box agian in poup. if we enter some text and click search button i am showing ListView with searched data in Poup. the Listview contains one Radio Button at eash row. Now my request is if i select one radiobuton and click "OK"  the poup should close and display the selected row text in TextBox in my Page where the Linkbutton Presents. i can do it on my server side on "Okbutton_Click" . i wabnt to do this in Client side only with out PostBack.   Is ther...

Call Server Side methods from Client Side
Hi, How to call Server Side methods from ClientSide with results back. Earlier we were using Anthem approach but now want to use some thing with AJAX. Thanks in Advance.  RegardsSreenivas. you can use the page methods of the ClientScript  control ,please read  : http://aspalliance.com/1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE...

Web resources about - Calling server-side code from client-side - asp.net.client-side

Server Side Includes - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Google Cloud Platform simplifies server-side development for iOS w/ ‘Mobile Backend Starter’
... Mobile Backend Starter that first debuted for Android developers back in June. Google says the application helps to simplify the server-side ...

Free Cooling: the Server Side of the Story
Servers that support higher inlet temperatures could significantly reduce or even eliminate the cooling costs of the data center. We received ...


[Update: Check Now] Play Store For Android Gets Search Bar With Hamburger Flip In Server-Side Update
Google is pushing out an update to the Play Store's Android interface that replaces the action bar with a standard search bar. Inside are the ...

Server-side update makes Siri a stickler for succinctness
Siri is already well known for her wit and willingness to joke, but a recent server-side update has given Apple's digital assistant the ability ...

Japanese RIAA wants server-side music DRM for mobile phones
The Recording Industry Association of Japan—the Japanese version of the RIAA— …

New BaaS platform aims to eliminate writing server-side code
... offering for desktop and mobile developers that's now leaving its beta phase. By removing the need for writing code on the server-side, Backendless ...

Dart improves async and server-side performance
... Team Today's release of the Dart SDK version 1.3 includes a 2x performance improvement for asynchronous Dart code combined with server-side ...

Customize Google Using Server-Side Scripts
Google's services have a lot of powerful features, but they can't offer all the options requested by users. A popular way to customize Google ...

Resources last updated: 1/16/2016 3:54:38 PM