form within form - Ajax?

2 posts, 0 answers
  1. NW7US
    NW7US avatar
    6 posts
    Member since:
    Aug 2012

    Posted 29 Nov 2012 Link to this post

    I am not sure if it is an Ajax-specific problem, or, just a Rad script issue... but, if I have a form inside the default page form, Telerik controls do not seem to work (it throws an error).  If I remove this sub form, things work.

    Here is sample code:

    <%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="current_sswdc._Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
        <title>Test</title>
        <script language="JavaScript" type="text/javascript">
    <!--
     
            function setinitialStatus() {
                window.status = "This is a test of Telerik with inside forms to PayPal.";
            }
    // end -->
        </script>
        <script type="text/javascript">
     
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-26024342-1']);
            _gaq.push(['_trackPageview']);
     
            (function () {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();
     
        </script>
        <style type="text/css">
            body
            {
                font-family: Sans-Serif;
                font-size: 12px;
                font-weight: normal;
                width: 100%;
            }
            .maincontainer
            {
                width: 850px;
                margin-left: auto;
                margin-right: auto;
            }
             
            .header
            {
                text-align: center;
                font-weight: bold;
                font-size: 14px;
                width: 100%;
                padding: 8px;
            }
            .content
            {
                font-family: Sans-Serif;
                font-size: 12px;
                width: 840px;
                padding-left: 6px;
                padding-right: 6px;
                margin-left: auto;
                margin-right: auto;
            }
        </style>
    </head>
    <body onload="setinitialStatus();" bgcolor="#DDF0FF">
        <a name="top"></a>
        <div id="fb-root" style="text-align: center; width: 100%;">
            <script language="JavaScript" type="text/javascript">
    <!--
                window.fbAsyncInit = function () {
                    FB.init({ appId: '113869198637480', status: true, cookie: true,
                        xfbml: true
                    });
                };
                (function () {
                    var e = document.createElement('script'); e.async = true;
                    e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
                    document.getElementById('fb-root').appendChild(e);
                } ());
    // end -->
            </script>
            <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <%--Needed for JavaScript IntelliSense in VS2010--%>
                    <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
            <script type="text/javascript">
                //Put your JavaScript code here.
            </script>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </telerik:RadAjaxManager>
            <div class="maincontainer">
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="850px">
                    <div class="header">
                        <table width="100%" border="1" cellspacing="1" cellpadding="6" bgcolor="#F2F8FF">
                            <tr>
                                <td valign="top" align="center" bgcolor="#F2F8FF">
                                    <b>Please help:</b><br />
                                    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                                    <input type="hidden" name="cmd" value="_s-xclick" />
                                    <input type="hidden" name="hosted_button_id" value="CF7R54YWE5NVJ" />
                                    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
                                        name="submit" alt="PayPal - The safer, easier way to pay online!" />
                                    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"
                                        width="1" height="1" />
                                    </form>
                                </td>
                                <td valign="top" align="center" bgcolor="#F2F8FF" colspan='1'>
                                    <div style="text-align: center; font-family: verdana;">
                                        <h1>
                                            Welcome</h1>
                                        <h3>
                                            subtitle</h3>
                                        <i>something here</i>
                                    </div>
                                </td>
                                <td valign="top" align="center" bgcolor="#F2F8FF">
                                    <b>Please help:</b><br />
                                    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                                    <input type="hidden" name="cmd" value="_s-xclick" />
                                    <input type="hidden" name="hosted_button_id" value="CF7R54YWE5NVJ" />
                                    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
                                        name="submit" alt="PayPal - The safer, easier way to pay online!" />
                                    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"
                                        width="1" height="1" />
                                    </form>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="content">
                        <telerik:RadDatePicker ID="rdpDateToView" runat="server" AutoPostBack="True" Culture="en-US">
                            <Calendar runat="server" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                ViewSelectorText="x">
                            </Calendar>
                            <DateInput runat="server" AutoPostBack="True" DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy"
                                LabelWidth="40%" value="11/27/2012">
                            </DateInput>
                            <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        </telerik:RadDatePicker>
                        <br />
                        <br />
                        <strong>Date Picked:</strong>
                        <asp:Label ID="lblDatePicked" runat="server" Text=""></asp:Label>
                        <br />
                        <br />
                        This is some test text. yeah. adf asdf asdf asd;fja kdsfjalsdkfj hdlkf haldhrauha
                    </div>
                </telerik:RadAjaxPanel>
            </div>
            </form>
        </div>
    </body>
    </html>


    Here is the code-behind:

    Imports Telerik.Web.UI
     
    Partial Class _Default
        Inherits System.Web.UI.Page
     
        Protected Sub rdpDateToView_SelectedDateChanged(sender As Object, e As Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs) Handles rdpDateToView.SelectedDateChanged
            lblDatePicked.Text = e.NewDate.ToString
        End Sub
     
    End Class

    So - the PayPal forms are what break this.  I cannot find a way around having the PayPal forms - somehow, I have to be able to use forms inside the main page form.  Does anyone have some insight as to how I can resolve this conflict?

    Thanks.
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 03 Dec 2012 Link to this post

    Hello Tomas,

    Could you please let me know what the exact error that appears on your site is?

    Kind regards,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top