INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Textbox in Updatepanel doesnt submit text

Textbox in Updatepanel doesnt submit text

(OP)
Hi,

Here's my ASPX page:

CODE --> ASP.NET

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/DEF.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>


<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderBodyAreaClass" runat="server">
        <link href="Content/css/jquery-ui.css" rel="stylesheet" type="text/css" />
        <link href="Content/CSS/AdminStyles.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

    <script type="text/javascript" src="Scripts/js/jquery-1.11.2.js"></script>
    <script type="text/javascript" src="Scripts/js/jquery-ui.js"></script>

</asp:Content>


<asp:Content ID="BodyContent" ContentPlaceHolderID="PlaceHolderMain" runat="server">

    <asp:UpdatePanel ID="UpdatePanel4" runat="server"  >
        <ContentTemplate>
            <asp:Label ID="lblError" runat="server"  ForeColor="Red" Text=""></asp:Label>
            <asp:Button ClientIDMode="Static" ID="Button1" runat="server" Text="DIALOG" 
                OnClientClick="Dlg();return false;" 
                />
        </ContentTemplate>
    </asp:UpdatePanel>

    <div id="dialogQuests" class="dialogQuestsClass">
        <div class="headerDivBlock">QUESTION</div>
        <div class="contentDivBlock">
            <asp:UpdatePanel ID="UpdatePanel6" runat="server" >
                <ContentTemplate>
                    <table id="tableSizePositionQuest">
                        <tr>
                            <td>Group:</td>
                            <td>
                                <asp:TextBox ID="txtGroup" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="btnQuestSave" runat="server" UseSubmitBehavior="false" Text="Save ASYNC" OnClick="btnQuestSave_Click"  />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>


    <script type="text/javascript">

        function Dlg()
        {
            $('#dialogQuests').dialog({ minWidth: 840, resizable: true });
        }

    </script>

</asp:Content> 

When I click on "Save ASYNC" button txtGroup comes empty in btnQuestSave_Click. I wonder what's wrong with my project.

RE: Textbox in Updatepanel doesnt submit text

try removing UseSubmitBehavior="false"

RE: Textbox in Updatepanel doesnt submit text

(OP)
Without UseSubmitBehavior it won't show me this dialog box at all.

RE: Textbox in Updatepanel doesnt submit text

I don't know much about UpdatePanels, I never use them.
But I believe you need to added a trigger to the updatepanel for the button and you need to move the label into the contenttemplate of the updatepanel

RE: Textbox in Updatepanel doesnt submit text

(OP)
Adding triggers doesn't work at all because it's about external controls to be used as an event source for updatepanel. All internal controls are included in triggers by default. Also I tried your idea with expected result - no text, no server function call.

RE: Textbox in Updatepanel doesnt submit text

Sorry, I used google to get my ideas, like I said, i never use update panels
good luck

post your answer when you get it

RE: Textbox in Updatepanel doesnt submit text

(OP)
Hi guys,

I seem to have found the solution. See the link:

CODE --> JavaScript

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
            function EndRequestHandler(sender, args) {
                var elId = sender._activeElement.id;

                if (elId.indexOf("btnAddTypeQuest") > -1 || elId.indexOf("btnEditQuest") > -1) {
                    $('#dialogQuests').dialog({
                        maxHeight: 600,
                        minWidth: 840,
                        open: function (type, data) {
                            $(this).parent().appendTo("form");
                        }
                    });
                }

                if (args.get_error() != undefined) {
                    args.set_errorHandled(true);
                }
            } 

The crucial thing is in bold.

RE: Textbox in Updatepanel doesnt submit text

Thanks for posting your solution. It may help someone in the furture

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close