Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a asp.net application. In my asp.net page I have a dropdownlist as a part of collapsiblePanel. As and when I click on dropdownlist for selecting, the page is getting scrolled by itself to the end. This not the case with one dropdownlist, but this happening with every dropdownlist. I am using C# for code behind. What is this problem..? How do I avoid this problem..? can anyone help to overcome this problem..?

My HTML CODE is this.

ASP.NET
<pre lang="HTML"><asp:Panel ID="panelBasic" runat="server" Width="100%">
                                    <table width="100%">
                                        <tr>
                                            <td class="lblLeft" width="15%" valign="top">
                                                Category
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drpcategory" runat="server" Height="18px" Width="150px" CssClass="txtLeft">
                                                    <asp:ListItem>IT
                                                    <asp:ListItem>NON IT
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Applied for
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drpposition" runat="server" Height="19px" Width="150px">
                                                    <asp:ListItem>Trainee
                                                    <asp:ListItem>Software Engineer
                                                    <asp:ListItem>Senior Software Engineer
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Source
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drpsource" runat="server" CssClass="txtLeft" Width="150px">
                                                    <asp:ListItem>Consultancy
                                                    <asp:ListItem>Job Site
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Skills
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drpskills" runat="server" CssClass="txtLeft" Width="150px">
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Job Type
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drpjobtype" runat="server" CssClass="txtLeft" Width="150px">
                                                    <asp:ListItem>Permanent
                                                    <asp:ListItem>Contract
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                No Of Jobs
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtnoofjobs" runat="server" CssClass="textbox" Width="147px">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Relocation
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drprelocation" runat="server" CssClass="txtLeft" Width="150px">
                                                    <asp:ListItem>Yes
                                                    <asp:ListItem>No
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Travel
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drptravel" runat="server" CssClass="txtLeft" Width="150px">
                                                    <asp:ListItem>Yes
                                                    <asp:ListItem>No
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Company Name
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtcompanyname" runat="server" CssClass="textbox">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Website
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtcompanyname0" runat="server" CssClass="textbox">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Type
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="drpcompanytype" runat="server" CssClass="txtLeft" Width="150px">
                                                    <asp:ListItem>MNC
                                                    <asp:ListItem>Non MNC
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="lblLeft" valign="top" width="15%">
                                                Reason For Change
                                            </td>
                                            <td>
                                                <div style="width: 100%; height: 75px; overflow: scroll;" align="left">
                                                    <asp:CheckBoxList ID="cblreasonchange" runat="server">
                                                        <asp:ListItem>Better Salary
                                                        <asp:ListItem>Relocation
                                                        <asp:ListItem>Better Projects
                                                        <asp:ListItem>Advance Technologies
                                                        <asp:ListItem>Personal Reasons
                                                        <asp:ListItem>Looking For MNC
                                                        <asp:ListItem>Others
                                                    
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                
                                <cc1:collapsiblepanelextender id="CollapsiblePanelExtenderbasic"  runat="server" expandcontrolid="lblBasic"
                                    targetcontrolid="panelBasic" textlabelid="lblBasic" collapsecontrolid="lblBasic"
                                    collapsed="True">


This is my style sheet

