navigating to another page on ddl select

All the page navigation I've done so far has been using hyperlinks. I want the selection from a dropdown list to go to a new page. This is clearly not right:

Private Sub ddlUsers_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlUsers.SelectedIndexChanged
  Session("userID") = ddlUsers.SelectedItem.Value
  Server.Transfer("WebMount.aspx", True)
End Sub

1] Selecting an item from this ddl does not trigger this event.
2] I don't know if Server.Transfer is the correct way to go to a new page. If this were VB, I would just use WebMount.Show().

 




Answer this question

navigating to another page on ddl select

  • Naseer_PK

    > Actually, you would be better served in the ASP.NET forums.

    *Bangs head on kb* I find it confusing to know what to call what I'm working in, since it's all blended together. I mean, the code I posted was VB.NET. (And I still haven't figured out if 'Webforms' is something over and above what I'm doing.)

    > AutoPostBack property to true

    Thank you. That did the trick.



  • Dhurean

    Hello DaveC426913,

    Actually, you would be better served in the ASP.NET forums. In future, if you have any ASP.NET related questions, I would suggest posting there so that you get better/faster responses.

    That said, did you set the AutoPostBack property of the ddl to true You should set it to true for it to automatically postback when the index is changed. Also, Server.Transfer should work - just make sure you have the relative path of the destination correct.

    hope that helps,
    Imran.

  • Eric Tilleson - MSFT

    Hi Dave,

    I understand it can be confusing.  I'm from the ASP.NET team, and troll over here every once in a while.  The best answer I can give is that if it has anything to do with ASP.NET and WebForms, no matter what language, it should go to the ASP.NET forums.  The ASP.NET forums were around before the MSDN forums and have a huge user base that is very active, so you'll likely get a very quick response to any question.

     

    Take care.

    PEte



  • SMAL

    Hey Dave,

    Any web related stuff should go into the ASP.NET forums (doesn't matter whether it's VB.NET or C#). It's a good practice all round - you'll have a better chance of getting your question answered faster/better and others searching for answers wouldn't have to go to multiple forums to search for answers.

    Glad that suggestion worked out for you.

    Imran.

  • navigating to another page on ddl select