Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a image button in page . A calendar is displayed on clicking image button. But when I click on image button, Page first goes to top and then comeback to the position.

My tags are below:

What I have tried:

<div>
          <asp:Label ID="Label3" runat="server" Text="Planned TC Prep End Date" Width ="150px"></asp:Label>
          <asp:TextBox ID="txt_prependdate" runat="server" CssClass="textbox" ></asp:TextBox>
          <asp:ImageButton ID="img_prependdate" ImageUrl="~/content/img/calender.gif" runat="server" OnClick="img_prependdate_Click"  />
          <asp:Calendar ID ="cal_prenddate" runat="server" Visible="false" ShowGridLines ="true" style="Z-INDEX: 1; LEFT: 362px; POSITION: absolute; TOP: 365px"  autopostback="true" OnSelectionChanged="cal_prenddate_SelectionChanged"></asp:Calendar>

           <asp:Label ID="Label15" runat="server" Text="                                       No. of times Replanned"  Width ="317px"></asp:Label>
          <asp:TextBox ID="txt_numreplan" runat="server" CssClass="textbox"></asp:TextBox>
      </div
Posted
Comments
F-ES Sitecore 15-Mar-18 6:32am    
That's because the image button is causing the whole page to be refreshed. The only way to guarantee that doesn't happen is to do whatever you're doing using javascript\ajax rather than using an image button and postbacks. You could also try putting the relevant controls inside an UpdatePanel to see if that helps.
Laxmidhar tatwa technologies 15-Mar-18 8:49am    
F-ESSitecore is currect.
May use jquery also
Member 13614228 19-Mar-18 6:34am    
How to use ajax or jquery? Could you please let me know. I am very new to this.

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