Problem with the onDirectClick

  1. #1

    Problem with the onDirectClick

    i use one normal extbutton onDirectclick of button the code is in approriate codebehind file when page run and click on that button they will dispaly the "Status Code: 500
    Status Text: Internal Server Error
    "


    and error is
    An error has occurred because a control with id 'ctl00$Child1$btnForgottenPassWord' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.



    give some clue whayt happening


    Thank

    Paddy
    Last edited by Daniil; Jul 25, 2011 at 9:42 AM.
  2. #2
    Hi,

    I guess you don't recreate a control during DirectEvent and trying to access that control.

    How do you create 'ctl00$Child1$btnForgottenPassWord' control?

    Can you provide a full sample to reproduce?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I guess you don't recreate a control during DirectEvent and trying to access that control.

    How do you create 'ctl00$Child1$btnForgottenPassWord' control?

    Can you provide a full sample to reproduce?

    Hello Daniil
    this is the code i have one question

    <asp:tablerow>
                    <asp:tablecell>
                        <ext:TextField ID="txtFirstName_Forgot" EmptyText="First Name" runat="server" LabelWidth="64">
                           
                        </ext:TextField>
                        <asp:dropdownlist id="LAST_NAME" runat="server" visible="False" />
                    </asp:tablecell>
                    <asp:tablecell>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </asp:tablecell>
                    <asp:tablecell>
                        <ext:TextField ID="txtLAST_NAME_Forgot" EmptyText="Last Name" runat="server" LabelWidth="64">
                        </ext:TextField>
                    </asp:tablecell>
            </asp:tablerow>
            </asp:table>
            <asp:hiddenfield id="arrFIRST_NAME" runat="server" />
            <asp:dropdownlist id="FIRST_NAME" runat="server" visible="false"/>
            
            <br />
            <ext:Button ID="btnForgottenPassWord" runat="server" Text="Email My Password" CausesValidation="False"
                PostBackUrl="Password/extPass.aspx" IconCls="add32" >
            </ext:Button>

    This is code part of that when i click on the button that will give the error like

    An error has occurred because a control with id 'ctl00$Child1$btnForgottenPassWord' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: An error has occurred because a control with id 'ctl00$Child1$btnForgottenPassWord' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x80004005): An error has occurred because a control with id 'ctl00$Child1$btnForgottenPassWord' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.]
       System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +839
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743


    i have one question
    1.can i use asp: controls and ext:control in same page they give me some problem

    the asp:label control not support with extnetcontrol like i assign the etx:textfield value to asp:label on click they not shown result



    plz give me some result for the buttonclick
    Last edited by Daniil; Jul 25, 2011 at 11:41 AM. Reason: Please use [CODE] tags
  4. #4
    Well, Ext.Net controls works fine with Asp.Net controls.

    Just remember that Asp.Net controls requires hard post back (not ajax which is produced by DirectEvent).

    So, the following example works fine.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                this.Label1.Text = this.TextField1.Text;
            }
        }
    </script>
    
    <!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">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            asp:Label:&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label1" runat="server" />
            <br />
            <ext:TextField ID="TextField1" runat="server" FieldLabel="ext:TextField" />
            <ext:Button runat="server" Text="Postback" AutoPostBack="true" />
        </form>
    </body>
    </html>
  5. #5
    Also the .PostBackUrl and OnDirectClick are incompatible things.
  6. #6

    Problem with button

    Hello Daniil


    Thanks its working now

Similar Threads

  1. [CLOSED] Tooltip doesn't get updated with OnDirectClick Event...
    By Fahd in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 12, 2012, 1:43 PM
  2. [CLOSED] TextField.Text is empty in OnDirectClick
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 08, 2012, 1:05 PM
  3. OnDirectClick
    By cbu in forum 1.x Help
    Replies: 1
    Last Post: Jan 05, 2012, 7:48 PM
  4. [CLOSED] OnDirectClick not found for server side Button?
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 03, 2010, 4:48 PM
  5. Replies: 5
    Last Post: Jun 10, 2009, 5:13 AM

Posting Permissions