.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

Asp.net styling

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
 
Greeting,I listed two examples of using style propriety for asp.net control.what is the difference between the to examples?my goal is to set the style and positions of asp.net controls in my page to be stable in firefox and IE browsers.and should set the position as absolute or elative.I have 30 asp.net controls in my page and I'm having problems with their positions.please advice.Example1:    <asp:TextBox ID="txtFirstName" runat="server"     Style="top: 198px; left: 421px;     position: relative; height: 23px; width: 144px">    </asp:TextBox>Example2:         <style type="text/css">                              .mystyle        {            position:relative;            top: 836px;             left: 662px;            height: -4px;             width: 128px;         &nb


View Complete Post


More Related Resource Links

jQuery: Styling DropDownList Alternating Items (Rows)

  
In the following example, I will show how you can style any asp:dropdownlist very easily.

The example demonstrates how you can change alternating row items background color, using the fadeTo() to add a nice touch in the dropdownlist. You can change alt rows with a couple lines.

styling dropdownlist problem

  

Dear All,

im facing a problem while styling my ddl, what i did is:

<div><asp ropDownList ID="DropDownList1" runat="server" style="background-color:Transparent;" Width="100%">
    </asp: dropDownList></div>

<div class="stlGradient">
<asp ropDownList ID="DropDownList1" runat="server" style="background-color:Transparent;border:none;" Width="100%"></asp: dropDownList>
</div>

the DIV style is having a bg image repeated X.

now this worked on Firefox
on google Chrome: the border gone but the background still white
on IE 7: nothing happend

thanks for helping.


Styling GridView with GridViewStyleKey?

  
Hi, all. I've got a WPF application I'm working on (my first, in fact!) and one of the windows has a ListView that I'm using much like an Explorer window. That is, I've got a GridView resource available for it, but also a handful of custom views deriving from ViewBase for things like icon view, list view, etc. The thing is, though, I'd like to apply custom style/template to the ListView and from what I've read, the ListView picks up its style cues from its active view. So I'm trying to design styles/templates for each view starting with the GridView but I'm stuck. According to the MSDN documentation , you can define a style with a key of {x:Static GridView.GridViewStyleKey} and it should apply to ListView controls with a GridView view but it doesn't seem to work that way. I've boiled it down to the simplest scenario I could. MainWindow.xaml: <Window x:Class="GridViewTestApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <XmlDataProvider x:Key="People"> <x:XData> <People xmlns=""> <Person Name="Ian" Age="26" /> <Person Name="Adam" Age="31&quo

Styling a checkbox so the check goes outside the box

  
Hi all.  I'm trying to style a checkbox so that the custom check mark goes outside the border.  I normally would make this work by setting a negative margin, but the border of the checkbox constrains the contents, so that only the bit drawn inside is visible ?  This is what I have:       <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">     <Setter Property="SnapsToDevicePixels" Value="true"/>     <Setter Property="OverridesDefaultStyle" Value="true"/>     <Setter Property="Template">     <Setter.Value>     <ControlTemplate TargetType="CheckBox">     <BulletDecorator Background="Transparent">     <BulletDecorator.Bullet>     <Border x:Name="Border"   Width="13"   Height="13"   Margin="-3,-3,3,3"   CornerRadius="0"   Background="Transparent"   BorderThickness="1"   BorderBrush="Black">     <Path   Width="16" Height="16"   Margin="3,-3,0,0"   x:Name="CheckMark"   SnapsToDev

