[SOLVED] The html content of HTMLPanel desapear afeter Browser Refresh.,

Answered Closed
0
0

 

I have an HTML Panel with some divs and elements…

Everything work’s good,.. the problem is when I press the “Refresh” button of the Explorer, then….

The page charged but… without my html inside HTMLPanel.

 

The Dektop_Load event is not produced on the refresh action…. and my js reference also desapear..

Maybe some event that call again my html and js codes?…

Thanks.

 

  • You must to post comments
Best Answer
0
0

You may also want to look at Wisej.Web.Widget instead of using the HtmlPanel, which was designed to show html text, not to wrap widgets.

The Wisej.Web.Widget class lets you add packages (javascript sources loaded in sequence) and an initScript. See https://wisej.com/extensions – in particular CoolClock to see how to extend the class.

Otherwise simply drop Wisej.Web.Widget on a container, then edit InitScript and type:

// initialize the widget.
this.init = function() 
{
  this.container.innerHTML = "<div id='myDiv'>Hello</div>";
  this.myDiv = document.getElementById("myDiv");
}

// new method: doSomething
this.doSomething = function(text)
{
  this.myDiv.innerText = text;
}

Then in C# you can:

this.widget1.Call("doSomething", "Hello Again");

 

HTH

Best,

Luca

 

  • You must to post comments
0
0

You can use Application.ApplicationRefresh event https://docs.wisej.com/api/wisej.web/general/application#applicationrefresh

We have the JavaScript extender that executes the javascript at the right time and works with refreshes as well. When you drop the extender on a container it adds the JavaScript and JavaScriptSource properties to all controls.

HTH

Best,

Luca

  • You must to post comments
0
0

 

 

Ok yes… I change the html and js in the client side… this is better for my app.. so can I execute some function like “_Load” when a client push “Refresh” on the browser? then i charge the code again.

 

I tried.. the event  “_Paint” this is fired on every refresh from the browser, but the problem is that dissapear my background..

Maybe other event?… something like refresh..

  • You must to post comments
0
0

The refresh doesn’t fire the Load events again. Firing Load on every request is an ASPNET  feature because it needs to recreate the entire object model of all the pages on every request, even if it’s just a click.

In Wise the Load event is fired when the container is created the first time only. After that the state is fully maintained. If you run some javascript code, it has to run again since whatever the js code did is gone after the refresh.

It sounds like you are not using the Wisej properties and are changing the html on the client? If you change the html on the client then you have to redo it on every refresh. It seems to be a hard way around what’s already implemented in Wisej.

Can you post a small sample app please?

Best,

Luca

  • You must to post comments
Showing 4 results