Code Monkey home page Code Monkey logo

Comments (4)

serialseb avatar serialseb commented on July 28, 2024

Can u attach a sample?

Sebastien Lambla

On 21 May 2012, at 14:52, "Jamie-Lewis" [email protected] wrote:

Hi,

I'm having some trouble with views that have usercontrols on them, basically it seems the controls are getting rendered before the handler is executed so any data being passed via HttpContext.Current.Items for example doesn't always get seen by the view ... however subsequent requests do then work, but it's as if it's caching or maybe has managed to execute quicker.

I've tried quite a few different ways to workaround this now like using App/Session vars but it doesn't help. From looking at the source it seem's dependant on the order it's currently executed in so I've been trying to modify it to return a custom Page class with an extra event that is run once the handler is executed and thus giving a point later in the request for the control to bind too, but so far my event doesn't seem to be firing in time.

Are you able to shed any light on this or recommend proper use of controls on views?

Kind Regards
Jamie


Reply to this email directly or view it on GitHub:
#3

from openrasta-codecs-webforms.

Jamie-Lewis avatar Jamie-Lewis commented on July 28, 2024

I can try and put something together if you need it, it's fairly simple to recreate though basically ...

We have views that will put a control on the page like so ....

<%=Xhtml.RenderUserControl("~/Controls/WebList.ascx", new { Resource = Resource }) %>

The controls load event will then generate a table based on some meta data passed via Http.Items and the resource. However the Items come through as null on the first request because the handler hasn't run / completed. I have also just discovered putting a simple sleep delay in the control load event before it does it's thing also seems to solve the problem (but that isn't a good fix!)

Let me know if you still need a sample and I will have to make a separate project for you.

Jamie.

from openrasta-codecs-webforms.

Jamie-Lewis avatar Jamie-Lewis commented on July 28, 2024

Just to let you know this was resolved, the issue was caused by a delay in our controls and their id's being set during initialisation.

Thanks
Jamie.

from openrasta-codecs-webforms.

serialseb avatar serialseb commented on July 28, 2024

Thanks for letting us know.

from openrasta-codecs-webforms.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.