Need to send a id string from client side to server side and fire a event

Hi Everyone

I'm having a problem with my ajax script. I'm trying to send a  id string from client side to server side and want to fire a server side event. I have no clue how to do this. Can anyone point me in the right direction ?

0
knutzzi
2/26/2007 1:49:30 PM
asp.net.networking-webservices 2181 articles. 0 followers. Follow

2 Replies
1184 Views

Similar Articles

[PageSpeed] 2

Take a look at the GetWebRequest, PostWebRequest, and OnWebRequestCompleted JavaScript samples in the AJAX documentation.

Lambert

0
Lambert
2/26/2007 4:23:19 PM

You can add static page methods to an ASP.NET page and mark them as Web methods. You can then call these methods from script as if they were part of a Web service, but without creating a separate .asmx file. To create Web methods in a page, import the System.Web.Services namespace and add a WebMethodAttribute attribute to each static method that you want to expose. To use the static page methods as Web methods, you must set the EnablePageMethods attribute of the <ScriptManager> to true.

http://ajax.asp.net/docs/tutorials/ExposingWebServicesToAJAXTutorial.aspx


Aleksey Fomichenko
Senior Consultant
0
alesha911
2/28/2007 11:05:54 PM
Reply:

Similar Artilces:

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...

How to fire a server side Sub after client side event?
Hi,  How can i fire a server side event after a client side event..? For example, just an example, i want to show a "message box" - The debugging one: MsgBox(stuffs), or calls any other functions which requires the clicked button's id? I took a look on stuffs like getPostBackEventReference()... Did i in the wrong way? Any help or quick sample would be very much appreciated!! :D Hi, you can call the doPostBack (first argument is the control-Id) method, see my code snippet:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Testpage.aspx.cs" Inhe...

what client-side and server-side events are fired when button X is hit?
Folks,In a web aspx page, I use a client-side (javascript) button named "Cancel" so when users hit it, if the data they enter is not saved yet, then this client-side button prompts users to save data before the page is closed. I code this client-side button with event "onclick" and thing like <input type=button ... onclick="btnCancelClick();" >   My question is if users hit the right top corner button X (next to the maximize and minimize buttons also on the top right corner of the aspx web window page), then what client-side (javascript) and serv...

Help with client side events Vs. server side events
Hi, Can someone look as the following script and tell me why marking the check box doesn't generate a client side event eventhough there's: onclick="checkClick()"? marked.  Thanks in advance, Sivan <%@ Page Language="c#" %><HTML> <HEAD>  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body>  <SCRIPT language="c#" runat="Server">  void Page_Load(object s, EventArgs e) {  if (!Page.IsPostBack)  {   Label1.Text = Label...

client side click handler / server-side command event doesn't fire
I am rewriting an old control of mine to be more AJAX-friendly. It is a subclass of Button that disables itself when clicked, so that the user can't, say, double post a credit card payment. I have some javascript code for the prototype including this: _onClick : function(e) { if(this.get_element() && !this.get_element().disabled && this._DisableAfterClick == true) { this.get_element().disabled = true; if (this._DisabledText != null && this._DisabledText.length > 0) { this.get_element().value = this._DisabledText; } } //this.get_element().form.s...

Client Side events and Server side binding
I want to filter a dataset, server side and bind it to a select control. Problem is my filtering must be done based on the text written by the user in a text input. To get this text i'm using client side keyboard events. I tried to use client side binding and it works fine, but the problem is my dataset has more than 10000 rows, and so the performance is awful. Only thing i can do i think is to rebind the select control to a filtered dataset, improving performance. This is my code at the moment: In the aspx: static HtmlSelect _control = null; [WebMethod(EnableSession = true)] publi...

Client side/server side event race.
 Hi.  I've got a page that 1) Takes some text fields as input2) Does some math calculations on the input (server side via a "calculate" button click)3) Then opens a new window with some detailed information (client side, via a "view report" button click)The server needs to "calculate" before the user can click "view report" so I start with "view report" disabled.  I've got input validation on the "calculate" click, and at the end, I enable the "view report" button.  Everything is working well wi...

How to pass a server side string variable to client side
Hi, In my application I want to send(or pass) a server side string variable to the client so that the client side javascript can operate on that string. I am new to ASP.NET. Can anyone please help me with some code snippets? If you allow a postback for this passing, you could store the string in a HiddenField and use javascript to read its value after a post~ If you want it to be more smooth and you are using asp.net 2.0, Script Callback is a good choice, there is a sample at the buttom of this page. Furthermore, some ajax framework will help you to call page method from client esa...

Jscript, moving from client-side to server-side (.NET)
Hey all I’m working translating a web-app written in client-side Jscript to run on the server-side as JScript.NET. Without needing to get too specific, I am using Jscript because the original page aggregated raw data to produce statistical results (this was done dynamically based on user 'sort-by' options). The final output is an html report that can be emailed. Because this is currently being done on the client side, as the raw data grows the load-time grows as well (to the point that has almost become unusable). I’m posting here to see if anyone has any experi...

Call client side and server side events together.
I have one textbox on my aspx page.I want to validate amount in that textbox. If it exceeds 100 then the alert message should show that amount is bigger.And it should not go further. But if the amount is less than or equal to 100, then after checking the condition onclientside, it should to the server side TextChanged event.I have written a javascript function which is being called on "onchange" event of textbox and if the value is valid, then it should call serverside textchanged event of the same textbox.Please its urgent. Mark it as Answer if you find it Helpful.Shailen  ...

Server Side control invoking a Client Side event
I need to figure out how to get a server side control to process the "OnMouseOver" event. Since server side controls do not have the onmouseover event associated with them, how would you make for example, a DropDownList have a "OnMouseOver" event associate with it? The DropDownList must be server side. I guess the idea here is to set client-side events on the server-side control. Any help will be appreciated. You may try something like this: In server side code DDL1.Attributes.Add("onmouseover", "javascript:alert('Hi')") Th...

doing client-side action after server-side event ends
 I have a asp-button;I want it to perform a client-side action after completion of the sever-side action((like:calling a javascript function after the click event of the button ends); You can inject some javascript from the server side button click event so that when the page renders on the client side it will invoke the function or javascript fragment. You can use the method Page.RegisterStartupScript to inject javascript, or you can assign the javascript fragment to a literal control which would be interpreted when the page renders on client side.  Can u add some code snippe...

executing my own function @ server side for a client side event
hi all, I have a client side dropdownlist control with onchange event. I am calling form1.submit() method in onchange event. is it possible to catch that event at server side ???ThanksPrashanth.J Not if you call form1.submit(). Try replacing that with <%= ClientScript.GetPostBackEventReference(DropDownList1, string.Empty) %>; Then in the Page_Load handler server-side: private void Page_Load(object sender, System.EventArgs e){ if ( this.IsPostBack ) {  // Place any code that needs to be executed ONLY on a post-back here.  string eventTarget = (this.Req...

Stop execution of server side event from client side
Dear All  I have a text box and i wrote code on the server side event( On Text Change). So when i write something on the text box it goes to server and execute the server side code. Now i want to control this sever execution from client side. i mean i want to cancel this postback from client side under some conition. can anyone plz help me? Regards Sure if you let us know what you want to be done. here is an example <asp:textbox id="txtFile" OnTextChanged="javascript:RefreshPage();" Visible=true Width=500 Runat=server/> function RefreshPage() { &nb...

Web resources about - Need to send a id string from client side to server side and fire a event - asp.net.networking-webservices

Read the Full Transcript of the Sixth Republican Debate in Charleston
Seven Republican presidential candidates met for a debate on the Fox Business Network in Charleston, South Carolina. The main stage featured ...

Indonesia says attack underlines emergence of Islamic State threat
By Randy Fabi and Fergus Jensen JAKARTA (Reuters) - Indonesia must strengthen its defenses against Islamic State and work with neighboring countries ...

Nissan & Renault CEO & Chairman Talks Electric Cars, Autonomous Driving, & OTA Updates
Kyle passed along a video from the Detroit Auto Show of Carlos Ghosn, Chairman and CEO of both Renault and Nissan, doing a Q&A with reporters. ...

America Ferrera Explains Where Golden Globes Bit with Eva Longoria Came From!
America Ferrera strikes a pose as she attends the 2016 Winter TCA Tour to promote her new NBC show Superstore on Wednesday (January 13) in Pasadena, ...

There's a Few Good Reasons to Download the New iOS Beta
The public beta of iOS 9.3 is available for all to download today. Normally, decimal-point upgrades aren’t much to write home about, but there’s ...

Full Episode: WN 01/14/16: Deadly Police Shooting of a Teen in 2013 Sparks Outrage
Full Episode: WN 01/14/16: Deadly Police Shooting of a Teen in 2013 Sparks Outrage

US Powerball: Tickets, results, winning numbers, live stream of lottery for Australians
ONE of the winners of the world record Powerball jackpot has been revealed as a California nurse who was given the ticket by her generous boss. ...

Netflix Says It Will Crack Down On Customers Using VPNs To Access Its Global Catalog
Netflix went global earlier this month, and now the U.S. company has said it will crack down on customers who use VPN software to access content ...

Sierra Leone investigating suspected Ebola death: health ministry
Sierra Leone's Health Ministry said on Thursday it was investigating a suspected Ebola death in Tonkolili district, hours after the World Health ...

Foursquare's new CEO to shift company focus beyond consumers
Foursquare gambled big two years ago when it split its app in two. Unfortunately, that hasn't worked out so well. Despite reinstating universal ...

Resources last updated: 1/15/2016 7:11:50 AM