Skip to content

Using Webrequest - Processrequest - this.GetPostbackUrl() from Wisej Extension? #1526

Closed

Description

@itg-assistant

Ser Gar asked 2018-05-03 00:02:49 UTC

Hi
AFAIK... Wisej allow to serve content (to be able browser cached) (and save server memory in some escenarios like serving many images for example carousel or slider, avoiding memorystreams or memory server objects related to wisej sessions)
1 - In widget using
this.GetPostbackUrl() + “&img-name=test”, in startup.js for example,
and private void widget1_WebRequest(object sender, WebRequestEventArgs e)
2 - In class
public class MyPictureBox : PictureBox, IWisejHandler
and void IWisejHandler.ProcessRequest(HttpContext context)

Questions:
1 - What about from Wisej Extension?
2 - It is posible to define webrequest or processrequest (maybe defined in extension) and override (in object instance)? (for generic way to serve some content from extension)

Could you share short example?

Thanks in advance!

Activity

  1. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Luca answered 2018-05-03 16:21:28 UTC

    You can implement IWisejHandler on any Wisej component but you need to derive a class and add the interface. Otherwise you can use Wisej.Web.Widget, it fires the WebRequest event.

  2. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Ser Gar answered 2018-05-03 22:07:43 UTC

    I choose ashx handler because every time that resign in website the url of this.postbackurl() changes
    the querystrings (sid and x) changes.
    This behaviour observed too for example if open a form with a widget and open a new same form and values of querystring changes(sid and x) and then aren't cached. browser thinks that are new content and was the same images in previous request - response.

    With handler no issues, content is cached a bit different because url only has a 1 querystring value (my custom)

  3. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Luca answered 2018-05-03 22:10:46 UTC

    You can’t use PostbackUrl() as a URL handler like an ashx page. It’s designed to allow a component to respond to a request, it’s not a routing system and it must be secure, otherwise you’d have a backdoor to your app. For simple routing you can use ashx, nancy, IHttpHandler, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions