Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Reeves 10 posts 51 karma points
    Nov 04, 2013 @ 15:08
    James Reeves
    0

    usercontrol form not submitting

    Hi All,

    I have tried searching for a solution on the forum but with no success. I have an form but it fails to submit, it just reloads the current page it is on. I have the following code for button submit (Which I have compiled as a DLL and added to the umbraco bin folder.)

       Protected Sub Btn_Search_Click(ByVal sender As Object, ByVal e As EventArgs)
    Tx_PClass.Text = "Hello"
    Response.Redirect("~\ErrorPage.aspx", False)
    End Sub

    On page load - I load some xml into the forms.

    The usercontrol file contain the following.

    <%@ Control Language="vb" AutoEventWireup="false" Inherits="HomeByChoice.FindAHome" %>
    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    <p>
    <asp:Button ID="Btn_Search" runat="server"
    style="height: 26px" />
    </p>

    I then create a macro in my form, and then I added it to my master template.(I will post most the master template to see if you can see the error)

    <%@ master language="VB" %>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <umbraco:Macro Alias="SetPageCulture" runat="server" />
    <head runat="server">
    <title>
    <umbraco:Macro Alias="PropertyTranslation" Property="pageHTMLTitle" runat="server" />
    </title>

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
    <link href="~/css/pagelayouts.css" rel="stylesheet" type="text/css" />
    <link type="text/css" rel="stylesheet" href="~/css/nivo-slider.css" />
    <link href="~/css/Site.css" rel="stylesheet" type="text/css" />
    <link href="~/css/npt.css" rel="stylesheet" type="text/css" />
    <link href="~/css/menu.css" rel="stylesheet" type="text/css" />
    <link rel="icon" type="image/png" href="../umbraco/images/pinnedIcons/npt.ico" />

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="/scripts/jquery-1.7.2.min.js"><\/script>')</script>
    <script src="/scripts/fsmenu.js" type="text/javascript"></script>

    <asp:ContentPlaceHolder ID="head1" runat="server">
    </asp:ContentPlaceHolder>
    <umbraco:Macro Alias="RandomImage" runat="server"></umbraco:Macro>
    </head>
    <body>
    <div id="pageborder">
    <div id="page">
    <form runat = "server">
    <umbraco:Macro Alias="JamesTest" runat="server"></umbraco:Macro>
    </form>
    </div>
    </div>
    </body>

    Does anyone have any idea why the submit button does not work?

    Thanks for all your help - James

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Nov 04, 2013 @ 17:06
    Sebastiaan Janssen
    100

    Shouldn't the button have an OnClick attribute?

    <asp:Button ID="Btn_Search" runat="server" OnClick="Btn_Search_Click"
                   style="height: 26px" />
    
  • James Reeves 10 posts 51 karma points
    Nov 04, 2013 @ 17:21
    James Reeves
    1

    Can't believe I missed that.

    Thank you :)

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Nov 04, 2013 @ 17:27
    Sebastiaan Janssen
    0

    Haha, happens to me all the time! :-)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies