I need to show a div like in this image (top), but I have this ugly version (bottom):
At the moment I am using this code:
<asp:Repeater ID="DataViewer" runat="server">
<ItemTemplate>
<div style='border: 0px; width:600px;'><%# Eval("DriverId") %>
<div style='border: 3px solid black; width:<%# Eval("OrderCount") %>cm;'><%# Eval("OrderCount") %>
<div style='border: 0px; background-color: red; width:<%# Eval("OrderCountWhereNameIsNotNull") %>%;'>
<%# Eval("OrderCountWhereNameIsNotNull") %>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
How can I solve this?
<%# Eval("DriverId") %>
%;'><%# Eval("OrderCount") %> %;'> <%# Eval("OrderCountWhereNameIsNotNull") %>
you must use '%' instead of cm.
Hope this will solve your problem.
<div style='border: 0px; width:600px;'><%# Eval("DriverId") %>
<div style='border: 3px solid black; width:<%# Eval("OrderCount")
Something wrong there with syntax because color mismatched. In this case its better to delete this tag and write it again.
Related
Style
<style>
ul{
list-style-image: url('../8iAbk7rjT.png');
}
</style>
Coding
<ul>
<asp:DataList ID="dd" runat="server">
<ItemTemplate>
<li><a href="/Pages/index.aspx?category=<%#Eval("id") %>">
<%#Eval("name") %></a></li>
<hr />
</ItemTemplate>
</asp:DataList>
</ul>
How to Get an image As UL style in asp.net.
Any solution??
There is nothing special to do in asp.net for this. It's CSS matter. Your code is fine, just check for image url whether it's correct or not.
ul{
list-style-image: url('http://forums.androidcentral.com/images/smilies/cool.png');
padding: 0 0 0 30px;
margin: 0 0 0 15px;
}
I have a list on top of my page that has a few different countries on it. I need to have an #anchor that will pop half way down the page to the country picked. However the countries down the page are pulled from a Database and are listed by HyperLinks in a repeater.
<td align="center">
<ul style="list-style-type: none;">
<li>USA </li>
<li>Canada </li>
<li>Australia </li>
</ul>
</td>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<asp:HyperLink ID="hlCountryName" runat="server" Style="color: #6D94B8; font-size: 20px; font-weight: bold; margin-bottom: 5px; padding-left: 10px;"></asp:HyperLink>
And inside the DataList1_ItemDataBound method in the C# section I did:
hlCountryName.Attributes.Add("href", "#" + drCountry[Common.Data.Country.Constants.countryName].ToString());
Yet when I click on the link at the top of the page I am not taken anywhere. I am wondering what I could be missing in my code? Or if I have miss understood how to do this altogether? Any help is appreciated. Thanks!
You should just try to replace this line :
hlCountryName.Attributes.Add("href", "#" + drCountry[Common.Data.Country.Constants.countryName].ToString());
with :
hlCountryName.Attributes.Add("name",drCountry[Common.Data.Country.Constants.countryName].ToString());
just now when i was created my master page it gives me this error. The page has one or more asp content that do not correspond withasp content place holder.
What is wrong with my master page? Here is my code of master page. Thank you.
<%# Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs"
Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Master</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1
{
height: 63px;
}
.style3
{
height: 101px;
font-size: xx-large;
font-weight: 700;
font-family: Tahoma;
text-align: center;
color: #FFFFFF;
}
.style6
{
width: 146px;
height: 592px;
}
.style7
{
width: 897px;
height: 592px;
}
.style8
{
height: 592px;
}
.style9
{
font-size: small;
height: 101px;
border-left-color: #808080;
border-right-color: #C0C0C0;
border-top-color: #808080;
border-bottom-color: #C0C0C0;
background-color: #996633;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width: 100%; height: 623px; margin-bottom: 0px;">
<tr>
<td bgcolor="#996633" class="style3" colspan="3">
Malaysia Car Booking System<br />
<span class="style9">Your satisfaction is our Priority</span></td>
</tr>
<tr>
<td bgcolor="#CC6600" class="style6">
</td>
<td bgcolor="#FF9900" class="style7" style="vertical-align: top">
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</td>
<td bgcolor="#CC6600" class="style8">
</td>
</tr>
<tr>
<td bgcolor="#996633" class="style1" colspan="3">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
What's wrong is that you have a Content tag in your content page that doesn't have a corresponding ContentPlaceHolder tag in the master page.
The only ContentPlaceHolder tag in the master page is in the head tag. It is quite uncommon to not have any in the body tag, as it makes it hard to introduce any body content from the content page. You have a PlaceHolder tag in the body that you perhaps meant to be a ContentPlaceHolder tag?
It would appear that your page has <asp:content> tags which do not correspond to <asp:ContentPlaceHolder> controls in your MasterPage.
For this type of solution, master pages never support comments in the format <!-- -->
This could be causing your error.
I got the same error when I created a very simple master page and let visual studio create a normal page based on that master page. After running the website, the error message disappeared. It seemed like the error message was based on the old master page and that visual studio used the changed master page only for verification once the website was actually run. Strange :-(
You need to include runat = "server" in title tag most of the time it solve the problem
I am using a popup control with a link button inside that is used to close the popup. The problem is that the link button (or image button in the code below) is causing a full postback which is not intended. Can anyone help? below is the code.
<asp:PopupControlExtender ID="PopupControlLogin" BehaviorID="logpop" Position="Bottom"
TargetControlID="myLogin" PopupControlID="PanelLogin" runat="server">
</asp:PopupControlExtender>
<asp:Panel ID="PanelLogin" Style="position: absolute; display: none;" runat="server">
<div style="border: solid 1px #808080; border-width: 1px 0px;">
<div style="background: url(images/sprite.png) repeat-x 0px -200px;">
<asp:Label ID="Label2" runat="server" Style="font-weight: bold;" Text="Login" />
<asp:ImageButton ID="ImageButton1" Style="background: url(images/sprite.png) no-repeat 0px -300px;"
OnClientClick="$find('logpop').hide(); return false;" runat="server" />
</div>
<div style="background-color: #f2f2f2; width: 300px; height: 150px;">
My Content
</div>
</div>
</asp:Panel>
You are using it correctly, but I think there's an error in your jquery $find. Should be
$('#logpop').hide();
or
OnClientClick="$('#logpop').hide(); return false;"
I would change the button to a straight HTML link:
<img src="images/sprite.png" />
You can adjust the display as needed, but this should be what you need.
I have the following panel
<asp:Panel ID="pnlSessionController" runat="server" style="position: relative; display: block; padding:15px; height: 150px; width: 300px; background-color: white;">
<div style="position:absolute; top:0; right: 0;">
<asp:ImageButton ID="btnActiveSessionCancel" runat="server" ImageUrl="~/images/controls/exit.png" />
</div>
<div style="margin-left: auto; margin-right: auto; width: 270px; text-align: center;">
<asp:Image ID="imgStatus" runat="server" ImageUrl="~/images/status/current.png" /><br />
<asp:Label ID="lblInmateStationName" runat="server"></asp:Label><span><--></span><asp:Label ID="lblVisitorStationName" runat="server"></asp:Label><br />
<span>Time Remaining: </span><asp:Label ID="lblTimeRemaining" runat="server" ForeColor="Red"></asp:Label>
</div>
<div style="padding-left: 20px; padding-top: 15px;">
<div style="float: left; padding-right: 10px;">
<asp:ImageButton ID="imgBtnSessionRestart" runat="server" ImageUrl="~/images/controls/play.png" OnClick="btnRestart_click" />
</div>
<div style="float: left; padding-right: 10px;">
<asp:ImageButton ID="imgBtnSessionPause" runat="server" ImageUrl="~/images/controls/pause.png" OnClick="btnPause_click" />
</div>
<div style="float: left; padding-right: 10px;">
<asp:ImageButton ID="imgBtnSessionRecord" runat="server" ImageUrl="~/images/controls/record_off.png" />
</div>
<div style="float: left; padding-right: 10px;">
<asp:ImageButton ID="imgBtnSessionStop" runat="server" ImageUrl="~/images/controls/stop.png" OnClick="btnEnd_click" />
</div>
<div style="float: left; padding-right: 10px;">
<asp:Image ID="imgBtnSessionMonitor" runat="server" Height="27px" Width="27px" ImageUrl="images/controls/monitor.png" onclick="monitorSesion()"/>
</div>
<div style="float: left;">
<asp:ImageButton ID="imgBtnMessage" runat="server" ImageUrl="~/images/controls/message.png" OnClick="btnMessage_click"/>
</div>
</div>
</asp:Panel>
Because this information is going to be bound server side depending on which control in a datalist is selected I have:
<cc1:ModalPopupExtender ID="mpeActiveSession" runat="server" TargetControlID="hackForPopup" DropShadow="false" PopupControlID="pnlSessionController"
CancelControlID="btnActiveSessionCancel" OnCancelScript="ActiveSessionPopupCanceled()"></cc1:ModalPopupExtender>
I then call mpeActiveSession.Show() in the code-behind after I bind the data.
OK, I had a drop shadow specified in the control but that is where the story begins. I finish this guy up and it is working beautifully, and the damn customer complains that the pop-ups don't look suave enough. What they really meant was that the pop-ups don't look enough like Mac Windows. Anyways, they requested rounded corners and for the drop shadow to be less opaque and rounded. So, I say ok, hopefully I can just add the following.
<cc1:RoundedCornersExtender ID="rceSessionController" TargetControlID="pnlSessionController" Radius="10" runat="server" Corners="All" BorderColor="Gray"></cc1:RoundedCornersExtender>
<cc1:DropShadowExtender ID="dsSessionController" runat="server" Opacity=".7" TrackPosition="true" TargetControlID="pnlSessionController"></cc1:DropShadowExtender>
Now it doesn't render correctly. One of the divs gets the rounded corner, the position on the page is wrong, and all of the controls and text are missing. Any ideas? I am also open to a better approach to styling the popup.
Ok the RoundedCornersExtender and the DropShadowExtender are obsolesced by CSS3. All you need is border-radius and box-shadow.
Anyhow, the problem with the extenders was that my parent div used relative positioning. It doesn't matter now however, because the CSS3 stuff looks much better and is easier to implement anyways.