Styling of GridView with Multiple Headers

  
Hi,    I want to implement GridView with multiple headers in  WPF. The requirement is such that GridView should show the headers as shown below: Detail info Name ID PhoneNumber   The sample Xaml Code with  which I was able to attain the above GridView presentation of Headers is given below:   XAML code: <Window x:Class="WpfNestedHeaderListView.Window2"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Window2" Height="300" Width="300">     <UserControl.Resources> <CollectionViewSource       x:Key="PatientInfo"       Source="{Binding Path=DocContext.PatientInformation}"/>   <Style x:Key="HeaderStyle" TargetType="{x:Type GridViewColumnHeader                <Setter Property="Template">                 <Setter.Value>                     <ControlTemplate T

styling of gridview with multiple headers

  
Hi,    I want to implement GridView with multiple headers in  WPF. The requirement is such that GridView should show the headers as shown below: Detail info Name ID PhoneNumber   The sample Xaml Code with  which I was able to attain the above GridView presentation of Headers is given below:   XAML code: <Window x:Class="WpfNestedHeaderListView.Window2"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Window2" Height="300" Width="300">     <UserControl.Resources> <CollectionViewSource       x:Key="PatientInfo"       Source="{Binding Path=DocContext.PatientInformation}"/>   <Style x:Key="HeaderStyle" TargetType="{x:Type GridViewColumnHeader                <Setter Property="Template">                 <Setter.Value>                     <ControlTemplate T

Styling of GridView with Multiple Headers

  
Hi,    I want to implement GridView with multiple headers in  WPF. The requirement is such that GridView should show the headers as shown below: Detail info Name ID PhoneNumber   The sample Xaml Code with  which I was able to attain the above GridView presentation of Headers is given below:   XAML code: <Window x:Class="WpfNestedHeaderListView.Window2"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Window2" Height="300" Width="300">     <UserControl.Resources> <CollectionViewSource       x:Key="PatientInfo"       Source="{Binding Path=DocContext.PatientInformation}"/>   <Style x:Key="HeaderStyle" TargetType="{x:Type GridViewColumnHeader                <Setter Property="Template">                 <Setter.Value>                     <ControlTemplate T

Hover State styling problem...

  
Here is a link to a screenshot of the off state... http://www.spasticgoat.com/shareshot.jpg when I hover over one of them, it activates a blue gradient background image in the tabs, which I can't get rid of! I've been trying to just use: background-image: none; and then assign a background color to the hover state, but it's not happening.   Any ideas?

Table styling at the bottom of the page

  
Hi, i am in the process to do a master page with  a table.The problem i am facing now is the footer is not always at the bottom of the page.When the content in the content page holder is shorter, the footer go up a bit to the page.While the content in the content page holder is longer, the footer of the page is at the bottom of the page (which is what i want). Does anyone has idea on how to have the footer  always at the bottom of the page using table ?My code is as below:Cssbody { margin-top:0; margin-left:0; margin-right:0; margin-bottom:0; width :100%; } .SiteHeader { background-color:#292929; My html code is as below:<form id="form1" runat="server"> <div> <table border ="2" width ="100%" cellspacing ="0" cellpadding="0" > <tr Class="SiteHeader" height="113px"> <td valign="middle" align="center" colspan="2"> <%-- <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/top.jpg" />--%> </td> </tr> <tr bgcolor="red" > <td align="right" colspan="2">

styling on mobile form

  
How to set the overflow, height and width  property in mobile System.Web.UI.MobileControls.Form

Styling WPF toolkit datagrid - HELP.

  
I hope to find an answer on customizing Datagrid from WPF toolkit 2010. I'd like to add a TITLE area to be above DataGridColumnHeaderPresenter of the datagrid. The problem is that I want it to be as a user control or data template where I can populate the title from XML. I want to have unique titles for multiple datagrids on one page getting data from one XML.  I populate few datagrids in the same window. What will be the best solution to add customizable Tile area for a content populated from XML and bounded to each  datagrid to avoid dublication? Thank you in advance. I generate datagrid with columns this way: <Custom:DataGrid Grid.Column="0" Grid.Row="1" x:Name="ServerList" ItemsSource="{Binding Source={StaticResource PagesData}, XPath=ListTiles/Tile1}"> <Custom:DataGrid.Columns> <Custom:DataGridTextColumn Header="Name" Binding="{Binding XPath=@Name}" /> <Custom:DataGridTextColumn Header="Status" Binding="{Binding XPath=@Status}" /> <Custom:DataGridTextColumn Header="Events" Binding="{Binding XPath=@Events}" /> <Custom:DataGridTextColumn Header="Services" Binding="{Binding XPath=@Services}" /> </Custom:DataGrid.Columns> </Custom:DataGrid> <Custom:DataGrid x:Name="Events" Gri

Content Query Web Part Styling and Columns with Underscores

  

Hello,

I'm having a problem with using a column which has an underscore in a custom styled Content Query Web Part. To keep it simple the column name is Mobile_Content, with an underscore. This is causing the issue as columns without underscore work fine. My CommonView Fields property looks like this in the .webpart file:

<

 

property name="CommonViewFields"

label not styling

  

Hi

Can anyone shed some light on why this label is not styling correctly:


This is .net lable

<asp:Label ID="Category" runat="server" Text="Category"  CssClass="label"></asp:Label>

and this is the html label

<label>Category:</label>

Both are wrapped in this div:

.contact_us {

float:left;
width: 410px;
padding:0px 0px 0px 20px;
margin:0px;

}

This is the CSS class:

.contact_us label {
float:left;
width:150px;
padding:0px 0px 5px 0px;
margin:0px;
}

Now on the html file the label looks perfect but on my .net label above it's not being applied.



Styling issue

  
I'm working out the kinks to some stray style issues and I am stumped on a hover style on the Welcome User button.  It is behaving irradically depending on where the mouse is.  The following is working as expected when hovered over Welcome User:
Tag: <A>
ID: zz9_Menu
Name:
Class:  body
            master
            masterContent
            authoringRegion
            sharepointLogin
            ms-globallinks
            ms-SPlink ms-SplinkButtonActive

Moving slightly above or below the Welcome User makes the text disappear and becomes unreadable.  The tag changes to:
Tag:     <DIV>
ID:       zz9_Menu_t
Name:
Class:  body
            master
            masterContent
            authoringRegion
            sharepointLogin
            ms-globallinks
            ms-SPLink ms-SpLinkButtonActive

I'm pretty confused on this one.  Do I need to add another class in my CSS sheet to address this?

eric

styling generic WPF controls

  

I am looking into creating type-safe generic controls. This is targeting the (reduced) generics support in WPF 4 and future Silverlight, and will include a hierarchy of generic controls. (Since this question has parts for both WPF and Silverlight, I have posted the same question to the Silverlight forums .)

I have two questions:

  1. Can you use style setters and template bindings for non-generic properties defined on a generic control?
  2. In Silverlight, is there a value I can use for the default style key in the base class that will allow using the same style in the (temporary) specific-type derived classes? (ComponentResourceKey does not exist in Silverlight, so the setup described below does not work.)

 


The test generic control below defines two test properties: a non-generic Description property, and a generic Data property. The control sets DefaultStyleKey to a ComponentResourceKey<

Styling a complex HierarchicalDataTemplate for TreeView

  
I've got a (reasonably) complex hierarchy that I would like to display in a TreeView. In fact I can quite easily display the hierarchy in a TreeView - the problems start when I want to style those hierachy items.

Let me try to explain the data structure initially:

I have an "organisation" which contains collections of sub-"organisations" and "people".
"People" can contain collections of "items".
"Item" is a leaf node which does not contain any further children.

I make use of the excellent ComplexDataTemplates control library and my TreeView and it's associated HierarchicalDataTemplates is described thus:

      <!-- IEnumerable[OrganisationViewModel] -->
<HierarchicalDataTemplate x:Key="IEnumerable[OrganisationViewModel]" ItemsSource="{Binding Path=.}">
<TextBlock Text="Sub-units" />
</HierarchicalDataTemplate>

<!-- OrganisationViewModel -->
<HierarchicalDataTemplate DataType="{x:Type vm:OrganisationViewModel}">
<HierarchicalDataTemplate.I

WPF Treeview - Binding to a collection with different depths, and styling differently

  

Apologies for the long post -- Read a few threads about this, but still find it hard to implement. Basically, I have a collection of objects, defined as:

public class LibData
{
  public string Name { get; set; }
  ObservableCollection<LibObject> _list;
  public ObservableCollection<LibObject> List { get { return _list; } }

  public LibData(string name, LibDataType type)
  {
    this.Name = name;
    _list = new ObservableCollection<LibObject>();
  }
}

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend