Jump to content

Get Position of an object in Asp.Net


raviprakashg

Recommended Posts

Dear Friends,How to Get Screen Position of an Object like Button, Textbox ectI got two Buttons Called "Show Calendar For Order "and "Show Calendar for Delivery" and i have ASP.Net Calander. I want to Show(popup) the Calendar near to the Button i clicked, if i Clicked First Button The Calendar Should Display near or Below First Button and it should be happen for second button too.i think u have understand my Querywaiting for ur valuable reply thnxursraviprakashg

Link to comment
Share on other sites

are you laying them out with HTML or are you using absolute positioning?
My Button Tag "<asp:Button ID="Button3" runat="server" Text="Show Calendar" Font-Names="Verdana" Font-Size="7pt" Width="96px" />"My Calendar Tag <asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" NextPrevFormat="ShortMonth" ShowGridLines="True" Style="z-index: 100; left: 440px; position: absolute; top: 120px" Width="220px" Visible="False"> <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" /> <TodayDayStyle BackColor="#FFCC66" ForeColor="White" /> <SelectorStyle BackColor="#FFCC66" /> <OtherMonthDayStyle ForeColor="#CC9966" /> <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" /> <DayHeaderStyle BackColor="#FFCC66" BorderColor="White" BorderWidth="1px" Font-Bold="True" Height="1px" /> <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" /> </asp:Calendar>
Link to comment
Share on other sites

you will need to use javascript for this since you are not using Visual Studio's GridLayout.Post the entire code for the page along with any codebehind. Please indicate where in your code you need to get teh controls position and I'll come up with some code for you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...