Chorme after button click event Scroll bar not displaying? - c#

After uploading a document in my page, the document automatically refreshed. Tho after refreshing the page scroll bar disappear?
See this images:
In page load scroll bar is visible,
[Before Imgage][1] https://i.stack.imgur.com/j3szo.png
After page refresh scrolling not visible
[After Image][2] https://i.stack.imgur.com/PhD7f.png
How can i fix this issue?
My code :
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="overflow-y:scroll !important; height:auto">

Since the table is only displaying 1 content and not multiple contents there's no need to have a Scroll Bar. While having the height: auto; the scroll bar should display when you upload multiple files.
You may try to use the code in this form;
<table style="overflow-y:auto; width:100%; height:auto">
You might also check the following post: How to display scroll bar onto a html table

Related

content in options in asp.net dropdown list getting cut/overlapping

as you can see in the image attached, the text in the dropdown list gets cut/ is overlapping due to which complete text is not visible
I have a dropdown list in aspx page which i am binding via db and i have not given any fixed height to the dropdownlist control as seen below
Happening on a display with resolution 1680*1050. works well with resolution of 1366*768. have searched a lot on web but no solution as such. plz help !
this is markup for this drop down list:
<asp:DropDownList ID="ddlLossTypeTime" runat="server" AutoPostBack="true"
Width="75%" style="height: auto !important;
overflow: visible !important;overflow-y:auto"></asp:DropDownList>
overflow: visible
to overflow: auto or overflow: hidden.

Vertical Scroll to appear in GridView

I have tried various ways to get a vertical scroll bar to show for my GridView when there are to many rows.
I have tried adding a DIV around the GridView and it looks horrible as its padding like 20px away from my GridView. I there a way so when the information is coming from the database when the GridView hits its maximum height (200px) the GridView will have a scroll bar?
I also don't want my Headers and Rows to have really big Heights when i do this because when i tried setting a height for my GridView they went bigger if there was on 1 piece of data.
CODE:
#gv_AcceptedRequests, #gv_PendingRequests, #gv_DeclinedRequests {
position:absolute;
margin-top: 120px;
margin-left: 60px;
width: 480px;
font-family: Arial;
font-size: 12px;
border-color: orange;
overflow: auto;
}
Attempt1:
For some reason the DIV isnt startingat the top of the datagrid?
Can you provide code (html & css) of what you allready made up.
You can place a surrounding DIV around the GridView. The code below places a DIV around your gridview. With a CSS (preferred external CSS file) of overflow-y (shows a vertical scrollbar) and zero padding. If there's still padding left, then there's an issue with the CSS on the page.
<div id='scrolldiv' style='position:absolute;border:1px solid black;height:100px;width:650px;overflow-y:scroll;margin-top:120px;margin-left:60px;'>
<div id='gv_AcceptedRequests' style='position:absolute;width:480px;font-family:Arial;font-size:12px;border-color:orange;overflow:auto;'>
//gridview
</div>
</div>
Please place grid view inside DIV tag and apply style height,width and overflow to DIV.
<div style="height: 100px;overflow:auto">
<asp:gridview id="grid" >
</<asp:gridview>
</div>
Hope this helps

how to achieve paging vertically in asp.net C# in gridview

I want to have paging in my asp.net gridview but here is the twist, I want the paging vertically. i.e when I hit page up and page down paging should occur vertically. Like when I do normal paging 1,2,3,4..... pages occur but I want no 1,2,3,4..pages, I want it to be done vertically when I hit page up and page down considering 10 records per page
Wrap your gridview around a div and add width height and overflow:scroll to the div's style attribute.
<div style="width: 100%; height: 400px; overflow: scroll">
<ASP:GridView></ASP:GridView>
</div>
Also remove the AllowPagingattribute from the GridView. Adjust the width and the height of the div according to your needs.

Show image in browser in full screen in C# ASP.NET

i want to show an image in the browser page and to stretch it so it would fill the whole browser page.
i tried:
<asp:Image ID="myimage" runat="server" ImageUrl="/Images/mypic.jpg" Width="100%" Height="100%"></asp:Image>
and also tried using css:
<asp:Image ID="myimage" runat="server" ImageUrl="/Images/mypic.jpg" CssClass="myimage1"></asp:Image>
and in the CSS:
.myimage1{height:100%;width:100%;}
in both cases the browser (IE9), stretches the image with a height that is much bigger then the broswer hight and a right scroll bar is shown.
How can i stretch an image to the exact size of the current page size?
Its stretching to 100% of the parent container, which might be too wide. Try setting the width value of the body and html elements.
Try setting
html, body { width: 100%; height: 100%; }
Or you could use jQuery to find out the width of the parent element first and then set your image to that. No need to use ASP controls with this, just CSS and jquery.
$newheight = $('#yourimageid').parent().height();
$('#yourimageid').css('height', $newheight);
This will grab the parent elements height, and then append the value to the css height value
i found the solution using an img html tag and using CSS:
http://bytes.com/topic/asp-net/answers/850635-how-stretch-background-image-fill
add this inside the aspx page inside the body tag:
<img src="Styles/mypic.jpg" alt="" />
in the css:
html,body
{
margin: 0;
padding: 0;
}
img
{
position:absolute;
z-index:-1;
width:100%;
height:100%;
}

Jquery accordion: How do I get rid of these scroll bars for good?

I have set the attribute in my accordion AutoSize="None", even then when I click on some headers, scroll bars are being displayed. How do I get rid of these scroll bars for good?
please check my accordion code here
Accordian: Arrow image not displaying even though image path is correct
my accordion:
<cc1:Accordion ID="Accordion1" runat="server" FadeTransitions="true" Visible="true" AutoSize="None"SelectedIndex="0" RequireOpenedPane="false" TransitionDuration="250"
HeaderCssClass="accordionHeader toggler" ContentCssClass="accordionContent expanded toggler">
<HeaderTemplate>
<b style="color: Black">
<%#Eval("Ques")%>
</b>
</HeaderTemplate>
<ContentTemplate>
<p> <%#DataBinder.Eval(Container.DataItem, "QuesAns")%></p>
</ContentTemplate>
</cc1:Accordion>
There is two ways to avoid the scrollbar.
To set overflow=hidden on the divs that you gets them http://www.w3.org/TR/CSS21/visufx.html#overflow
To set a little less size on the inner divs that show them. For example, set on the HeaderTemplate width=98%, so its always a little less and no see the scollbar. Why the less size is hide scollbar, because the scrollbar some times is made because the one div is too big to fit the father div, and the father div create scollbar to show it all.
hope this help.

Categories