Developer forum

Forum » Development » userControl

Reply

Hello

 

I made an "Hello World" test as a ascx userControl file:

 

I folowd the guide http://developer.dynamicweb.dk/Weblog-16918.aspx?action=ShowArticle&ArticleID=120

 

Here are my files:


test.ascx:

<%@ Control Language="VB" ClassName="test" CodeFile="test.ascx.vb"  %>


 -- end file ---

 

 

test.ascx.vb
Partial Class test
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Label1.Text = "Hej .."
    End Sub
End Class
 

 -- end file ---

 

 

The are in folder /Files/system/UserControls/

I have selv created the folder "UserControls"

 

 

We made a template .. and included ..<!--@LoadControl(/Files/System/UserControls/test.ascx)-->

 

Then the page comes with an error 404

 
 


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Kim

 

If you place your code in the codebehind file (*.aspx.vb), you will have to compile it and get an assembly. This assembly needs to be placed in the solutions /Bin folder. This can only be done on custom solutions. My guess is that this whats going wrong.

 

So - create the control and have the code inline in a


   
   

   

 

 

No effect..

 

 

Is the somthing i have to do i the backend ?

 

 

 
Nicolai Høeg Pedersen
Reply

Hi Kim

 

On the URL you just provided I can not find any .ascx files in the filemanager at all. So I took your code and placed it in a .ascx file in /Files/System/SomeControl.ascx.

 

On your page with ID 14 from the link above, I viewed source, and added this tag:

 

 

And now it works....

 

PS: The "Insert .ascx control" module which can be found on solutions does not work because of an error in roll out. This will be fixed this week so that module can be used to insert .ascx controls.

 
Reply

Hello

 

When i login with my FTP accont:

 

Adresse: ftp.dynamicsystems.dk
Port: 21
Brugernavn: degrees
Adgangskode: xxxxxxxx

 

And i am looking in the folder /Files/System/ i can not see andy .ascx files.. there are only som images end a XML filer.

 

I can see at that it is working .. but i can not se the file..

 

 

 

---------------------------

 

I am gowing to use a dll component .. later .. where do i create /Bin folder ?

 

Is it somthing you do or i do ?

 

/Kim

 
Reply

Hello

 

The FTP acount i had is now not working any more.

 

 

Can you send som new FTP login info - thank you ...

 

/Kim

 
Reply

Hi Kim,

 

Please contact Support through the HelpDesk system. They can help you.

 

/Lars

 

You must be logged in to post in the forum