+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / I have one doubt.

I have one doubt.

2 posts, 0 answered
  1. Rosy
    Rosy avatar
    23 posts
    Registered:
    02 Mar 2010
    06 Mar 2010
    Link to this post
    How can i match the custom control to the content container in Sitefinity.Search the answer for that question.
    but i can't get the answer.

    My source code is

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Wiki Control.ascx.cs" Inherits="Wiki_Control" %>
    <asp:Label ID="Label1" runat="server" Style="z-index: 100; left: 248px; position: absolute;
        top: 128px" Text="Wiki name"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 101; left: 352px; position: absolute;
        top: 128px"></asp:TextBox>
    <asp:Label ID="Label2" runat="server" Style="z-index: 102; left: 256px; position: absolute;
        top: 176px" Text="Wiki title"></asp:Label>
    <asp:TextBox ID="TextBox2" runat="server" Style="z-index: 103; left: 352px; position: absolute;
        top: 176px"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="z-index: 105;
        left: 328px; position: absolute; top: 232px" Text="Insert" />


    My c# code is

    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;

    public partial class Wiki_Control : System.Web.UI.UserControl
    {
        SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=usercontrol;Integrated Security=True");
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd = new SqlCommand("insert control values('" + TextBox1.Text + "','" + TextBox2.Text + "')", con);
            cmd.ExecuteNonQuery();
            Response.Write("Inserted Successfully.");
            con.Close();
            
        }
    }

    I installed the Sitefinity_3_7_2057_ standard trial version.

    I had upload the control.But I can't apt the control to content container in Sitefinity 

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Mar 2010
    Link to this post
    Hi roselin roselin,

    Could you elaborate some more about the problem you have? It is not clear what the exact problem is. I do not see any problem with the code of your user control.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered