You are viewing limited content. For full access, please sign in.

Question

Question

Weblink customizations and upgrade

asked on January 7, 2020

Hello,

I have a customization made on the code behind in Weblink 9, where we added a link to the customers web page in browse.aspx

We are in the process of upgrading Laserfiche to version 10 and the Weblink source code has changed a lot.

The browse.aspx and browse.aspx.vb does not contain the same code as version 9, can you please advise on how to add asp components and function in Weblink 10 code behind.

Thank you.

 

0 0

Replies

replied on January 7, 2020

WebLink 10 is a large modernization step from WebLink 9, from the old-style WebForm post-back cycle to a more modern web service-based design. The initial page load is largely the same though, it's rendered on the server with the same event lifecycle and sent to the browser. You may be able to just add your control to the page and have it work, but if it relies on post-backs it probably won't work as-is. Unfortunately there isn't any general advice or recipe I can give that will apply to every control you may want to add to the page.

Have you tried adding it yet? In what way does it fail to work?

0 0
replied on September 28, 2023

Hi I came across a similar situation that I need to add a .NET control on the weblink login page. Adding a control as is "works" (without compilation error). However, if I try to attach any event handler the page crashes (redirected to the default weblink error page). I also tap into the login.aspx.vb page and I even tried to just add a link the throw an exception right at the page_load, it seems like the vb page is never executed.


Any possible insight we can add code in the .vb page and have it executed?

0 0
replied on September 28, 2023

Without knowing the specific error you're seeing, it's hard to offer any concrete suggestion. My only guess is that you are trying to attach the event handler too early, before the component has been instantiated by the aspx page lifecycle. You might try using the "function Handles event" syntax that VB.Net supports to avoid directly wiring up the handler, if you aren't already. There is an example of that at Login.aspx.vb line 290.

The other thing that is easy to get wrong is deploying your change, if you aren't testing locally. You need to copy the compiled WebLink.dll as well as the modified Login.aspx onto the target machine.

0 0
replied on September 28, 2023 Show version history

ok I see.

 

What I tried was to add a link button on the login.aspx page:

<asp:LinkButton id="myButton" Text="Click me!" OnClick="lnkButton_Click"  runat="server" />

 

And I want to have this link button to trigger an event handler lnkButton_Click. 
Without rebuilding the project to generate the updated weblink.dll I was expecting by just modifying the login.aspx.vb file I can wire this link button to an event handler

    Protected Sub lnkButton_Click(sender As Object, e As EventArgs)
        'do something here
        
    End Sub

But as long as I add the onclick attribute to the link button control and when I click on the link button in runtime, it will be redirected to the default weblink error page (I have no error message/stacktrace details on screen).

 

So my understanding from your explanation is that even the weblink\webfiles\ folder contains all the code behind aspx.vb files the execution still relies on the compiled weblink.dll which we need to take the whole VS project and rebuild. Modifying just the vb files inside the weblink\webfiles\ folder will not work in runtime.

Am I correct?

0 0
replied on September 28, 2023

Correct. Asp.Net can handle some changes to the aspx pages without a recompile, but changes to the code-behind files or changes that involve server-side controls will require compiling a new dll. I think there are Asp.Net project types that support dynamic re-compilation, but I'm pretty sure the WebLink project type does not.

1 0
replied on August 5, 2020

Hello Naim,

Have you tested this out in WL 10, as I would be interested in how you edited the browse.aspx for this.

Also- How did you edit the browse.aspx file in WL9, as I am looking at this option as well.

Thanks,

Jeff Curtis

0 0
replied on August 10, 2020

Hi Jeff,

I didn't work on the version 10, the customer stayed on the old version so we didn't do any changes.

In Weblink 9, we used to open the desired page in visual studio and alter or add any thing in the code.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.