C# - Styling Menu Controls With Standard Css?
Jul 11, 2010
I have a piece of piece of HTML which looks like this -
<div id="moduleList">
<ul>
<li class="noBorder"> </li>
<li class="noBorder">
<span class="currentTabLeft"> </span><span class="currentTab">
<a href="Welcome.aspx"
id="grouptab_0">Home</a>
</span><span class="currentTabRight"> </span>
[Code]....
Is there a way to force the asp:Menu control to spit out ul and li instead of tables, so that I can use my existing css styles to style them correctly or is that a lost cause?
View 1 Replies
Similar Messages:
Mar 27, 2010
I'm trying to style an asp:Menu, so that when I hover over a child menu, all the parent menu's will have the background mouse over selected colour. (Take a look at the win xp start menu for example, with default theme blue, all parent menu's will be highlighted as blue if a child is selected) At first I thought this was something simple, but after intense researching (google), I am beginning to wonder...
View 3 Replies
Apr 16, 2010
I'm in the process of styling an asp.net menu in .NET 4 and I'm trying to understand the meaning of the StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass parameters.My understanding is that the styles defined with these parameters are applied as CSS classes to the relevant elements, whenever needed. So I created my menu as follows:
[Code]....
It works for StaticMenuStyle-CssClass and StaticMenuStyle-CssClass (the classes are applied to the relevant elements), but StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass are not applied, regardless of the selected or hover status of an element.
Here is the generated HTML:
[Code]....
So as you can see, StaticMenuStyle and StaticMenuItemStyle are applied, but not StaticSelectedStyle-CssClass or StaticHoverStyle-CssClass. Not sure why. I know I can use selected but isn't the expected behavior that StaticSelectedStyle-CssClass be applied??? By using selected I make assumptions as to what .NET does behind the scenes and that's not right.
View 2 Replies
Jun 19, 2010
I'm using Visual Studio 2010 and ASP.NET 4.0 to render a Menu control as an HTML list so I can style it using CSS. Here is the code I am using below
<asp:Menu ID="navlist" runat="server" Orientation="Horizontal"
SkipLinkText="" ClientIDMode="Static" DataSourceID="MenuSource"
MaximumDynamicDisplayLevels="0" IncludeStyleBlock="False"
StaticDisplayLevels="2">
</asp:Menu>
This produces the following HTML
[Code]....
At first glance this looks like exactly what I wanted. However, if I open up WebResource.axd there is a whole bunch of javascript code related to the menu. Part of this code is applying it's own inline styles to the list. Using FireBug I can view the HTML markup after the javascript has executed and it looks something like this:
[code]....
These inline styles ultimately affect the layout of my page. I have no need for any of the scripts in WebResource.axd. How can I prevent this script from being rendered in the final markup of the page?
View 1 Replies
Oct 21, 2011
I have seen many web sites using a vertical line as separator, between menu items. How can I create a menu with that line..?Is there any link about styling menu control ?
View 2 Replies
Aug 20, 2010
using .net 4 and vs 2010 I have a gridview control that refuses to wrap the text in one column in IE 8, Safari 5 and Chrome 5, resulting in the grid extending outside of the page wrapper. I've got it to behave in IE 7 by creating a CSS class like so:
[Code]....
FF and Opera seem to rendere it correctly without any styling whatsoever. I've tried using the <ItemStyle wrap="true" /> property with no success. I've tried setting the wrap property in the designer with no success.
View 2 Replies
Feb 16, 2010
Im loading some results from a SQL Stored procedure into a Grid View. From my stored procedure I simply get 2 columns returned, Details and Savings, the savings are being returned in the format 30.50123 I want to limit this to 2 decimal places and put a euro sign in front of it like so €30.50, I have managed to do this however its adding a new "savings"column to my Grid view which I obviously don't want. So I now have a savings column with the correct format of €30.50 and my 2 columns from my stored procedure
details and savings. Heres my code....
[Code]...
View 2 Replies
Jun 25, 2010
I have a gridview control having the following columns.
ContestantID
Public Votes
Judges Votes
Public Percentage
Total
Schedular ID
Formula
4
200
1
51.282
330
2
130
3
190
2
48.718
450
2
260
2
1
??
25
1
1
??
1
3
??
75
3
1
??
On the basis of SchedularID i want to compare the value in column total and make the one with higher value as bold. But the problem is i am calculate the Total column at run time inside Row databound even. So any solutions?
[Code]....
View 6 Replies
Jun 28, 2010
I have a grid view that always displays even number of rows. Is it possible to apply same styling for two contineous rows. So for example there would be different background color for rows no 1,2 and 3,4 I would prefer to do that in code behind.
View 4 Replies
Jan 3, 2011
I have a gridview which i was trying to set the row that was currently selected to a different color.. i have used the SelectedRowStyle and works fine, but my needs are to highlight the row regardless of what button or link was clicked on within the row.. thats my description of "selected" i know that that the styles are based on events.. but i dont care if you click on edit, select, delete or any other button within the row.. i want to highlight the row so you know what record you are working with.. if i add the EditRowStyle, then if i selected row 5 it highlights.. no biggy, but with the edit row style, if i then click edit on row 2, then i have 2 records highlighted.. Is there not any way to determine if anything was done within a row and highlight it?
View 3 Replies
Sep 8, 2010
So for example, I have a lovely button control:
<asp:Button ID="Button1" runat="server" Text="Button" />
Which when renders, is a lovely dull grey, nice and rectangular, etc, etc.
I know I can apply a new CSSClass to amend the CSS of said control, but where can I find the original CSS properties for this?
View 4 Replies
Jun 10, 2010
In the example below I have set the control style to 'controlName' I want to use this class to define what my textbox looks like in edit mode. This works ok, so far so good. The Problem In a button event I add the class "validationError" to this textbox if the data is incorrect. When the grid gets rendered I expect to get 'controlName validationError as the class applied to the textbox. Unfortunately, it seems that the declarative statement overrides this and simply ends up as 'controlName' how I can intercept the application of the declarative class so that I get what I desire here?
<asp:BoundField
DataField="Name"
HeaderStyle-CssClass="headerName"
ItemStyle-
CssClass="itemName"
ControlStyle-CssClass="controlName"
HeaderText="Name"
>
</asp:BoundField>
View 4 Replies
Sep 24, 2010
I have a situation where I need to implement a Password Recovery page BUT without using the PasswordRecovery control.
Does anyone know of an example or has implemented this before?
View 3 Replies
May 2, 2010
I'm looking for a good jQuery or CSS, or combo, library to enance my left side menu in an an intranet application. I don't like the 'hover only' expand/collapse style of the ASP.NET Menu control on its own, and I don't like the 'icon-click only' expand/collapse style of the TreeView control on its own.
I plan on trying the CSS Control Adapters, to render the menu with some self-respect, i.e. as nested <ul> or <ol> elements instead of the usual orgy of tables. Beyond that, I need something to give a bit of style and menulike behaviour to these nested lists, and I would prefer a jQuery plugin for this. Which should I use?
View 3 Replies
Nov 29, 2010
I want to create a form that will update an existing database record based on a querystring value passed to the page say UserId.
Rather then using data-bound controls such as the FormView, DetailsView, etc, I would like to use textbox controls, a dropdownlist and a checkboxlist to accomplish this alone. Is this possible? How do I go about binding the data from the database to these controls when the page is loaded and what data source should I create?
View 2 Replies
Feb 25, 2010
I have a form with a textbox, a button, a validatorsummary, and a requiredfieldvalidator.
I want to validate the form but change the aspect of the "alert" that the standard validationcontrols are using. Is that possible?
View 3 Replies
Jul 20, 2010
Im using VS2008 with no 3rd party controls so its completely standard. Ive seen Web Sites that the "display area" is central to the page and will behave like this when the Web page is resized.
Like http://www.asp.net/ home page
What is the control name(if it exists)? There are Navigation controls available but I cant get them to look professional.Are there any links to show how to set these to look modern and fresh? (again like asp.net tab menu at the top)Id rather not go out and buy 3rd paty controls if possible.
View 3 Replies
Apr 1, 2010
I need to add multiple gridviews to a page displaying different data but of the same structure - the data has a lot of columns and I need it formatting quite tightly - is there a way of creating a template gridview in design mode and then somehow using that however many time I need to in the page as a template.
View 5 Replies
Feb 17, 2011
i designed a gridview with the option of Freeze the header. below is the style i have applied in the headerstyle
background: #ecf5ff;
color: #333;
background-color: #6D91BF;
border-style: solid;
border-width: 1px;
border-color: #9cc9ed #5c9fde #6daddb #b4d2f0;
font-weight: bold;
text-align: center;
color: white;
text-decoration: none;
font-size: 12px;
position: relative;
top: expression(this.offsetParent.scrollTop);
z-index: 10;
but its not working in IE8 standard view but working in IE8 compatibility mode,
View 14 Replies
Jul 19, 2010
I do have the following code for for a GridViewd that display pictures that are stored in a file. I am using AutoNumber(GUID) from the database to name the pictures before I stored them to the file. I can save up to 4 pictures using the same AutoNumber but adding these ending to it, Pic1, Pic2, Pic3 ,,,,etc.
The problem that I am having is that after I get the AutoNumber from the database, I want to display a standard picture on the GridView field if there is not particular picture associiated to this record in file. The name of the standard picture is located in the same file under the name of NoPicture.gif. How can I do this? So far this is my GridView code and it is working fine:
<
asp:GridView
ID="PublicClassifiedsSamplesGridView"
runat="server"
AutoGenerateColumns="False"
DataKeyNames="AutoNumber"
DataSourceID="PublicClassifiedsSamplesSqlDataSource"
CellPadding="4"
ForeColor="#333333"
OnDataBound="PublicClassifiedsSamplesGridView_DataBound"
>
<Columns>
<asp:TemplateField
HeaderText="Click for information">
<ItemTemplate>
<asp:ImageButton
ID="ThumbNailImageButton"
runat="server" Width="100px"
PostBackUrl='<%# string.Concat("~/Classifieds/DetailPage.aspx?AutoNumber=",Convert.ToString(Eval("AutoNumber")),"&FlagForm=NoSubmitted")
%>'
ImageUrl='<%# string.Concat("~/UploadedImagesClassifieds/",Convert.ToString(Eval("AutoNumber")),"Pic1.jpg")
%>'
/>
</ItemTemplate>
<ItemStyle
HorizontalAlign="Center"
Width="100px"
/>
</asp:TemplateField>
<custom:LongTextField
DataField="TListingComment"
Width="150px"
Height="70px"
HeaderText="Listing Comment"
HtmlEncode="false"
/>
</Columns>
</asp:GridView>
View 15 Replies
Jul 10, 2010
but I it throws an out range exception on the highlighted line for me:
[Code]....
View 4 Replies
Nov 5, 2010
I am using a css stylesheet in one of my web pages. The styles work perfect for Mozilla and IE 7 and below. However theres a problem with it in IE8 and safari.
The width of class in the css is 700px. I have used a contentplaceholder in the master page from where this web page inherits. Now in IE8 it displays a little less than 700px. I think it displays a width of 600px. How can I solve this problem? Is there a tool for IE 8 similar to Firebug?
EDITED: I have figured exactly where the problem is by debugging the page source and the css. I dont know how I can change the width and alignment for ONLY IE8
I have fixed it for IE8 but having issues with Mac Safari. Anyway to target ONLY safari?
View 3 Replies
Oct 18, 2010
From tools, options, HTML designer, CSS Styling, I checked "Change positioning to absolute...", clicked OK, but never save it. Every time when I open the project, it became uncheck again.
View 7 Replies
Mar 2, 2010
Whenever a user of my application first hit my application, it checks the querystring passed in and store and set the page styling throughout the site.Where is it best to add this check on my page? Master Page on page_load?How to store all the styling variables, so it can be reused throughout the site? Session?
View 2 Replies
Jan 19, 2010
Why is the following asp.net code not including styling information when being rendered to HTML?
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None">
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
Here is the HTML that is rendered:
<div class="AspNet-GridView" id="GridView1">
<table cellpadding="0" cellspacing="0" summary="">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Sex</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ronnie</td>
<td>25</td>
<td>M</td>
</tr>
<tr class="AspNet-GridView-Alternate">
<td>Tina</td>
<td>25</td>
<td>F</td>
</tr>
<tr>
<td>Lukus</td>
<td>4</td>
<td>M</td>
</tr>
</tbody>
</table>
</div>
There are no themes defined for this site. Any ideas what is going on? EDIT I created a new web site in VWD Express and copy and pasted my gridview code, which resulting in the following HTML being rendered:
<div>
<table cellspacing="0" cellpadding="4" border="0" id="GridView1" style="color:#333333;border-collapse:collapse;">
<tr style="color:White;background-color:#990000;font-weight:bold;">
<th scope="col">Name</th><th scope="col">Age</th><th scope="col">Sex</th>
</tr><tr style="color:#333333;background-color:#FFFBD6;">
<td>Ronnie</td><td>25</td><td>M</td>
</tr><tr style="color:#333333;background-color:White;">
<td>Tina</td><td>25</td><td>F</td>
</tr><tr style="color:#333333;background-color:#FFFBD6;">
<td>Lukus</td><td>4</td><td>M</td>
</tr>
</table>
</div>
Something is keeping styling information from being included in my original project.
View 2 Replies