Alternate Row Color In A GridView Using Pure CSS?
Mar 9, 2010
I want to alternate rowcolor in a GridView, using pure CSS, ie: I don't want to use asp.net themes; I'd rather not have to use jQuery, or define define AlternatingRowStyle-BackColor on each gridview (unless there's a reason I must). Here's my CSS (that isn't working):
.gridView {font-size:11px
}
.gridView tr:nth-child(even) {background-color: #FFF}
.gridView tr:nth-child(odd) {background-color: #FFCC00}
.gridView tr:nth-child(even) td {background-color: #FFF}
.gridView tr:nth-child(odd) td {background-color: #FFCC00}
(I included the .gridView {font-size:11px} just to confirm I am using the proper CssClass.) Is this not possible, or am I doing something wrong.
View 1 Replies
Similar Messages:
Dec 27, 2010
I am having a gridview with alternative color i have used AlternatingRowsDefaultCellStyle. however, if my grid is not fullyfilled, ie the grid view page size is 20 and i have only 10 records in that page then the alternate row color will not apply for blank rows. My question is, How can I fill the blank rows with alternate color as well.
Hope there is some solution without adding empty rows at the end of the datasoure which will create problems while sorting the grids.
View 11 Replies
Oct 26, 2010
This is my code.iam providing alternate coloring for my columns in dynamic table.In this i want to avoid Alternate row style color for hiddenfield.
[code]...
View 1 Replies
Sep 3, 2010
I am trying to make the colors different for every line, so lets say one line white and the next light grey. I tried it in the gridview usingbut it has no effect on the display! The lines are all white! Only formatting to work is the header formatting.For CSS, I have
<RowStyle
CssClass="gridRow"
/>
<HeaderStyle
CssClass="gridHeaderSort"
/>
[code]...
View 8 Replies
Jan 21, 2010
I'm trying to change the CSS class of the row that is in edit mode. I've managed to get it working, but it only works for alternate rows. I'm totally stumped as to what could be causing it to behave like that. I've attached what I think is the relevant code below
[Code]....
protected void grdList_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.CssClass = "row";
}
if (e.Row.RowState == DataControlRowState.Edit)
{
e.Row.CssClass = "rowEdit";
}
}
.grdView tr.row:hover
{
background-color: #999999;
font-weight:bold;
}
.grdView tr.editRow
{
background-color: #999999;
font-weight:bold;
}
.rowEdit
{
background-color: #999999;
font-weight:bold;
}
.grdView .row .edit, .grdView .row .delete
{
display:none;
}
.grdView tr.row:hover td .edit, .grdView tr.row:hover td .delete
{
display:inline;
}
View 3 Replies
Mar 15, 2013
How can i but alternate Image if No image retrieve in image Control ?
View 1 Replies
Aug 2, 2010
I want to return pure JSON from an MVC 2 Action. How can i do this?
View 4 Replies
Apr 20, 2010
give a link with sample if possible
View 4 Replies
May 6, 2010
I want an asmx webservice with a method GetPeople() that returns the following XML (NOT a SOAP response):
<People>
<Person>
<FirstName>Sara</FirstName>
<LastName>Smith</LastName>
</Person>
<Person>
<FirstName>Bill</FirstName>
<LastName>Wilson</LastName>
</Person>
</People>
View 4 Replies
Dec 28, 2010
[Code]....
i need to call pure JS inside UpdatePanel becouse of DayPilotPro but when i am using UpdatePanel this is not possible. How can i call it?
View 1 Replies
Jun 22, 2010
I have what should be a relatively simple task that's frankly got me stumped. I've researched it until my brain is fried, and now I'm puntingHere's the scenario:I have an ASPX page (Q2.aspx) that is decorated with the WebService,WebServiceBinding, and ScriptService attributes. That page contains a method, GetAllContacts, that is decorated with the WebMethodattribute and returns a string containing JSON data. (For what it's worth, the pageitself contains no other controls or functionality.)I have an HTML page that contains JavaScript which uses the XmlHttpRequestobject to invoke the GetAllContacts WebMethod on the ASPX page and transformthe JSON data into an HTML table. I have verified that my Web.Config file contains the appropriate protocol handlersfor HttpGet and HttpPut in the WebServices section under System.Web.webServices.
I have verified that my Web.Config file contains the ScriptModule entry under theSystem.webServer.modules section, and that it matches the appropriate documentation.
However, when I view the HTML page in a browser, the following occur:The web request goes through, but the results are for the unprocessed HTML from the ASPX page.The GetAllContacts method is never invoked, as evidenced by setting a breakpoint in its code.The code to invoke the Web service, however, is invoked, and the JavaScript callbackfunction that is invoked upon request completion is properly invoked.
It appears that the JavaScript code is largely set up correctly, but for some reason that is completely escaping me at this point, the HTML page will simply not execute the WebMethod on the ASPX page, and simply returns the page as though it were a plain HTML GET request. Clearly, an HTML document can't be evaluated by JavaScript's eval function, which brings me to my problem. (Also note that the JSON data appears nowhere in the HTML that's returned.)I am, frankly, baffled. I've looked at dozens of Microsoft articles, StackOverflow posts, CodeProject articles, and who knows what else. My code looks like it's okay. But I know better. I'm missing something simple, stupid, and obvious. I just need someone to point it out to me.Below you'll find the ASPX page code and the HTML code, in the hope that they'll shed some light.ASPX Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Q2.aspx.cs" Inherits="Satuit.Q2" enablesessionstate="False" %>
<html>
<body>
[code]...
View 1 Replies
Feb 17, 2011
I'm attempting to create a pure t-sql representation of the default SHA-1 password hashing in the ASP.Net Membership system. Ideally, what I would get would be this:
UserName Password GeneratedPassword
cbehrens 34098kw4D+FKJ== 34098kw4D+FKJ==
Note: that's bogus base-64 text there. I've got base64_encode and decode functions that round-trip correctly. Here's my attempt, which doesn't work: SELECT UserName, Password, dbo.base64_encode(HASHBYTES('SHA1', dbo.base64_decode(PasswordSalt) + 'test')) As TestPassword FROM aspnet_Users U JOIN aspnet_membership M ON U.UserID = M.UserID
I've tried a number of variations on the theme, to no avail. I need to do this in pure T-Sql; involving a console app or something like that will double the work. So if anyone can supply what precisely the syntax should be to duplicate that password from the ASP.Net membership stuff
View 2 Replies
Dec 2, 2010
In your opinion, what's the best way to create the server side to a pure Javascript application with ASP.NET? WCF rendering JSON? IHttpHandler? Update Like GMail, that runs in the browser (with a lot of Javascript) and submit and receive data with Ajax, for example.
View 2 Replies
Aug 4, 2010
Analysis and design C# application with pure object orineted feature .
for example
I get all the requirement for the user, How to analysis the system , keeping future changes in mind , design and system with pure object oriented feature .
in Short : design system with pure object oriented feature so that it flexible so that in future new version can be launch easily
View 1 Replies
Oct 12, 2010
I am trying to use jQuery .load() to get straight html from a asmx web service:
$('#target').load('MyService.asmx/GetHtml');
In .NET code, GetHtml() returns as string:
[WebMethod(EnableSession = false)]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
public string GetHtml()
{
return "<span>Hi</span>";
}
That returns:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/"><span>Hi</span></string>
Notice that the string is encoded. With that encoding, $.load doesn't work right. The displayed text actually has the tags shown.
How can I get the WebMethod call to return just this?
<span>Hi</span>
View 4 Replies
May 23, 2012
I am Importing an excel file using oledb connection in asp.net.
but it is not working on server.
now i want to read excel file without interop.
How can i do it.
View 1 Replies
Jan 9, 2010
i have two buttons, which point to some onclick-methods in my code-behind file. inside these btn_click-codes i want to start adding pure html-code to my page, which was told to me in this forum having done by using ascx-files. note: there would be no code-behind in case of using the ascx-files.
however i do not see a possibility to load these ascx-files within btn_click-code? how to do?
in order to give you an idea of my html-code i have pasted two of them here:
[Code]....
maybe this is the complete wrong approach (as i.e. i believe that body-tags should not be included in .ascx-code). in this - how to do better?
View 7 Replies
Oct 19, 2010
I have a class (let's call it Car) that has a property of type System.Drawing.Color (Call it CarColor). I have a script service function that uses this Car class as a return value, which works just fine. I then have another script service function that takes a Car object as a parameter. I would like to change the color of the car in Javascript, but I am finding it difficult to do so without adding another parameter that takes in the color as a string and is then translated at the server. Are there any ideas on how to set the Color property of the Car object in Javascript and maintain it through to the server?
View 1 Replies
Jan 18, 2011
I m using this code
Menu menu = new Menu();
menu.MenuItemClick += new MenuEventHandler(menu_MenuItemClick);
menu.BackColor = System.Drawing.Color.AliceBlue;
But i want that background color of menu should be seprate two Different color red and AliceBlue
View 3 Replies
Oct 1, 2010
I want simple jquery color picker for font(text) color selection not specific to particular textbox but to all txt boxes on form and must for font color selection not for background color .Simple color picker should like layout color selection.i want color[URL]
View 3 Replies
Apr 12, 2010
I have gridview in asp.net (c#), and i have to column in gridview 1st column it's a number and 2nd column it's a color , and I use SQL server database and I used sqldatasource in asp.net. The question ? I wont the color in 2nd column depending the value from database ,since I saved in the database color name for example :
1 red
2 black
3 blue
4 green
I wont the color in gridview without color name?
View 4 Replies
May 3, 2010
In my application i am using Iframe for opening aspx page which slow down the speed while redering the controls. Is there any other way of calling aspx page from classic asp.
View 1 Replies
Nov 1, 2010
using vb.net/asp.net 2005.
I am trying to set the border color of cells of my datagrid to an HTML color code: #c1c1c1
I have the following and would like to convert it so that it uses my color code and not the text of the color name, does anyone know the syntax? what I have is:
[Code]....
View 3 Replies
Feb 8, 2011
I've a problem with asp:image and asp:imagebutton alternate text: it's not visible when I move the mouse over the image. I declared the object in that way:
<asp:ImageButton ID="ButtonStatus"
ImageUrl='<%# IIF(Eval("Active")=1,"../images/folders/actived.png","../images/folders/deactivate.png")%>' CommandName="ChangeStatus" CommandArgument='<%# Eval("id_repository") %>' OnCommand="FolderCommand"
Enabled = '<% #iif(mySecurity.Admin=1, "True", "False") %>' Width="24px" AlternateText="Change the status"
runat="server" />
and for asp:image
<asp:HyperLink runat="server" ID="url_groups" NavigateUrl="~/action/Group_manager.aspx?action=2">
<asp:Image id="img_groups" runat="server" ImageUrl="~/Images/folders/group_config.png" AlternateText="Group manager"
EnableViewState="false" ImageAlign="Middle" Width="32px" CssClass="navigation" />
</asp:HyperLink>
View 2 Replies
Dec 7, 2010
I am using query string when I do a Page redirect.Please could somebody give me an alternate solution for this.I do not want to use Query string in this case
[Code]....
[Code]....
View 4 Replies