OnCommand not firing

Results 1 to 2 of 2

Thread: OnCommand not firing

  1. #1
    Join Date
    Dec 1969

    Default OnCommand not firing

    The event OnCommand="NavigationLink_Click" NEVER fires...what gives!! What obvious thing am I missing?<BR><BR>OnCommand="NavigationLink_Click" is in the html<BR><BR>[code language="C#"]<BR> private void InitializeComponent()<BR> {<BR> this.FirstPage.Command += new System.Web.UI.WebControls.CommandEventHandler(this .NavigationLink_Click);<BR> this.PreviousPage.Command += new System.Web.UI.WebControls.CommandEventHandler(this .NavigationLink_Click);<BR> this.NextPage.Command += new System.Web.UI.WebControls.CommandEventHandler(this .NavigationLink_Click);<BR> this.LastPage.Command += new System.Web.UI.WebControls.CommandEventHandler(this .NavigationLink_Click);<BR> this.Load += new System.EventHandler(this.Page_Load);<BR><BR> }<BR> protected void NavigationLink_Click ( Object sender, CommandEventArgs e )<BR> {<BR> Response.Write(e.CommandName.ToString());<BR> switch ( e.CommandName )<BR> {<BR> case "First":<BR> _currentPageNumber = 1;<BR> break;<BR> case "Last":<BR> _currentPageNumber = Int32.Parse ( TotalPages.Text );<BR> break;<BR> case "Next":<BR> _currentPageNumber = Int32.Parse ( CurrentPage.Text ) + 1;<BR> break;<BR> case "Prev":<BR> _currentPageNumber = Int32.Parse ( CurrentPage.Text ) - 1;<BR> break;<BR> }<BR><BR> LoadKnowledgeBase(_currentPageNumber, _dgKnowledgeBase.PageSize);<BR> }[/code]

  2. #2
    Join Date
    Dec 1969

    Default wow, that code looks familiar :-)

    and you don&#039;t want to attach the event to that "Command" thing, click attack the event on the "onClick" event

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts