Since you are using the latest Umbraco version 7.2.4, have you changed it to run in WebForms if not then the defaultRenderingEngine is MVC, Umbraco comes with MVC as default from Umbraco 7. You can changes it by doing this: https://our.umbraco.org/documentation/reference/Templating/Mvc/
I am not a .NET developer, but just want to be sure that you have changed the defaultRenderingEngine from MVC. Perhaps some of the .NET guys in this community can help you with your specific problem.
Umbraco 7.2.4 Webform User Control - Button click does nothing
I've been searching for at past few hours with not result to this problem.
Im trying to add a webform user control as a macro to a page.
But all it does when i click the button is refresh the page. It doesnt excute my C#-code.
Page.aspx
<asp:Content ContentPlaceHolderID="cp_content" runat="server">
<form runat="server" ID="frmMain">
<asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
<umbraco:Macro Alias="GridLayoutPages" runat="server" />
</form>
</asp:Content>
Callback.ascx
<asp:Panel runat="server" DefaultButton="BtnSendMail" ID="pnlCallback">
<div class="callback clearfix" id="callbackContainer" runat="server">
<div style="background-image: url('<%=personImageUrl %>')" class="clearfix">
<h1>Kom i kontakt med os</h1>
<div class="col-md-6 call-box clearfix">
<asp:TextBox runat="server" ID="txbName" placeholder="Indtast navn" />
<asp:TextBox runat="server" ID="txbPhone" placeholder="Indtast Tlf" />
<asp:Button runat="server" ID="BtnSendMail" Text="Bliv ringet op" OnClick="SendMail_Click" />
...
</div>
</div>
</div>
</asp:Panel>
Callback.ascx.cs
...
namespace MySupportMergedUserControls
{
public partial class Callback : UserControl
{
...
public void SendMail_Click(object sender, EventArgs e)
{
Response.Redirect("http://www.google.com");
}
}
}
Any help/suggestion is appreciated
Hi Dennis and welcome to our :-),
Since you are using the latest Umbraco version 7.2.4, have you changed it to run in WebForms if not then the defaultRenderingEngine is MVC, Umbraco comes with MVC as default from Umbraco 7. You can changes it by doing this: https://our.umbraco.org/documentation/reference/Templating/Mvc/
And even you are running your installation in WebForms mode, you can still use Razor. Try to see this tweet from Sebastiaan https://twitter.com/protherj/status/587745557377978369 from the Umbraco HQ.
Hope this helps,
/Dennis
Yes i've changed the default rendering engine
Config\umbracoSettings.cfg¨
...
<templates>
<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
<defaultRenderingEngine>WebForms</defaultRenderingEngine>
</templates>
...
About the tweet i dont know what to make of it. The site im working on is 100% WebForms at least the parts im working on.
Hi Dennis,
I am not a .NET developer, but just want to be sure that you have changed the defaultRenderingEngine from MVC. Perhaps some of the .NET guys in this community can help you with your specific problem.
/Dennis
is working on a reply...