Strange thing with asp.net and/or net 3.5 and ajax toolkit

Last post 11-12-2009 4:23 PM by Jackxxx. 3 replies.

Sort Posts:

  • Strange thing with asp.net and/or net 3.5 and ajax toolkit

    11-10-2009, 8:40 PM
    • Contributor
      2,707 point Contributor
    • Jackxxx
    • Member since 04-13-2003, 11:43 AM
    • Northern California
    • Posts 2,066

     I have a page with a panel and a popup modal extender. A button is clicked to open the panel and grey out the background, this all works great.

    On the panel i have a textbox where a user enter a lastname then clicks a button to do a search and the results are returned to a gridview.

    Ok, now for the problem:

    The user enters say adams in the textbox and clicks search, the search works fine. Now they want to do another search, they enter smith and click the search button. No search is done, because for some reason the textbox now has adam, smith in it.

    Is there something in ASP.net 3.5 sp1 that would cause something like this or maybe it is a browser setting.

    I apprecaite any help on this strange one.

    Thank you

    Jackxxx
  • Re: Strange thing with asp.net and/or net 3.5 and ajax toolkit

    11-10-2009, 11:58 PM
    • Participant
      904 point Participant
    • vipuldonga
    • Member since 02-10-2009, 11:18 AM
    • Ahmedabad
    • Posts 164

    Hi,

    if possible please provide your code so i can see it and give the solution.

    Thanks & Regards
    Vipul Donga

    Mark it as an answer, if it helped
  • Re: Strange thing with asp.net and/or net 3.5 and ajax toolkit

    11-11-2009, 3:10 AM
    • Participant
      1,067 point Participant
    • brijmohans10
    • Member since 06-17-2009, 10:30 AM
    • India
    • Posts 226

    Hiii i think you have to remove text from textbox before it is opening like this i have developed it on itemcommand of datalist so when it is fired textbox is empty

    if (e.CommandName == "Select" )
            {

              
                txtSendMessage.Text = "";
                this.mdlPopup.Show();

            }

    Thanks
    brij
    Remember to click “Mark as Answer” on the post, if it helps you.
  • Re: Strange thing with asp.net and/or net 3.5 and ajax toolkit

    11-12-2009, 4:23 PM
    • Contributor
      2,707 point Contributor
    • Jackxxx
    • Member since 04-13-2003, 11:43 AM
    • Northern California
    • Posts 2,066

    Here is my code for this process: I have tried everything I can think of and not luck.

    This only happends in Wed Developer 2008/ .NET 3.5 sp1 and NOT Visual Studio 2005/ .NET 2.0 

        <script type="text/javascript"> 
    
    function pageLoad(sender, args)
    {
       var modalPopups = ['mpeClient'];
    
       AddHiddenEventToPopups(modalPopups);
    }
    
    function AddHiddenEventToPopups(modalPopups)
    {
       //step through the popups
       for (var i=0; i < modalPopups.length; i++)
       {
          //find the current popup
          var popUp = $find(modalPopups[i]);
    
          //check it exists so the script won't fail
          if (popUp)
          {
             //Add the function below as the event
             popUp.add_hidden(HidePopupPanel);
          }
       }
    }
    
    function HidePopupPanel(source, args)
    {
       //find the panel associated with the extender
       objPanel = document.getElementById(source._PopupControlID);
    
       //check the panel exists
       if (objPanel)
       {
          //set the display attribute, so it remains hidden on postback
          objPanel.style.display= 'none';
       }
    }
    
        </script>                       
    
    
    
    
    			<asp:Panel ID="pnlclient" runat="server" CssClass="modalPopupclient" Style="display: none">
                                <div style="margin-left: 10px; margin-top: 10px; margin-bottom: 10px; margin-right: 10px">
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblLastName" runat="server" Text="Last Name" Font-Names="Arial" Width="100px"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="lblFirstName" runat="server" Text="First Name" Font-Names="Arial"
                                                            Width="100px"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="lblOrgName" runat="server" Text="Organization Name" Font-Names="Arial"
                                                            Width="100px"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="SearchLastName" runat="server" Columns="20" Width="100px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="SearchFirstName" runat="server" Columns="20" Width="100px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="SearchOrgName" runat="server" Columns="20" Width="100px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" CausesValidation="False"
                                                            AccessKey="s" ToolTip="Click Search or press Alt s" Text="Search"></asp:Button>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnClear" OnClick="btnClear_Click" runat="server" CausesValidation="False"
                                                            Text="Clear Fields"></asp:Button>
                                                    </td>
                                                </tr>
                                            </table>
                                            <asp:GridView ID="GridViewSearch" runat="server" Width="545px" AllowPaging="True"
                                                AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="client_ID" DataSourceID="SqlDataSource1"
                                                PageSize="15">
                                                <Columns>
                                                    <asp:CommandField ShowSelectButton="True" HeaderText="Set IDs">
                                                        <ItemStyle Wrap="False" />
                                                    </asp:CommandField>
                                                    <asp:BoundField DataField="LastName" HeaderText="Last" SortExpression="LastName">
                                                        <HeaderStyle Wrap="False" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="FirstName" HeaderText="First">
                                                        <HeaderStyle Wrap="False" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="OrgName" HeaderText="Organization">
                                                        <ItemStyle Wrap="False" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="Address" HeaderText="Street Address">
                                                        <ItemStyle Wrap="False" />
                                                        <HeaderStyle Wrap="False" />
                                                    </asp:BoundField>
                                                 </Columns>
                                            </asp:GridView>
                                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                                SelectCommand="ProcessSearch" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="false">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="SearchLastName" Name="LastName" PropertyName="Text"
                                                        Type="String" ConvertEmptyStringToNull="true" />
                                                    <asp:ControlParameter ControlID="SearchFirstName" Name="FirstName" PropertyName="Text"
                                                        Type="String" ConvertEmptyStringToNull="true" />
                                                    <asp:ControlParameter ControlID="SearchOrgName" Name="OrgName" PropertyName="Text"
                                                        Type="String" ConvertEmptyStringToNull="true" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                            <asp:Label ID="clientmessage" runat="server" Text=""></asp:Label>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                    <div style="float: right">
                                        <asp:Button ID="btnOK" runat="server" Text="OK" CausesValidation="false" OnClick="btnOK_Click" />
                                    </div>
                                </div>
                            </asp:Panel>
                            <cc1:ModalPopupExtender ID="mpeclient" runat="server" TargetControlID="imgbtnclient"
                                BehaviorID="mpeclient" PopupControlID="pnlclient" OkControlID="btnOK" BackgroundCssClass="modalBackgroundclient"
                                DropShadow="true">
                            </cc1:ModalPopupExtender>


     

    Thank you

    Jackxxx
Page 1 of 1 (4 items)