Redirect to specific paragraph on DropDownList change using jQuery in ASP.Net

Last Reply one year ago By pandeyism

Posted one year ago

Dear sir,

I have a drop-down list. I need go to necessary paragraphs in same page by clicking selected item I tried your before direction and snippet but it is not working

Posted one year ago Modified on one year ago

Hi rajeesh,

Refer below sample.

<html xmlns="">
<head runat="server">
    <style type="text/css">
            font-family: Arial;
            font-size: 10pt;
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        $(function () {
            $("#ddlSelected").change(function () {
                if ($(this).val() != '0') {
                    $('html, body').animate({
                        'scrollTop': $('#dv' + $(this).val()).offset().top
                    }, 500);
    <form id="form1" runat="server">
        <asp:DropDownList runat="server" ID="ddlSelected">
            <asp:ListItem Text="Select" Value="0" />
            <asp:ListItem Text="Home" Value="Home" />
            <asp:ListItem Text="About" Value="About" />
            <asp:ListItem Text="Services" Value="Services" />
            <asp:ListItem Text="Gallery" Value="Gallery" />
            <asp:ListItem Text="Contact" Value="Contact" />
        <hr />
        <div id="dvHome" style="height: 200px">
                Home Content.</h3>
        <div id="dvAbout" style="height: 200px">
                About us Content.</h3>
        <div id="dvServices" style="height: 200px">
                Services Content.</h3>
        <div id="dvGallery" style="height: 200px">
                Gallery Content.</h3>
        <div id="dvContact" style="height: 200px">
                Contact us Content.</h3>