problem while getting value from .Net UserCantrol in my Umbraco frontend
Hi guys,
I am trying to Add Asp.net Web user control in umbraco ,though I have succeed little but not fully. I have created simple UserCantrol where user can enter his name, Hit submit and his name get displayed in the literal below.
I was successful in displaying the Textbox and the button in the frontend using Razor, but the problem is when user enter his name and hit submit. I don't get named displayed in the literal below.
Here my ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="powered.ascx.cs" Inherits="keylime.powered" %> <p> Enter Your Names:</p> <p> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click1" /> </p> <asp:Literal ID="Literal1" runat="server"></asp:Literal>
Here my ascx.cs code:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
namespace keylime { public partial class powered : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) {
by default in umbraco 7 its mvc. If you change to webforms then it should work although you will need to recreate your templates becuase as it stands they are mvc. I would ditch the webforms stuff altogether and do it with mvc.
problem while getting value from .Net UserCantrol in my Umbraco frontend
Hi guys,
I am trying to Add Asp.net Web user control in umbraco ,though I have succeed little but not fully. I have created simple UserCantrol where user can enter his name, Hit submit and his name get displayed in the literal below.
I was successful in displaying the Textbox and the button in the frontend using Razor, but the problem is when user enter his name and hit submit. I don't get named displayed in the literal below.
Here my ascx code:
Here my ascx.cs code:
Here is my template umbraco template page code:
I am using Umbraco Cms 7.2.1 and .net Framework 4.2.
Thanks
You are trying to mix webforms with mvc you cannot do that. If you look in your umbracoSettings.config you will see line
<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
by default in umbraco 7 its mvc. If you change to webforms then it should work although you will need to recreate your templates becuase as it stands they are mvc. I would ditch the webforms stuff altogether and do it with mvc.
Regards
Ismail
is working on a reply...