still puzzled

Discussion in 'ASP .Net' started by Daniel, Jun 8, 2004.

  1. Daniel

    Daniel Guest

    I double click on the dropdownlist box and see the code goes into that
    selected_index event of the dropdownlist. And it still not fire up.

    Thanks
     
    Daniel, Jun 8, 2004
    #1
    1. Advertising

  2. See if the Sub Routine is wired to the Event (at the end of the Procedure Declaration you should see a Handles Clause. See if this is pointing to the correct Control

    HT

    Trevor Benedict
    MCSD
     
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=, Jun 8, 2004
    #2
    1. Advertising

  3. Do you have autopostback set to true?

    "Daniel" <> wrote in message
    news:e%...
    >I double click on the dropdownlist box and see the code goes into that
    > selected_index event of the dropdownlist. And it still not fire up.
    >
    > Thanks
    >
    >
     
    Ken Cox [Microsoft MVP], Jun 8, 2004
    #3
  4. Daniel

    Daniel Guest

    Yes, i do

    Public Sub cboProReference_SelectedIndexChanged(ByVal sender As
    System.Object, ByVal e As System.EventArgs) Handles
    cboProReference.SelectedIndexChanged

    ......

    and i still make the autopostback="true"
    OnSelectedIndexChanged="cboProReference_SelectedIndexChanged"








    "Trevor Benedict R" <> wrote in message
    news:...
    > See if the Sub Routine is wired to the Event (at the end of the Procedure

    Declaration you should see a Handles Clause. See if this is pointing to the
    correct Control.
    >
    > HTH
    >
    > Trevor Benedict R
    > MCSD
     
    Daniel, Jun 8, 2004
    #4
  5. Daniel

    Daniel Guest

    Yes, i do

    Public Sub cboProReference_SelectedIndexChanged(ByVal sender As
    System.Object, ByVal e As System.EventArgs) Handles
    cboProReference.SelectedIndexChanged

    ......

    and i still make the autopostback="true"
    OnSelectedIndexChanged="cboProReference_SelectedIndexChanged"

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Do you have autopostback set to true?
    >
    > "Daniel" <> wrote in message
    > news:e%...
    > >I double click on the dropdownlist box and see the code goes into that
    > > selected_index event of the dropdownlist. And it still not fire up.
    > >
    > > Thanks
    > >
    > >

    >
     
    Daniel, Jun 8, 2004
    #5
  6. Daniel

    Daniel Guest

    Hi, Trevor
    Do i need to Make this method initialized in the Initialize method of the
    code behind page

    Thank~



    "Trevor Benedict R" <> wrote in message
    news:...
    > See if the Sub Routine is wired to the Event (at the end of the Procedure

    Declaration you should see a Handles Clause. See if this is pointing to the
    correct Control.
    >
    > HTH
    >
    > Trevor Benedict R
    > MCSD
     
    Daniel, Jun 8, 2004
    #6
  7. Daniel

    Raterus Guest

    you don't need this statement if you are using codebehind/handles
    OnSelectedIndexChanged="cboProReference_SelectedIndexChanged"

    or any other statements that reference codebehind methods like that. That is used when you use <script runat="server"> ... </script>

    "Daniel" <> wrote in message news:...
    > Yes, i do
    >
    > Public Sub cboProReference_SelectedIndexChanged(ByVal sender As
    > System.Object, ByVal e As System.EventArgs) Handles
    > cboProReference.SelectedIndexChanged
    >
    > .....
    >
    > and i still make the autopostback="true"
    > OnSelectedIndexChanged="cboProReference_SelectedIndexChanged"
    >
    >
    >
    >
    >
    >
    >
    >
    > "Trevor Benedict R" <> wrote in message
    > news:...
    > > See if the Sub Routine is wired to the Event (at the end of the Procedure

    > Declaration you should see a Handles Clause. See if this is pointing to the
    > correct Control.
    > >
    > > HTH
    > >
    > > Trevor Benedict R
    > > MCSD

    >
    >
     
    Raterus, Jun 8, 2004
    #7
  8. Daniel

    Daniel Guest

    Thanks, Raterus
    Below is my dropdownlist:
    <asp:dropdownlist id="cboProReference" style="Z-INDEX: 107; LEFT: 137px;
    POSITION: absolute; TOP: 80px" tabIndex="1" runat="server" Font-Size="8pt"
    Font-Names="Tahoma" Width="322px" AutoPostBack="True">
    </asp:dropdownlist>
    I erase the
    OnSelectedIndexChanged="cboProReference_SelectedIndexChanged".
    And the code behind is:
    Private Sub cboProReference_SelectedIndexChanged(ByVal sender As
    System.Object, ByVal e As System.EventArgs) Handles
    cboProReference.SelectedIndexChanged

    txtPCSProjectName.Text = ""

    Dim strProtocol As String

    strProtocol = cboProReference.SelectedItem.Text

    'get the protocol name

    Dim anArray() As String

    anArray = strProtocol.Split("|"c)

    strProtocol = anArray(0)

    'go to the database to get the pcs_protocol_ref according to protocol_ref

    Dim dl As New WebRandDataLayer

    txtPCSProjectName.Text = dl.GetPCSForProtocol(strProtocol)

    End Sub

    The bad thing is that it is still not fire up. Is anyother possible problem
    here?

    Thanks again!



    "Raterus" <> wrote in message
    news:...
    you don't need this statement if you are using codebehind/handles
    OnSelectedIndexChanged="cboProReference_SelectedIndexChanged"

    or any other statements that reference codebehind methods like that. That
    is used when you use <script runat="server"> ... </script>

    "Daniel" <> wrote in message
    news:...
    > Yes, i do
    >
    > Public Sub cboProReference_SelectedIndexChanged(ByVal sender As
    > System.Object, ByVal e As System.EventArgs) Handles
    > cboProReference.SelectedIndexChanged
    >
    > .....
    >
    > and i still make the autopostback="true"
    > OnSelectedIndexChanged="cboProReference_SelectedIndexChanged"
    >
    >
    >
    >
    >
    >
    >
    >
    > "Trevor Benedict R" <> wrote in message
    > news:...
    > > See if the Sub Routine is wired to the Event (at the end of the Procedur

    e
    > Declaration you should see a Handles Clause. See if this is pointing to

    the
    > correct Control.
    > >
    > > HTH
    > >
    > > Trevor Benedict R
    > > MCSD

    >
    >
     
    Daniel, Jun 8, 2004
    #8
  9. Daniel

    Daniel Guest

    unfortunately it does not go there either!


    "Bin Song, MCP" <> wrote in message
    news:...
    > Can you just try the following:
    >
    > Private Sub cboProReference_SelectedIndexChanged(ByVal sender As

    System.Object, ByVal e As System.EventArgs) Handles
    cboProReference.SelectedIndexChanged
    > Response.Write(cboProReference.SelectedItem.Text)
    > 'Comment all other stuffs.
    > End Sub
    >
    >
     
    Daniel, Jun 8, 2004
    #9
  10. Daniel

    Daniel Guest

    I found another place has:

    cboProReference.Attributes.Add("onchange", "SetHidProtocol();")

    Does it affect the code behind to fire up?

    ~thanks




    "Bin Song, MCP" <> wrote in message
    news:...
    > Can you just try the following:
    >
    > Private Sub cboProReference_SelectedIndexChanged(ByVal sender As

    System.Object, ByVal e As System.EventArgs) Handles
    cboProReference.SelectedIndexChanged
    > Response.Write(cboProReference.SelectedItem.Text)
    > 'Comment all other stuffs.
    > End Sub
    >
    >
     
    Daniel, Jun 8, 2004
    #10
  11. Daniel

    bloomfield Guest

    Daniel wrote:
    > I found another place has:
    >
    > cboProReference.Attributes.Add("onchange", "SetHidProtocol();")
    >
    > Does it affect the code behind to fire up?


    Yes it does :)

    Just comment the line and see for yourself what is generated in the html
    on the client. The asp.net engine automaticaly generates some code there
    to do the postback. Then add the cboProReference.Attributes.Add("...
    line again and see again the generated html. My guess is that you will
    see two onchange attributes for the 'select' that is generated on the
    client.
     
    bloomfield, Jun 9, 2004
    #11
  12. Hi Daniel,

    I'm viewing the thread and found it is discussing the same problem with
    another one titled:
    Subject: cannot fire up dropdownlist's SelectedIndexChanged

    I've posted my reply in that one and I'd appreciate if you have a look
    there. Also, if you feel it convenient that we continue to discuss in that
    thread, please feel free to post there. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Jun 9, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Andrew

    VHDL: puzzled beginner

    Mark Andrew, Jun 27, 2004, in forum: VHDL
    Replies:
    5
    Views:
    645
    Mark Andrew
    Jun 30, 2004
  2. schiefaw

    Very Puzzled, Please Help

    schiefaw, Jul 22, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    377
    schiefaw
    Jul 22, 2005
  3. Replies:
    5
    Views:
    1,400
  4. EvelynAnd Ethan
    Replies:
    4
    Views:
    978
    =?Utf-8?B?Sko=?=
    Jan 9, 2006
  5. EvelynAnd Ethan
    Replies:
    0
    Views:
    403
    EvelynAnd Ethan
    Oct 17, 2005
Loading...

Share This Page