I have asp.net page and it has 2 controls Grid View and Button ...i want to devide it into 2 parts i want to allow Scrolling in Grid View only but make button come in Fixed place appear all over the page even in in scrolling no disappear in scrolling
Hi, where do you want the button stay on the page? You can refer to the following example, with it, the button will stay 20px from top and 20px from left.
AhmedHussein...
Member
635 Points
375 Posts
Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 07, 2012 06:44 PM|LINK
I have asp.net page and it has 2 controls Grid View and Button ...i want to devide it into 2 parts i want to allow Scrolling in Grid View only but make button come in Fixed place appear all over the page even in in scrolling no disappear in scrolling
Curt_C
All-Star
66017 Points
7639 Posts
Moderator
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 07, 2012 07:02 PM|LINK
Ajax is your friend :}
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AlwaysVisibleControl/AlwaysVisibleControl.aspx
v5.1 of iTracker (Inventory Tracker Starter Kit) is out, Download it now!
Ruchira
All-Star
44392 Points
7194 Posts
MVP
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 08, 2012 09:53 AM|LINK
Hello,
Simply set the position:fixed for the button. See the sample app I created for you
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> </head> <body> <form id="form1" runat="server"> <div style="position: fixed"> <asp:Button ID="Button1" runat="server" Text="Button" /> </div> <div style="width: 200px; height: 1200px; background-color: Red"> <div> </div> </div> </form> </body> </html>
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.AhmedHussein...
Member
635 Points
375 Posts
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 08, 2012 03:44 PM|LINK
If The container fixed position div is the second div not the first one it will disappear
Ruchira
All-Star
44392 Points
7194 Posts
MVP
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 08, 2012 03:48 PM|LINK
Hi,
What? I don't understand. Can you be please more precise?
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.AhmedHussein...
Member
635 Points
375 Posts
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 08, 2012 04:01 PM|LINK
Try That
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> </head> <body> <form id="form1" runat="server"> <div style="width: 200px; height: 1200px; background-color: Red"> <div> </div> </div> <div style="position: fixed"> <asp:Button ID="Button1" runat="server" Text="Button" /> </div> </form> </body> </html>AhmedHussein...
Member
635 Points
375 Posts
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 08, 2012 04:15 PM|LINK
Any Suggestions about that Ruchira
Allen Li - M...
Star
10411 Points
1196 Posts
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 09, 2012 06:20 AM|LINK
Hi, where do you want the button stay on the page? You can refer to the following example, with it, the button will stay 20px from top and 20px from left.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> </head> <body> <form id="form1" runat="server"> <div style="width: 200px; height: 1200px; background-color: Red"> <div> </div> </div> <div style="position: fixed; top: 20px; left: 20px"> <asp:Button ID="Button1" runat="server" Text="Button" /> </div> </form> </body> </html>If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
AhmedHussein...
Member
635 Points
375 Posts
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 09, 2012 08:42 AM|LINK
I want The Second Bottom Div be fixed in the page ...appears even in scroll ...come above anything...but to be in the bottom of the page
Allen Li - M...
Star
10411 Points
1196 Posts
Re: Split My Page Into 2 parts (Scrolled Part and Fixed Part with no Scrolling)
May 09, 2012 09:40 AM|LINK
Hi, please try:
<div style="position: fixed; bottom:0px; left: 20px"> <asp:Button ID="Button1" runat="server" Text="Button" /> </div>If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework