Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Click event of WebDayView in user control doesn't work

Click event of WebDayView in user control doesn't work

Scheduled Pinned Locked Moved ASP.NET
debuggingcsharpjavascriptasp-netdatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hardus Lombaard
    wrote on last edited by
    #1

    I have a webdayview control (proprietary Infragistics ASP.net control) on my page. On the aspx source I’ve inserted some javascript (webdayview_click) that calls a webmethod in the codebehind. This seems to work fine, but when I insert this webdayview control into a user control and move the corresponding javascript into the aspx of the user control, it doesn’t work. I can’t even insert a breakpoint into the javascript function to debug it. Is there a way to make it work? I want to enable the click event of the webdayview control so that when I click on it, the javascript function calls the webmethod. Here’s my code (remember it's in a user control): Aspx: <!-- function WebDayView1_Click(oDayView, oEvent, element) { PageMethods.SetAppointmentInfo(oDayView.getSelectedActivity().getDataKey()) } // -->

    Cs: public partial class WebUserControl : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { this.WebScheduleSqlClientProvider1.Connect("Database=cmRMI;Server=processor;user id=hardus;password=hardus"); } [System.Web.Services.WebMethod] public static void SetAppointmentInfo(int key) { //Add code here } }

    S 1 Reply Last reply
    0
    • H Hardus Lombaard

      I have a webdayview control (proprietary Infragistics ASP.net control) on my page. On the aspx source I’ve inserted some javascript (webdayview_click) that calls a webmethod in the codebehind. This seems to work fine, but when I insert this webdayview control into a user control and move the corresponding javascript into the aspx of the user control, it doesn’t work. I can’t even insert a breakpoint into the javascript function to debug it. Is there a way to make it work? I want to enable the click event of the webdayview control so that when I click on it, the javascript function calls the webmethod. Here’s my code (remember it's in a user control): Aspx: <!-- function WebDayView1_Click(oDayView, oEvent, element) { PageMethods.SetAppointmentInfo(oDayView.getSelectedActivity().getDataKey()) } // -->

      Cs: public partial class WebUserControl : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { this.WebScheduleSqlClientProvider1.Connect("Database=cmRMI;Server=processor;user id=hardus;password=hardus"); } [System.Web.Services.WebMethod] public static void SetAppointmentInfo(int key) { //Add code here } }

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Please use PRE tags to format your code part. It really helps everyone to read and answer questions.

      Hardus Lombaard wrote:

      insert this webdayview control into a user control and move the corresponding javascript into the aspx of the user control, it doesn’t work.

      This means you have not taken care of the control names in Javascript. Once you put the control in a user control, a string would append at the start of your control name. This new ID which can be found out easily using a ViewSource of your webpage, must be used in Javascript to access it.

      Hardus Lombaard wrote:

      . I can’t even insert a breakpoint into the javascript function to debug it.

      Why so? You can put "debugger;" at the start of function and enable Javascript debugging in your IE settings! You are all set to debug it now.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups