Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7196751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:50:16+00:00 2026-05-28T20:50:16+00:00

I have a form in asp.net webpage which contains 2 drop down lists and

  • 0

I have a form in asp.net webpage which contains 2 drop down lists and a hyperlink + a button.
I want that if user changes an option is dropdowns to change navigate url.
I have done like so:

<asp:DropDownList ID="ddlPackages" AutoPostBack ="true" runat="server" 
  onselectedindexchanged="ddlPackages_SelectedIndexChanged"></asp:DropDownList>

and then I have the method defined.

The point is that I don’t want to make a submit when I change the drop down. Can I do it using only aspx or I have to use javascript?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:50:17+00:00Added an answer on May 28, 2026 at 8:50 pm

    If I understand you correctly you want to change the href of the hyperlink based on the selected value of the dropdown. You can do this with javascript. Make sure you have AutoPostBack="false" and remove the OnSelectedIndexChanged attribute as well.

    To do it using jQuery, use something like this:

    <script type="text/javascript>
    $(function(){
        var $dropdown = $('#<%= ddlPackages.ClientId %>');
        $dropdown.change(function(){
           //Put logic to decide the link here based on the select value 
           var newPage = 'page' + $dropdown.val() + '.aspx'; 
           $('#linkId').attr('href', newPage);
        });    
    });
    </script>
    

    Edit:

    In case you absolutely must have the logic for getting the new url based on the drop down value on the server side, you can turn the method into a Page Method and call it using ajax from the jQuery script above. But you can probably get away with creating the javascript dynamically in the aspx page instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have asp.net form that contains fields. When I access this window, my javascript
I have a form in an ASP.NET MVC site which the user can edit
I have an ajax form in asp.net mvc which is as simple as this:
I have a form that sits behind ASP.NET forms authentication. So far, the implementation
I have a form that collects a data using ASP.NET MVC. It looks like
I have a form that excepts a file upload in ASP.NET. I need to
I have an ambitious requirement for an asp.net 2.0 web page that contains a
I have an ASP.NET webpage that is rendering many (~3000) <input type=text> textboxes on
I have a form in my asp.net mvc(C#) application which handles some dynamic controls.
I have a dynamically created TextBox in a C#/ASP.NET web page that I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.