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

Forums / Developing with Sitefinity / Button click event not firing

Button click event not firing

5 posts, 1 answered
  1. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    13 May 2010
    Link to this post
    Hi

    I have a user control with a button.Clicking the button should save data in database.
    This is working fine, when i m placing this user control in a .aspx page but in sitefinity page it's not working.
    The page is reloading and click event is not firing.

    Thanks
    Asit
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 May 2010
    Link to this post
    Hello asit pani,

    The following code works fine at my end

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SimpleButton.ascx.cs" Inherits="CustomControls_SimpleButton" %>
     
     
    <asp:Button Runat="server" ID="Button2" Text="Submit" />

    code behind

    public partial class CustomControls_SimpleButton : System.Web.UI.UserControl
    {
     
        protected void Page_Load(object sender, EventArgs e)
        {
             
     
             Button2.Click += new EventHandler(Button2_Click);
        }
     
     
        void Button2_Click(object sender, EventArgs e)
        {
     
              
        }
    }


    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.
  3. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    13 May 2010
    Link to this post
    Hi

    This is my user control code. After placing this control in any sitefinity page it's not working and also i can't delete publisg this page. I can't know the reason please help me it;s very urgent.


    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Test.ascx.cs" Inherits="UserControls_Test" %>
    <div class="form_fields">
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="You must enter a value in the following fields:" />
         
        <h2>
            Weblisting</h2>
        <p>
            </p>
        <br class="clear" />
        <asp:Label ID="lblerrormsg" runat="server"></asp:Label>
        <div class="lftPanel">
            <div class="leftlbl widthchange">
                <label>
                    <strong>Website address</strong></label>
                <asp:TextBox ID="txtwebsiteaddress" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="please Fill Website address."
                    ControlToValidate="txtwebsiteaddress" Display="None"></asp:RequiredFieldValidator>
            </div>
        </div>
        <br class="clear" />
        <p>
            Select one or more areas of expertise:</p>
        <%--<div class="CheckboxContainer">
            <div class="CheckboxPanel">
                <div class="leftlbl">
                    <asp:CheckBox ID="chkAdvertising" runat="server" Text="Advertising" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkDatabaseManagement" runat="server" Text="Database Management"
                        CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkExperiential" runat="server" Text="Experiential" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkInternetMarketing" runat="server" Text="Internet Marketing"
                        CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkMotivation" runat="server" Text="Motivation" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkPrizeSourcing" runat="server" Text="Prize Sourcing" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkSponsorship" runat="server" Text="Sponsorship" CssClass="chbox" /></div>
            </div>
            <div class="CheckboxPanel">
                <div class="leftlbl">
                    <asp:CheckBox ID="chkAudioVisual" runat="server" Text="Audio Visual" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkDesignServices" runat="server" Text="Design Services" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkField" runat="server" Text="Field / Sales Activities" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkMarketingResearch" runat="server" Text="Marketing Research"
                        CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkNPD" runat="server" Text="N.P.D." CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkPublicRelations" runat="server" Text="Public Relations" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkTelemarketing" runat="server" Text="Telemarketing" CssClass="chbox" /></div>
            </div>
            <div class="CheckboxPanel">
                <div class="leftlbl">
                    <asp:CheckBox ID="chkConferences" runat="server" Text="Conferences" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkDirecetMarketing" runat="server" Text="Direcet Marketing" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkFixedFee" runat="server" Text="Fixed Fee / Insurance" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkMarketingConsultancy" runat="server" Text="Marketing Consultancy"
                        CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkPackaging" runat="server" Text="Packaging" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkSalesPromotion" runat="server" Text="Sales Promotion" CssClass="chbox" /></div>
            </div>
            <div class="CheckboxPanel">
                <div class="leftlbl">
                    <asp:CheckBox ID="chkDataCollection" runat="server" Text="Data Collection" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkDoorDrop" runat="server" Text="Door Drop / Distribution" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkFulfilment" runat="server" Text="Fulfilment" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkMediaBuying" runat="server" Text="Media Buying" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkPremiumSourcing" runat="server" Text="Premium Sourcing" CssClass="chbox" /></div>
                <div class="leftlbl">
                    <asp:CheckBox ID="chkSecurity" runat="server" Text="Security / Specialist Printing"
                        CssClass="chbox" /></div>
            </div>
        </div>--%>
        <!--End of Check box container -->
    </div>
    <div class="form_fields leftlblbtmspace">
        <p>
            Enter up to 5 additional keywords if you wish to expand on the nature of your business</p>
        <br class="clear" />
        <div class="lftPanel">
            <div class="leftlbl">
                <label>
                    Keyword 1</label><asp:TextBox ID="txtkeyword1" runat="server" CssClass="TextBox"></asp:TextBox></div>
            <div class="leftlbl">
                <label>
                    Keyword 2</label><asp:TextBox ID="txtkeyword2" runat="server" CssClass="TextBox"></asp:TextBox></div>
            <div class="leftlbl">
                <label>
                    Keyword 3</label><asp:TextBox ID="txtkeyword3" runat="server" CssClass="TextBox"></asp:TextBox></div>
        </div>
        <div class="lftPanel rhtPanel">
            <div class="leftlbl">
                <label>
                    Keyword 4</label><asp:TextBox ID="txtkeyword4" runat="server" CssClass="TextBox"></asp:TextBox></div>
            <div class="leftlbl">
                <label>
                    Keyword 5</label><asp:TextBox ID="txtkeyword5" runat="server" CssClass="TextBox"></asp:TextBox></div>
        </div>
    </div>
    <br class="clear" />
    <br class="clear" />
    <div class="form_fields">
        <h2>
            Proposors / sponsors</h2>
        <p>
            Please provide details of two Members of the ISP, or clients, who we may contact
            to act as referees to endorse your credentials.</p>
        <br class="clear" />
        <h2>
            First sponsor</h2>
        <br class="clear" />
        <div class="lftPanel">
            <div class="leftlbl">
                <label>
                    Name</label>
                <asp:TextBox ID="txtSponserName1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="please Fill First Sponsor Name."
                    ControlToValidate="txtSponserName1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Title / Position</label>
                <asp:TextBox ID="txtSponserTitle1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="please Fill First Sponsor Title."
                    ControlToValidate="txtSponserTitle1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Company</label>
                <asp:TextBox ID="txtSponserCompany1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="please Fill First Sponsor Company."
                    ControlToValidate="txtSponserCompany1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Business Type</label>
                <asp:DropDownList ID="ddlSponserBusinessType1" runat="server" CssClass="DropDownList">
                    <asp:ListItem Selected="True">Please Select</asp:ListItem>
                    <asp:ListItem>Agency</asp:ListItem>
                    <asp:ListItem>Brand owner</asp:ListItem>
                    <asp:ListItem>Service partner</asp:ListItem>
                    <asp:ListItem>Educational</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator17" InitialValue="Please Select"
                    runat="server" ErrorMessage="Please Select First Sponser Business Type." ControlToValidate="ddlSponserBusinessType1"
                    Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Email</label>
                <asp:TextBox ID="txtSponserEmail1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="please Fill First Sponsor Email."
                    ControlToValidate="txtSponserEmail1" Display="None"></asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="lftPanel rhtPanel">
            <div class="leftlbl">
                <label>
                    Address</label>
                <asp:TextBox ID="txtSponser1Address1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="please Fill First Sponsor Address."
                    ControlToValidate="txtSponser1Address1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                     </label><asp:TextBox ID="txtSponser1Address2" runat="server" CssClass="TextBox"></asp:TextBox></div>
            <div class="leftlbl">
                <label>
                    Postcode</label>
                <asp:TextBox ID="txtSponserPostcode1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="please Fill First Sponsor PostCode."
                    ControlToValidate="txtSponserPostcode1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Phone</label>
                <asp:TextBox ID="txtSponserPhone1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="please Fill First Sponsor Phone."
                    ControlToValidate="txtSponserPhone1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Fax</label><asp:TextBox ID="txtSponserFax1" runat="server" CssClass="TextBox"></asp:TextBox></div>
        </div>
    </div>
    <div class="form_fields leftlblbtmspace">
        <h2>
            Second sponsor</h2>
        <br class="clear" />
        <div class="lftPanel">
            <div class="leftlbl">
                <label>
                    Name</label>
                <asp:TextBox ID="txtSponserName2" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="please Fill Second Sponsor Name."
                    ControlToValidate="txtSponserName2" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Title/ Position</label>
                <asp:TextBox ID="txtSponserTitle2" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="please Fill Second Sponsor Title."
                    ControlToValidate="txtSponserTitle2" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Company</label>
                <asp:TextBox ID="txtSponserCompany2" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ErrorMessage="please Fill Second Sponsor Company."
                    ControlToValidate="txtSponserCompany2" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Business Type</label>
                <asp:DropDownList ID="ddlSponserBusinessType2" runat="server" CssClass="DropDownList">
                    <asp:ListItem Selected="True">Please Select</asp:ListItem>
                    <asp:ListItem>Agency</asp:ListItem>
                    <asp:ListItem>Brand owner</asp:ListItem>
                    <asp:ListItem>Service partner</asp:ListItem>
                    <asp:ListItem>Educational</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator16" InitialValue="Please Select"
                    runat="server" ErrorMessage="Please Second Sponser Business Type." ControlToValidate="ddlSponserBusinessType2"
                    Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Email</label>
                <asp:TextBox ID="txtSponserEmail2" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ErrorMessage="please Fill Second Sponsor Email."
                    ControlToValidate="txtSponserEmail2" Display="None"></asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="lftPanel rhtPanel">
            <div class="leftlbl">
                <label>
                    Address</label>
                <asp:TextBox ID="txtSponser2Address1" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ErrorMessage="please Fill Second Sponsor Address."
                    ControlToValidate="txtSponser2Address1" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                     </label><asp:TextBox ID="txtSponser2Address2" runat="server" CssClass="TextBox"></asp:TextBox></div>
            <div class="leftlbl">
                <label>
                    Postcode</label>
                <asp:TextBox ID="txtSponserPostcode2" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ErrorMessage="please Fill Second Sponsor PostCode."
                    ControlToValidate="txtSponserPostcode2" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Phone</label>
                <asp:TextBox ID="txtSponserPhone2" runat="server" CssClass="TextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ErrorMessage="please Fill Second Sponsor Phone."
                    ControlToValidate="txtSponserPhone2" Display="None"></asp:RequiredFieldValidator>
            </div>
            <div class="leftlbl">
                <label>
                    Fax</label><asp:TextBox ID="txtSponserFax2" runat="server" CssClass="TextBox"></asp:TextBox></div>
        </div>
    </div>
    <div class="form_fields">
        <div class="terms">
            <p>
                <asp:CheckBox ID="chkConfirm" runat="server" />I confirm that the information given
                is correct and agree to abide by the Institute’s Code of Professional Conduct, Memorandum
                and Articles of Association and the Terms & Conditions of application and membership.</p>
            <br class="clear" />
            <p>
                <asp:CheckBox ID="chkConsent" runat="server" />I note that the Institute is recognised
                under the Data Protection Act and give consent for any information that I provide
                to be used for publication (printed or electronic) in a register of members and
                to be available to other ISP members on request who may wish to contact me.</p>
        </div>
    </div>
    <div class="btns">
        <div class="bckbtn">
            <asp:ImageButton ID="imgbtnBack" runat="server" ImageUrl="/images/bckbtn.gif" PostBackUrl="/membership_online1_2_copy1.aspx"
                CausesValidation="false" /></div>
        <div class="bckbtn btncontinue">
            <asp:ImageButton ID="imgbtncontinue" runat="server" ImageUrl="../images/btn_submit_application.gif" />
    <asp:Button ID="b1" runat="server" Text=" click me" OnClick="b1_Click" CausesValidation="false" />
    </div>
    </div>
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 May 2010
    Link to this post
    Hello asit pani,

    Take a look at Sitefinity page freezes in Edit mode

    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.
    Answered
  5. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    13 May 2010
    Link to this post
    Hi

    That's solved.


    thanks for ur reply.
Register for webinar
5 posts, 1 answered