PageHandler not working...!!!

Rate It (1)

Last post 07-30-2007 2:46 AM by thk_razin. 2 replies.

Sort Posts:

  • PageHandler not working...!!!

    07-28-2007, 2:27 AM
    • Member
      189 point Member
    • thk_razin
    • Member since 09-20-2006, 1:02 AM
    • Bangladesh
    • Posts 243

    Hello:

    I've called a page handler from my page. I took a HTML image field from that I called hadler

    <img alt="Document page" src="Handlers/DocumentPageHandler.ashx" />

    This handler calls a class

     <% @WebHandler Language="C#" Class="DocumentPageHandler" Codebehind="DocumentPageHandler.cs" %>

    The job of this class is to create image. It's working fine. This page inherits System.Web.UI.Page class

    But now I need to do the same thing from a user control which inherits ModuleControl class created my me.
    ModuleControl  inherits UserControl class as follows

    public class ModuleControl : UserControl

    {

    .........................

    protected override void OnPreRender(EventArgs e) //OnInit(EventArgs e)

    {

    base.OnPreRender(e);
    Trace.Write("Begin CustomizeControl()");

    CustomizeControl();

    Trace.Write(
    "End CustomizeControl()");

    }

    ..................................

    }

    But after this DocumentPageHandler.cs never called. As a result i can't see the image inside the image control.

    I'm quite unfamiliar with the page handler technique. So, I can't understand where should i've to call it in this scenario.

    I need help.

    Thnx-

    Razin

    mark as answer if my response is fruitful for u
    Filed under:
  • Re: PageHandler not working...!!!

    07-29-2007, 4:37 PM
    Answer
    • Member
      54 point Member
    • NielsV
    • Member since 07-29-2007, 3:14 PM
    • The Netherlands
    • Posts 7

    Can you clarify what you want to do with your ModuleControl? I can't see a call from your UserControl to your handler, so what are you doing inside CustomizeControl()?

    If your DocumentPageHandler is configured well,  it should produce an image, and you can use id as ImageUrl's on controls (i.e. on Image controls) or just as source uri's on plain html img tags.

  • Re: PageHandler not working...!!!

    07-30-2007, 2:46 AM
    • Member
      189 point Member
    • thk_razin
    • Member since 09-20-2006, 1:02 AM
    • Bangladesh
    • Posts 243

    Oh! my url was incorrect.

    Thanx-

    Razin

     

    mark as answer if my response is fruitful for u
Page 1 of 1 (3 items)