.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

beginRequest is not fired

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hi,Here is my code:<asp:ScriptManager runat="server" ID="sm"> <Services> <asp:ServiceReference Path="~/AjaxWcfService.svc" /> </Services> </asp:ScriptManager> <script type="text/javascript"> function pageLoad() { var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); pageRequestManager.add_beginRequest(onBeginRequest); AjaxWcfService.GetMessage(onRequestResult, onRequestError); } function onRequestResult(result) { console.log(result) } function onRequestError(error) { console.log(error); } function onBeginRequest(sender, args) { console.log("begin request"); } </script> The function OnRequestResult is called and it writes to the console a message that was returned by the method GetMessage of the WCF service. But onBeginRequest is not called. What am I doing wrong?

View Complete Post

More Related Resource Links

How to tell if TextChanged fired in response to user input

I have a TextBox that triggers a calculation when the user types text.  I am recalculating any time that the user enters a new value by responding to the TextChanged event.  This calculation can be manually overridden. I am finding that the TextChanged event is firing during databinding, as it should, but this is blowing away the manually overridden calculation.  I used to be able to tell if the user had initiated this change by checking the Modified property in a System.Windows.Forms.TextBox. Is there a way to tell if the TextChanged event is in response to user input?  I only want my calculation to take place in response to user input and not in response to databinding or other in code changes to the Text property.

Asynchronous callbacks not getting fired in asp.net web parts

I am trying to create a portal making use of asp.net Web Parts, Web Part Zones and WebPartManager. I have created a custom control as my webpart by inheriting from the standard Web Part. Inside the Web Parts I am making use of controls (3rd party) which allow asynchronous callbacks. However my asynchronous callbacks are not getting trigerred from the web part. I am creating the web part and the web part zones at runtime. The structure of my WebPart is as follows <Button><ClientSideClick = "CallBackMethod" </Button> <GridView></GridView> protected CallBackMethod() { RefreshGrid() } Whenever I click on the button the Page_Init of the aspx page on which the webpart gets executed recreating my webpart and webpartzone and also the CreateChildControls method gets executed but the callback event does not trigger. Has anyone faced something similar?

Button click event is not fired on button click

 Hi am using jquery flexi gride in web page and it is working fine .But now the problem is ocured when i click button to call server side event.I am not able to find out .Please guide me for this My button is as fallows and i am<asp:Button ID="btnExport" runat="server" Text="Export" Style="font-family: 'Times New Roman', Times, serif" OnClick="btnExport_Click" />  

How to retrieve object that fired Command event.

Hi there, My situation is, I have a button that bind with a custom ICommand. When the button is clicked, the "CanExecute()" in the custom ICommand will be execute. The question is, how can I retrieve the button object inside "CanExecute()" ? Thanks. Regards, Rambo Ong

OnWorkflowItemChanged fired more than one time for each change

I have a state machine workflow that runs without problem in SharePoint 2007. I wanted to have this in SharePoint 2010. I have created the same workflow using Visual Studio 2010, State Machine Workflow for SharePoint 2010 template. It runs ok, except that the OnWorkflowItemChanged is firing more than one time for each change. It is the same funtionality... same definition.  The only difference is the workflow is for SharePoint 2010. I created another state machine workflow, a simple one with two or more states that contain an EventDriven( with OnWorkflowItemChanged) and setState activities. No other activities are defined.  No tasks are created. I have associated this workflow to a Custom List that I created for this test. The workflow starts when an item is created (or manually), then I modify the item from the list and the OnWorkflowItemChanged is firing more than one time. The same situation ... the same problem. I realized that the event is triggered so many times the OnWorkflowItemChanged activity is defined in the workflow. i.e. If the workflow has defined three OnWorkflowItemChanged, the OnWorkflowItemChanged will be fired three times when an item is modified. Anyone have an idea how can I fix this problem? I would appreciate any suggestions to resolve this.  

The function gets Fired Twice why ?

Good Day All i have a function that is getting called with Pagemethods like this protected void Bind_SearchBox(object sender, EventArgs e) { RadToolBarItem textItem = RadToolBar1.FindItemByText("Button1"); TextBox txtseach = (TextBox)textItem.FindControl("txtsearch"); try { if (sender.Equals(txtseach)) { Bind_SearchBox(txtseach.Text); } } catch (SqlException ex) { lblMessage.Text = ex.Message; Response.Redirect("View.aspx", false); } }and this method will call this// <summary> /// This Function will bind the ListBoxes on the Lefthand side of the Viewer /// It accept a search String /// </summary> public void Bind_SearchBox(String Search) { Session["Search"] = Search; RadPanelBar1.Items.Clear(); RadScheduler1.Appointments.Clear(); //get the Menu inside the toolbar RadToolBarItem textItem = RadToolBar1.FindItemByText("Button1"); RadMenu RadMenu1 = (RadMenu)textItem.FindControl("RadMenu1"); ViewerService.ViewerService obj = new ViewerService.ViewerService(); String SessionKey = obj.newSession();

When a Task Expired step in a Start Custom Task Process action is not fired?!

When a Task Expired step is not fired?! I created a simple Workflow using the SharePoint Designer. Added one step to which I added the Start Custom Task Process and set the Due Date "2 minutes after now". For the When a task Expired step of the custom Task I added a Log to History List action, which doesn't seems to be fired. What good be wrong??? All the steps I did to create the workflow: Started SP Designer 2010 and created a reusalbe WF. Added Start Custom Task Process action to step 1. Changed the behavior of the When a task Expired stepof the custom task (added a Log to History List action). Changed the behavior of the Before Task is Assigned by adding a Set Field action which set the Due Date of the task to "Now + 2 minutes". Published the WF and started the WF for a simple list item. Unfortunately the Log to History List actionof the When a task Expired step is never called.

Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based

Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based client application. This service does get called when there's the default ReceiveRequest coupled with a SendReply activity in the service. However deleting the ReceiveRequest and SendReply Activities and replacing it with a one way Receive Activity causes the Workflow 4.0 Service to not get called. Thanks, Leo Cono - http://www.YouLoveMe.com, Free Dating Site  

ItemAdded event not getting fired

Hi, I have ItemAdded event created. I have added a function in that. The function counts the number of files in the subfoldes of the list. I have build the class file, and created it as a feature and activated the feature. I am not sure if my code is being hit. This is the code i have used. [CODE] namespace ItemCountEventHandler {     class Constants     {         public const string url = "Server Name";         public const string listname = "list name";     }     public class ItemCounting : SPItemEventReceiver     {         public override void ItemAdded(SPItemEventProperties properties)         {             //   base.ItemAdded(properties);             GetOpenItems();         }                   public static void GetOpenItems()         {             using (SPSite site = new SPSite(Constants.url))     

What event (if any) is fired on calling ShowDialog on hidden window

I initialize a window at the launch of my application and hide it, so that when the user needs to launch it I can quickly show it. I am using showDialog to show the window. I use this window at multiple places. So when the user is done using the window I again hide it. My question is how does the window know that it is visible. 'Loaded' event is no longer fired when I can ShowDialog to show the window. ('Loaded' event is fired the first time I create the window and hide it). Is there any other event that is fired on calling 'ShowDialog' on a hidden window? Thanks for your response.  

Will Session_End event will be fired evenif somebody directly closes browser without sign out?

Hi,     In one of my application I m using InProc session state.Can anybody tell me if user closes the browser directly,then Session_End will be called? Regards, Mehul

URL Routing + PostBack not firing BeginRequest event


hi all,

we are having some weird issues with URL Routing in ASP.NET 3.5. 

We have a search box that does a search and redirects to a routed URL.

 When we search for the first time (aka Press a button that forces a postback) everythign works as expected.  we get:

1. BeginRequest event.

2. Determines Route

3. Calls Routehandler to match the route item to the actual destination page

4. Routes the url appropriately.

After you do one search successfully and try again it fails to call the BeginRequest event.  Because of this the routing data never gets called and so the url is never routed to its correct destination.   What is weirder still if we append a "/" (trailing slash) to the url after the initial postback it DOES work properly again. 

So our search route looks like this


entering a term and pressing the SEARCH button would yield a result url like this:



Going back (after 1 successful search) you then need to use this url or else BeginRequest will never fire:

mydomain.com/Search/ < (note the extra "/" at the end)


Anyone have an idea a

dont show JS hidden row after server event fired


Hi all,

i designed a gridview named outergrid and within that GV i designed a innerGrid, when the user click on expand button from the outergrid then the inner grid have to show. Now im doing some row filter works using JS, let us assume i have 5 rows in outergrid after filtered first 2 rows will be hiden so now 3 rows displaying, when user clicks on the expand button then im calling RowCommand Event of outergrid now the child grid has populated but the problem is 2 hiden rows(on outergrid) are now visible, how to make these hiden rows not to show while populate innergrid.

when does the trigger gets fired?


Assume a trigger tr1 was written to fire on insert , and to insert datetime value to a update_date column,

does the trigger fires

1. when the insert event was called on that table

2. duing the insertion to the table when teh control looks for the value in teh update_date column?



createchildcontrols is not fired on page load event


hello frnds

i have develop a custom control as shown below

public class MyControl : System.Web.UI.WebControls.WebControl, INamingContainer


private TextBox txtData ;

protected override void CreateChildControls()
txtData = new TextBox();
txtData.ID = "txtName";



Now, i have placed this control on web page. i also have other asp.net controls like combobox, checkbox etc on this same web page as displayed below. 

<%@ Page Title="" Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" CodeFile="Customer.aspx.cs" Inherits="Customer" EnableViewState="true" %>

<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="Server">
    <table cellpadding="0" cellspacing="0" width="100%">
           <td><asp:MyControl ID="CmbMyControl" runat="Server" /></td>

Now in page load ev

Why events are not fired in this Server Control ?


I have a server control which consists of another server control with a custom navigation panel  with 4 buttons for Next, Previous,.. and a GridView.  I'm trying to publicate events of the image buttons of the navigation panel in order to update the GridView pagination in the outter Server control, but image buttons events are not beig fired. See code bellow, just for MoveNext(). Thanks a lot in advance.

public class cSCGridNavigatorPanel: WebControl, INamingContainer
  protected ImageButton fbtnNext;
  public event ImageClickEventHandler btnNext_Click;
  protected void fbtnNext_Click(object sender, ImageClickEventArgs e)
    if (btnNext_Click != null)
      btnNext_Click(sender, e);

  protected override void CreateChildControls()
    fbtnFirst = new ImageButton();
    fbtnFirst.Click += new ImageClickEventHandler(fbtnFirst_Click); 
  protected override void Render(HtmlTextWriter writer)

How to determine if a loaded event is fired as a result of a navigation button?


I want to perform different actions in my page loaded event based on whether or not the page is being loaded as a result of a navigation button click (ie if the navigation GUI back/forward button was pressed then I want to do A else do B).

Is there a built in flag that I can reference?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend