Web Forms :: ImageButton Produces Invalid HTML: Border="0"?
Jan 19, 2011
I'm getting an error out of WC3's HTML validator.
This is the error:
Line 102, Column 346: there is no attribute "border"
..., "", true, "", "", false, false))" border="0" />
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
My client wants my pages to validate.
This is my markup:
<asp:ImageButton
ID="cmdTabMyPlanner"
CssClass="NavigationTab"
ImageUrl="images/nav-2.jpg"
runat="server"
/>
And this is the HTML it produces:
<input type="image" name="ctl00$cphMenu$cmdTabMyPlanner" id="ctl00_cphMenu_cmdTabMyPlanner" class="NavigationTab" src="images/nav-2.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$cphMenu$cmdTabMyPlanner",
"", true, "", "", false, false))" border="0" />
View 3 Replies
Similar Messages:
Jul 7, 2010
I am trying to render a hyperlink to html. ( etc)
When the page loads it works fine. (and lots 10 links) on the update panel it hits the same function and tries to get another 10 links. I set the navigationURL to something like
"../Folder/Mypage.aspx?498592ghjgfosdfgo"
It is set identically both times(load and updatepanel postback) but when i try to render it to html the second time (on the update panel) it adds "../" to the front so i end up with
"../../Folder/Mypage.aspx?498592ghjgfosdfgo"
The function where it changes here
Public Shared Function RenderControl(ByVal c As Control) As String
Dim sw As New IO.StringWriter
Dim htmlw As New HtmlTextWriter(sw)
c.RenderControl(htmlw)
Return sw.ToString
End Function
c is the hyperlink which has the propertry navigationurl (this never gets changed) but the sw which ends up looking like this on load
<a id="lnkView" href="../Folder/mypage.aspx?AnTfh0ZsFP9NCxiBpM+Zd11cI+AUOF93HZQtumPgzMKky0PejGrda9I6kCFn070dOsIfq0M2AgI=">View</a>}
and this on panel update
<a id="lnkView" href="../../Folder/mypage.aspx?AnTfh0ZsFP9NCxiBpM+Zd11cI+AUOF93HZQtumPgzMKky0PejGrda9I6kCFn070dOsIfq0M2AgI=">View</a>}
View 1 Replies
May 20, 2010
I'm using an ImageButton inside a repeater with an ItemCommand. The repeater is used as a trigger to an UpdatePanel. The XHTML generated puts an 'ItemCommand' attribute in the <input> element corresponding to the ImageButton. This causes XHTML validation (using the W3C validator) to fail, because ItemCommand isn't a valid attribute for input.
I've Googled and found nothing about this, and the MSDN page assures me that asp.net generates perfect XHTML.
View 2 Replies
Feb 11, 2011
I have a page that uses a master page. The following code only shows the bare minimum of the page:
[Code]....
Code-behind:
[Code]....
The [Code]....
My guess is that it may releated to the ID's that are recreated.
View 14 Replies
Feb 25, 2010
I am using the html table in my aspx page.
On a button click i will find a cell using the inputs -row index and cell index . I am setting a black border to the cell as follows
[Code]....
On giving next inputs i want to reset the border of previously selected cell and set border to newly found cell.
i have no way in my hand to reset it.
View 2 Replies
May 6, 2010
i have a gridview that directly bind to a dataset.Hence there is no column in code behind for me to control the boarder color and border style.I try my code in RowDataBound, but it does not take effect.
View 3 Replies
Aug 15, 2010
having trouble with opening a .aspx page inside of an iframe
currently have the following code
<body>
This is the PARENT FORM
<iframe id="childFrame" name="childFrame" src="TestDefault.aspx" width="100%" height="300" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
A name was started with an invalid character. Error processing resource 'file:///C:/Users/Alk/Desktop/IFrame/Test/Default.a...
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
-^ which loads in to the iframe....
View 3 Replies
Jun 27, 2010
I have the following code the form of a datalist,
<asp:DataList ID="DataList1" runat="server" BorderColor="black" CellPadding="3" Font-Names="Verdana"
Font-Size="8pt">
[code]...
View 5 Replies
Jan 25, 2011
When I try to load a page on my site that has a link that allows users to delete a row from a SQL Database, I get the following error:C30506: Handles clause requires a WithEvents variabledefined in the containing type or one of its base types.
[Code]....
View 6 Replies
Mar 14, 2010
I have really stucked at a big problem using the AsyncFileUpload inside a TabContainer. It seems that when I have put the AsyncFileUploadControl inside a TabPanel in the TabContainer and now switch tab manually by clicking I receive an error that is another codefile than the .cs file. I cant understand what is causing this error ?
The Error that is highlighted in the code will be this:
a._innerTB.style.width=a._inputFile.offsetWidth-107+"px";
[Code]....
View 2 Replies
Jan 21, 2011
I have used IValidateObject successfully using a strongly typed view using HTML Helpers. When I hand code a view, still using a strongly type view, but no HTML/AJAX helpers, e.g.
[Code]....
Note: I am also handcoding the ajax and validation js.
When I post back to the Controller, even though the model data is correct, the ModelState is always invalid, having delved into the ModelState and found the error, it is always on the Model property where the IValidateObject.Validate is used. If I stop implementing the IValidObject on my model it all works fine, but I lose my IValidObject.Validate validation rules. Is there something I can do about this, what determines and at what point does .NET check validity of the ModelState? Presumably I am missing something that needs to be set on the ModelState and is not happening as I am hand coding the views/js.
View 2 Replies
Jan 18, 2011
Sure this is something obvious, but I can't see it.I have an area in my project, UserAdministration. Whenever I call anything in the area I get a 404 error.The AreaRegistration class contains:
[Code]....
The AdminController contains a method for Index.RouteDebug shows the route is to the correct controller (Admin) and action (Index).
View 10 Replies
Aug 8, 2010
I have the following statement:
List<string> tracks = new List<string> { "ABC", "DEF" };
var items = (from i in Agenda.AgendaSessions
select i).Where(p => p.Tracks.Any(s => tracks.Contains(s.Code)));
this returns all sessions which track contains either ABC or DEF, now when I rewrite the statement like the following, it returns All sessions regardless, as if the clause always yeilds into true,
var items = from i in Agenda.AgendaSessions
where i.Tracks.Any(s=> tracks.Contains(s.Code))
select i;
Update
if there are other clauses within the where, does that affect the results?
View 1 Replies
Oct 4, 2010
I have a ajax combobox in my page, when i try to select an item from it i can select by typing in text and its selectedindexchanged event fires, but when that event is complete and when i try to select another item from the combobox it produces the following error:
could not complete operation due to error 800a025e,and an alert asks me if i want to debug it.If I press yes then i get this page:
// Name: AjaxControlToolkit.ComboBox.ComboBox.debug.js
// Assembly: AjaxControlToolkit
// Version: 3.0.30930.28736
// FileVersion: 3.0.30930.0
/// <reference name="MicrosoftAjax.js"/>
htmlfile: Could not complete the operation due to error 800a025e.
_setTextSelectionRange: function(textBox, selectionStart, selectionEnd) {
// set the selection range on the text box[code]....
The Weird thing about this is that the error does not occur on the development machine but only on the server.
View 2 Replies
Dec 28, 2010
I have a MasterPage set up with a div that has a border.
The ContentPlaceHolder is within this div.
My question is when I inherit this masterpage and place the content within the assigned area it sometimes overrun the div settings
which were done on the masterpage and displays over then masterpage div.
Is it possible to set the masterpage div to auto detect overspill of the content or can I set the size of the div on each page(even though its a masterpage div)?
View 4 Replies
Jun 7, 2010
Just started learning ASP.Net about three days ago and I have been ploughing through the fantastic tutorial videos. I have got to an issue with something that is demonstrated in this video: from 07:05 to 07:56.
[URL]
The author changes the table row style to include a bottom border by changing the <tr> tag. I have tried this with no success and so I have been Googling and all of the posts I have found say that you cannot change a table row border. This does seem to be the case as I cannot get a change in the border of a table row to show, however it does work perfectly in the video I am linking to above.
the video is in MSWD 2005 and I amin WSWD 2010 but as these are producing HTML (and pretty basic HTML at that) I can't see that the versions would be an issue.
View 5 Replies
Jun 8, 2010
In my application I have a formview where I have a table. In the table I have some labels some of which shows text and some are databind. When there is no value in the database for a label the table is not showing that space where the label is.
How can I have the space even if there is no data.
View 6 Replies
Jun 17, 2012
i set these code to my grid view tag
BorderColor="#919191" BorderStyle="Solid" BorderWidth="1px" GridLines="Both" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderColor="#919191" HeaderStyle-BorderWidth="1px" RowStyle-BorderColor="#919191" RowStyle-BorderStyle="Solid" RowStyle-BorderWidth="1px">
here set border horizental like this i want my grid view has vertical border
View 1 Replies
Jun 22, 2010
I have put a hoplink inside an image like this. This is a test but when looking at the banner that is shown you can see a gray border along the banner (GIF).
Is it possible to get rid of this gray border that is around the actual banner here ?
[Code]....
View 5 Replies
Feb 7, 2011
how can I control the border ( currently it displays thin-line border) and control the display of heading (currently it display 'untitled') and other similar features.
<asp:WebPartManager ID="WebPartManager1" runat="server">
<Personalization Enabled="False" />
</asp:WebPartManager>
<asp:WebPartZone ID="WebPartZone1" runat="server" BorderColor="#CCCCCC"
Font-Names="Verdana" Padding="6">
<EmptyZoneTextStyle Font-Size="0.8em" />
<PartStyle Font-Size="0.8em" ForeColor="#333333" />
<TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
<MenuLabelHoverStyle ForeColor="#D1DDF1" />
<MenuPopupStyle BackColor="#507CD1" BorderColor="#CCCCCC" BorderWidth="1px"
Font-Names="Verdana" Font-Size="0.6em" />
<MenuVerbStyle BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px"
ForeColor="White" />
<PartTitleStyle BackColor="#507CD1" Font-Bold="True" Font-Size="0.8em"
ForeColor="White" />
<ZoneTemplate>
<site:AboutUs ID="AboutUSControl" runat="server" />
</ZoneTemplate>
<MenuVerbHoverStyle BackColor="#EFF3FB" BorderColor="#CCCCCC"
BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />
<PartChromeStyle BackColor="#EFF3FB" BorderColor="#D1DDF1" Font-Names="Verdana"
ForeColor="#333333" />
<HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
<MenuLabelStyle ForeColor="White" />
</asp:WebPartZone>
View 3 Replies
May 18, 2010
I use following code to set an orange border around an image when the corresponding radiobutton is checked. It works not 100% correct. The orange border appaers but only for 1 second (postback?)
[Code]....
View 3 Replies
Feb 5, 2010
I am suffeering from Border style error.
my code is as below:
---------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;[code].....
View 2 Replies
Sep 15, 2010
Iam developing a html reporting. on this i provide the manual settings of the report page like font name, font size, border style,border width,..
in the settings.aspx i save these settings in database like for border style i place a drop down None,thin,thick.
and in report.aspx i get the saved by placing a datatable and fetch the details.
i saved the border style value as thin. i fetch the value and i declare a string and assign the value. after that i have to set the border style to the string.
View 1 Replies
Oct 13, 2010
On every web page I build, the first asp:button always has a blue border at runtime, even if I set another button as the default button. How do I make the default button have the blue border without making it the first button on the page, or get rid of the blue border on the first button?
View 2 Replies
Jun 19, 2012
This is my grid view code
BorderColor="#919191" BorderStyle="Solid" BorderWidth="1px" GridLines="Both" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderColor="#919191" HeaderStyle-BorderWidth="1px" RowStyle-BorderColor="#919191" RowStyle-BorderStyle="Solid" RowStyle-BorderWidth="1px"
It is like this .....
View 1 Replies