CSS
 .txtCenter,.txtLeft,.txtRight,.lblLeft,.lblLeftBold,.lblError,.chkbx ,.outof
{
      font-family:Verdana; font-size:10pt; border-color:Gray; border-width:thin; color :#022C35;  
}
.txtCenter { border-style:solid;      letter-spacing:0px;       text-align:center;        }
.txtLeft   { border-style:solid;       letter-spacing:0px;       text-align:left;  }
.txtRight  { border-style:solid;       letter-spacing:0px;       text-align:right;        }
.lblLeft   { font-size:12px;	font-weight: bold; line-height:25px; margin-top:5px;  letter-spacing:1px;	width:150px;  }      
.lblLeftBold { font-weight : bold; color:White; font-size: 14px;    }
.lblError  { color:Red;  }
.chkbx     {      }
.outof{ color:Orange; }
.grdtabstylenew  { width:1px; width:98%; background: #FFFFFF; border-color:#D0D7E5;  font-family:Verdana; font-size:8pt; }
.textbox {
-webkit-border-radius: 4px;-moz-border-radius: 4px; border-radius: 4px ;border:1px solid #aaa; padding:3px;
  background: rgba(255, 255, 255, 0.9);
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#FFFFFF), to(#EEEEEE));
background: -webkit-linear-gradient(#FFFFFF, #EEEEEE);
background: -moz-linear-gradient(#FFFFFF, #EEEEEE);
background: -ms-linear-gradient(#FFFFFF, #EEEEEE);
background: -o-linear-gradient(#FFFFFF, #EEEEEE);
background: linear-gradient(#FFFFFF, #EEEEEE);
-pie-background: linear-gradient(#FFFFFF, #EEEEEE);
}
.textbox:focus,.textbox:hover{
	border-color:#093c75;	-moz-box-shadow:0 0 3px #fff;	-webkit-box-shadow:0 0 3px #0459b7;
	outline:none;
}
.tbtopheader {
 	            border-right: #b9cc72 1px; BORDER-TOP: #b9cc72 1px; FONT-WEIGHT: bold; FONT-SIZE: 14px; 
	            BORDER-LEFT: #b9cc72 1px; WIDTH: 98%; COLOR: Black; BORDER-BOTTOM: #b9cc72 1px;
	            FONT-FAMILY: Verdana,Verdana, sans-serif; BORDER-COLLAPSE: collapse; HEIGHT: 20px; vertical-align: middle
}
.tbnormal  {
            border-collapse:collapse; border: 1px solid #333; background:;
  /*BORDER-RIGHT: 1px; PADDING-RIGHT: 1px; BORDER-TOP: 1px; PADDING-LEFT: 1px; FONT-SIZE: 11px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px; WIDTH: 98%; PADDING-TOP: 1px; BORDER-BOTTOM: 1px; FONT-FAMILY: Verdana*/
}
.tbsubheader {	FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffffff; FONT-FAMILY: Verdana,Verdana, sans-serif;  vertical-align: middle;
              	background: url('../Images/menubg.png');
}

/*  Style for stylish button
.button    { font-family:verdana; font-size:12px;  background:url('../Images/submit.png') no-repeat; min-height:25px; min-width:60px;padding:0px;}
*/
a.button, button { display: inline-block; padding: 5px; min-width:60px; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 12px; color: #333333; text-shadow: 1px 1px 0 #FFFFFF; background: #ECECEC url('../images/css3buttons_backgrounds.png') 0 0 no-repeat; white-space: nowrap; overflow: visible; cursor: pointer; text-decoration: none; border: 1px solid #CACACA; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; outline: none;  zoom: 1; line-height: 1.11; *display: inline; *vertical-align: middle; }
button { margin-left: 0; margin-right: 0; *padding: 5px 5px 3px 5px; }
a.button { -moz-user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-user-select: none; -webkit-touch-callout: none;}
button::-moz-focus-inner { border: 0; padding:0px; }
a.button.primary, button.primary { font-weight: bold }
button:focus,a.button:hover, 
button:hover { color: #FFFFFF; border-color: #388AD4; text-decoration: none; text-shadow: -1px -1px 0 rgba(0,0,0,0.3); background-position: 0 -40px; background-color: #2D7DC5; }
a.button:active, button:active,
a.button.active, button.active { background-position: 0 -81px; border-color: #347BBA; background-color: #0F5EA2; color: #FFFFFF; text-shadow: none; }
a.button:active, button:active { top: 1px }
a.button.negative:hover, button.negative:hover { color: #FFFFFF; background-position: 0 -121px; background-color: #D84743; border-color: #911D1B; }
a.button.negative:active, button.negative:active,
a.button.negative.active, button.negative.active { background-position: 0 -161px; background-color: #A5211E; border-color: #911D1B; }
a.button.positive:hover, button.positive:hover { background-position: 0 -280px; background-color: #96ED89; border-color: #45BF55; }
a.button.positive:active, button.positive:active,
a.button.positive.active, button.positive.active { background-position: 0 -320px; background-color: #45BF55; }
a.button.pill, button.pill { -webkit-border-radius: 19px; -moz-border-radius: 19px; border-radius: 19px; padding: 5px 10px 4px 10px; *padding: 4px 10px; }
a.button.left, button.left { -webkit-border-bottom-right-radius: 0px; -webkit-border-top-right-radius: 0px; -moz-border-radius-bottomright: 0px; -moz-border-radius-topright: 0px; border-bottom-right-radius: 0px; border-top-right-radius: 0px; margin-right: 0px; border-right: none; }
a.button.middle, button.middle { margin-right: 0px; margin-left: 0px; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; border-right: none; }
a.button.right, button.right { -webkit-border-bottom-left-radius: 0px; -webkit-border-top-left-radius: 0px; -moz-border-radius-bottomleft: 0px; -moz-border-radius-topleft: 0px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; margin-left: 0px; }
a.button.left:active, button.left:active,
a.button.middle:active, button.middle:active,
a.button.right:active, button.right:active { top: 0px }
a.button.big, button.big { font-size: 16px; padding-left: 14px; padding-right: 17px; }
button.big { padding: 4px 17px 2px 17px; }

a.button span.icon, button span.icon { display: inline-block; width: 14px; height: 12px; margin: auto 7px auto auto; position: relative; top: 0; *top: 0px; background-image: url('../images/css3buttons_icons.png'); background-repeat: no-repeat; }
a.button span.icon.plus, button span.icon.plus { background-position: 0 -616px }
a.button:hover span.icon.plus, button:hover span.icon.plus { background-position: 0 -631px }
a.button span.icon.cross, button span.icon.cross { background-position: 0 -204px }
a.button:hover span.icon.cross, button:hover span.icon.cross { background-position: 0 -219px }
.tbverticalsubheader {	FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffffff; FONT-FAMILY: Verdana,Verdana, sans-serif;  vertical-align: middle;
              	background: url('../Images/menubgVer.png') ; background-repeat: repeat-y;
}
.mandatory
{
	font-size : small;
	color: red;
}
.lblTim
{
	/*border-style:outset;
	border-color:Green;*/
	border-width:thin;
}


Thanks in advance
Posted
Updated 14-Sep-11 3:15am
v3
Comments
Herman<T>.Instance 14-Sep-11 9:03am    
show your code (aspx and cs)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900