I have a project set up in Visual Studio where I create user controls. When I compile that project the user controls and dlls etc are copied to the Umbraco project. This all works well and it not the problem now.
In these usercontrols i have built things like registration forms and authentication page etc.
Once they are in the Umbraco project I can go to the Developer/Marco area and create a new Macro. Here is one I have created for a test usercontrol I have created.
The code in that user control looks like this.. (truncated for brevity)
and the code behind has this method in it.
ASP.NET 101.
So I put this usercontrol into a macro and add that macro to a page.
When I run this page the button appears as expected above the bodyText. However clicking the button does not work. The Screen flashs as if it is reloading, but nothing is displayed on the page.
Further more the code behind is not even called.
This is a an issue as ALL of my usercontrol buttons on the site have stopped working. And I Have no idea why.
I took the source code from the test page and examined it. I checked each <div> to see that it was closed corrrectly and if it was I remove that div. I checked the formatting of the page and it was clean. But the buttons are not longer working. They were a few days ago.
I tried adding a <form runat="server"> tag around the usercontrols code.
That got me an error that I can only have one <form tag on my page. The template this usercontrol is getting loaded into has that tags already, and the user control is loaded within it.
What is odd here is that these controls were working on anohter Umbraco site. This tells me that the problem is in my template elsewhere.
Guess I'll have to start pulling the template apart to find what is causing this issue.
Buttons have stopped working
This one me stumped.
I have a project set up in Visual Studio where I create user controls. When I compile that project the user controls and dlls etc are copied to the Umbraco project. This all works well and it not the problem now.
In these usercontrols i have built things like registration forms and authentication page etc.
Once they are in the Umbraco project I can go to the Developer/Marco area and create a new Macro. Here is one I have created for a test usercontrol I have created.
The code in that user control looks like this.. (truncated for brevity)
and the code behind has this method in it.
ASP.NET 101.
So I put this usercontrol into a macro and add that macro to a page.
When I run this page the button appears as expected above the bodyText. However clicking the button does not work. The Screen flashs as if it is reloading, but nothing is displayed on the page.
Further more the code behind is not even called.
This is a an issue as ALL of my usercontrol buttons on the site have stopped working. And I Have no idea why.
I took the source code from the test page and examined it. I checked each <div> to see that it was closed corrrectly and if it was I remove that div. I checked the formatting of the page and it was clean. But the buttons are not longer working. They were a few days ago.
What would cause this type of behaviour?
Do you have a <form runat="server"> around your usercontrols?
Jeroen
Do you have EnableViewState in your usercontrol, page, site ?
Alex
I tried adding a <form runat="server"> tag around the usercontrols code.
That got me an error that I can only have one <form tag on my page. The template this usercontrol is getting loaded into has that tags already, and the user control is loaded within it.
What is odd here is that these controls were working on anohter Umbraco site. This tells me that the problem is in my template elsewhere.
Guess I'll have to start pulling the template apart to find what is causing this issue.
You should have <form runat="server"> tag inside your body )
is working on a reply...