How do I remove the dropdown appearance in print page ?

Posted by Mahe under C# on 7/25/2013 | Points: 10 | Views : 793 | Status : [Member] | Replies : 1
Hi All,

How do I remove the dropdown appearance in print page ?

As I want to print the .aspx page having several dropdowns, I see dropdown appearance on my printed page, How do I remove such appearance ?
Which style do we need to apply ?

Regards,
Mahe




Responses

Posted by: Jeyanthi on: 8/8/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can use CSS Media Types to hide/show controls accordingly in printView or ScreenView

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<title></title>
<style type="text/css">
@media print
{
.DropDownList
{
display: none;
}
.TextBox
{
display: block;
}
}
@media screen
{
.DropDownList
{
display: block;
}
.TextBox
{
display: none;
}
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList runat="server" ID="DropDownList1" CssClass="DropDownList">
<asp:ListItem Text="text1" />
<asp:ListItem Text="text2" />
</asp:DropDownList>
<asp:Label Text="text1" runat="server" ID="textbox1" CssClass="TextBox" />
</form>
</body>
</html>

Regards,
Jeyanthi


Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response