Dynamically adjust height and width of image with maintaining aspect ratio - c#

Kindly tell me how i adjust image width and height. When i upload Image it automatically adjust in repeater according to their height and width but inside the part of repeater.
that's my code
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script src="LJCI/js/jquery-1.7.2.min.js"></script>
<script src="LJCI/js/lightbox.js"></script>
<link href="LJCI/css/lightbox.css" rel="stylesheet" />
<asp:DataList ID="GalleryDataList" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" OnItemDataBound="GalleryDataList_ItemDataBound">
<ItemTemplate>
<div style="margin-left: auto;
margin-right: auto; width: 250px; margin-top: 15px; padding-left: 15px;">
<div style="border-radius:10px;height:auto; border: 1px solid #CCCCCC;box-shadow: 0 2px 4px rgba(0,0,0,0.9);">
<div class="lightbox-container">
<div class="box">
<a id="Img2" href='<%# Eval("ImgUrl").ToString().Substring(1) %>' rel="lightbox[roadtrip]" title='<%# String.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9}","Arrival Date: ", Eval("ArrivalDate","{0:d}"), "<br/><br/>","Brush:", Eval("Brush"), "<br/><br/>", "Size: ", Eval("Width"), "x",Eval("Height") )%>'data-lightbox="roadtrip" data-caption="image-1" >
<asp:Image ID="Img1" runat="server" ImageUrl='<%#Eval("ImgUrl") %>' CssClass="aspectRatio" /></a>
<div class="title1 " style="text-align:left;padding-left:10px ;margin-bottom:16px;">
<asp:Label ID="lblReference" runat="server" Text='<%# Eval("Reference")%>' /><br />
Size: <asp:Label ID="lblWidth" runat="server" Text='<%# Eval("Width")%>' /> x <asp:Label ID="lblheight" runat="server" Text='<%# Eval("Height")%>' /><br/>
<asp:Label ID="lblBrush" runat="server" Text='<%# Eval("Brush")%>' /><br />
<asp:Label ID="lblDate" runat="server" Text='<%# Eval("ArrivalDate","{0:d}")%>' /><br />
<asp:Label CssClass="lblClass" ID="lblStatus" ForeColor="#B86365" runat="server" Text='<%# Eval("Sold").ToString() == "1"? "Sold" : "Available" %>' />
<br /> <br /><asp:HyperLink ID="DetailsHyperLink1" CssClass="btnClss2" ForeColor="#B86365" runat="server" NavigateUrl='<%# Eval("Id", "OrderForm.aspx?Id={0}") %>'>Enquiry</asp:HyperLink>
<br /><div class="fb-like" data-href='<%# Eval("ImgUrl", "http://#.com/Images/prod/{0}") %>'" data-width="20" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
</div></div>
<div style="clear: both;">
</div>
</div>
</ItemTemplate>
Code output
like this i want to adjust my images according to their positions

Related

Is there is a way to apply css descendant combinator in asp.net labels

.box
{
font-family:'Verdana';
margin:0;
padding:0;
top:50%;
left:50%;
transform:translate(-50%,-50%);
width:400px;
position:absolute;
padding:40px;
box-sizing:border-box;
box-shadow:0 5px 10px rgba(0,0,0,.7);
border:1px solid rgba(0,0,0,.1);
font-size:15px;
}
.InputType
{
font-family:'Verdana';
padding:10px 0;
margin-bottom:30px;
width:100%;
box-sizing:border-box;
box-shadow:none;
outline:none;
border:none;
border-bottom:2px solid rgb(44, 128, 35);
}
.Labelll
{
font-size:25px;
font-family:'Verdana';
}
.Submit
{
border:none;
cursor:pointer;
background:rgb(44, 128, 35);
color:#FFFFFF;
margin-bottom:5px;
width:100%;
padding:10px 10px 10px 10px;
font-size:15px;
font-family:'Verdana';
}
.Message
{
font-size:12px;
font-family:'Verdana';
}
a,a:visited,a:active,a:hover
{
color:rgb(44, 128, 35);
font-family:'Verdana';
}
<div class="box" >
<asp:Label ID="Labell" runat="server" Text="Sign Up" CssClass="Labelll"></asp:Label>
<br />
<br />
<asp:Label ID="UserName" runat="server" Text="Your Name"></asp:Label>
<br />
<asp:TextBox ID="TextUserName" runat="server" CssClass="InputType"></asp:TextBox>
<br />
<asp:Label ID="EMailId" runat="server" Text="Email Id"></asp:Label>
<br />
<asp:TextBox ID="TextEMailId" runat="server" CssClass="InputType"></asp:TextBox>
<br />
<asp:Label ID="Password" runat="server" Text="Password"></asp:Label>
<br />
<asp:TextBox ID="TextPassword" runat="server" TextMode="Password" CssClass="InputType"></asp:TextBox>
<br />
<asp:Label ID="ConfirmPassword" runat="server" Text="Confirm Password"></asp:Label>
<br />
<asp:TextBox ID="TextConfirmPassword" runat="server" TextMode="Password" CssClass="InputType"></asp:TextBox>
<br />
<asp:Button ID="SignUp" runat="server" Text="Register" CssClass="Submit"/>
<br />
<asp:Label runat="server" Text="Already registered?" CssClass="Message">
Already registered
Login
</asp:Label>
</div>
I'm learning asp.net technology and after a while I just got stuck up with the css in asp.net.Is there is any way for how to apply descendant combinators for asp.net labels and other css selectors as well as some other css properties are not working for asp.net labels so how can I do that?I have also provided the code snippets.

OnChanged even't isn't firing (AJAX raiting control) inside a datalist

I'm using the latest ajax toolkit version. I've tried to put the rating control in a datalist, but the OnChanged event for some reason isn't firing.
That's the normal ASPX.NET page:
<asp:DataList ID="DataListEpisodes" runat="server" Style="position: relative; bottom: 330px;" Visible="False" RepeatColumns="1" OnItemDataBound="DataListEpisodes_ItemDataBound" DataKeyField="EpisodeID" OnItemCommand="DataListEpisodes_ItemCommand">
<ItemTemplate>
<table>
<tr>
<td>
<td>
<asp:Image ID="ImageEpisodeImage" class="EpisodeImage" runat="server" ImageUrl='<%# Eval("EpisodeImage", "https://image.tmdb.org/t/p/original{0}") %>' />
</td>
</td>
<td>
<asp:Label ID="LabelEpisodeNumber" runat="server" Style="font-family: Gotham Ultra; font-size: 25px; font-weight: bold;"
Text='<%# Eval("SeasonNumber", "Season {0}") + ", " + Eval ("EpisodeNumber", "Episode {0}") %>'></asp:Label>
<br />
<asp:Label ID="LabelEpisodeName" Style="font-family: Proxima Nova Semibold; font-size: 20px; font-weight: bold;" runat="server" Text='<%# Bind("EpisodeName") %>'></asp:Label>
<br />
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="True" class="LabelOverview" Text='<%# Bind("EpisodeOverview") %>' TextMode="MultiLine"></asp:TextBox>
<br />
<asp:Button ID="ButtonAddEpisode" class="ButtonAddEpisode" runat="server" Text="Add Episode To Watch History" CommandName="AddEpisode" />
<asp:Button ID="ButtonRemoveEpisode" class="ButtonAddEpisode" runat="server" Text="Remove Episode From Watch History" CommandName="RemoveEpisode" />
<br />
<asp:Button ID="ButtonWatchListAdd" class="ButtonEpisodeWatchList" runat="server" Text="Add Episode To Future Watch List" CommandName="AddWatchList" />
**<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ajaxToolkit:Rating ID="Rating1" OnChanged="OnRatingChanged" style="position: relative;right: 301px;top: 16px;" AutoPostBack="true" runat="server"
StarCssClass="Star" EmptyStarCssClass="Star"
FilledStarCssClass="FilledStar" WaitingStarCssClass="Star">
</ajaxToolkit:Rating>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Rating1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>**
</tr>
</table>
<br />
<br />
<br />
<br />
</ItemTemplate>
</asp:DataList>
and that's the codebehind:
protected void OnRatingChanged(object sender, AjaxControlToolkit.RatingEventArgs e)
{
int rowIndex = ((sender as AjaxControlToolkit.Rating).NamingContainer as DataListItem).ItemIndex;
int RatingChosed = Rating1.CurrentRating;
int EpisodeID = Convert.ToInt32(DataListEpisodes.DataKeys[rowIndex].ToString());
}
Thank you if someone can help me :D

Display Pop up using nested datalist details

My first 'Datalist1' retrieves some values from database i.e.,
Bus Route ID,
Vehicle number,
Trip date,
Bus source station name,
Bus Destination name
Another 'nested Datalist' which is placed inside datalist1 displays Bus icons of stages according to the number of stages between source and destination.
I succeeded to retrieving the data correctly and displayed a pop up using the above retrieved details.
<asp:DataList ID="DataList1" runat="server" RepeatColumns="1" CellSpacing="3" RepeatLayout="Table" BackColor="LightGray" OnItemDataBound="DataList1_DataBinding">
<ItemTemplate>
<table class="table">
<tr style="background-color : #b62a26; font-size:medium ; font-family:Verdana; height:40px ">
<td style="padding-left:5px">
<asp:Label ID="lblTrip" runat="server" Text="TripID:" ForeColor="White"></asp:Label>
</td>
<td style="width:900px; ">
<b> <asp:Label ID="lblTripID" runat="server" Text='<%# Eval("TripID") %>' ForeColor="White"></asp:Label></b></td>
</td>
</tr>
<tr style="background-color: white; font-size:small ; font-family:Verdana; height:60px; ">
<td colspan="2">
<b>RouteID: </b></b>
<asp:Label ID="lblRouteID" runat="server" Text='<%# Eval("RouteID") %>'></asp:Label>
<b>Vehicle NO: </b>
<asp:Label ID="lblVehicleNo" runat="server" Text='<%# Eval("VehicleNo") %>'></asp:Label>
<b>TripDate: </b>
<asp:Label ID="lblTripDate" runat="server" Text='<%# Eval("TripDate") %>'></asp:Label>
<b>From: </b>
<asp:Label ID="lblFromStage" runat="server" Text='<%# Eval("FromStage") %>'></asp:Label>
<b>To: </b>
<asp:Label ID="lblToStage" runat="server" Text='<%# Eval("ToStage") %>'></asp:Label>
</td>
</tr>
<tr style="background-color: white; font-size:small ; font-family:Verdana; height:10px ">
<td style="width:10px"></td>
<td>
<div id="activeBus" style="line-height: 0px; float: left; margin: 0px; padding: 0px; display: inline-block; vertical-align: top;">
<asp:DataList ID="innerDataList1" runat="server" RepeatColumns="10" CellSpacing="3" BackColor="white">
<ItemTemplate>
<asp:Panel ID="Panel2" runat="server" HorizontalAlign="center">
<table>
<tr style=" align-items:center ">
<td>
<asp:ImageButton ID="imgactiveBtn" runat="server" src="\images\ActiveRed.png" Width="15px" Height="15px" OnClick="imgBtn_Click" ToolTip="Track Details" />
<%-- <asp:ImageButton ID="ImageButton1" src="\images\ActiveRed.png" runat="server" Style="cursor: pointer" Width="15px" Height="15px" OnClientClick="return LoadDiv(this.src);"/> --%>
</td>
</tr>
<tr>
<td>
<b><asp:Label ID="lblStageName" runat="server" Text='<%# Eval("StageName") %>' Font-Size="XX-Small" Font-Names="Verdana" ></asp:Label></b>
</td>
</tr>
</table>
</asp:Panel>
</ItemTemplate>
</asp:DataList>
</div>
<div id="inactiveBus" style="line-height: 0px; float: left; margin: 0px; padding: 0px; display: inline-block; vertical-align: top;">
<asp:DataList ID="innerDataList" runat="server" RepeatColumns="10" CellSpacing="3" BackColor="white" OnItemDataBound="innerDataList_ItemDataBound">
<ItemTemplate>
<asp:Panel ID="Panel2" runat="server" HorizontalAlign="center">
<table>
<tr style=" align-items:center ">
<td>
<asp:ImageButton ID="imginactiveBtn" runat="server" src="\images\InActive.png" Width="15px" Height="15px" OnClick="imgBtn_Click" ToolTip="Not Reached yet!" />
</td>
</tr>
<tr>
<td>
<b><asp:Label ID="lblStageName" runat="server" Text='<%# Eval("StageName") %>' Font-Size="XX-Small" ForeColor="#CCCCFF"></asp:Label></b>
</td>
</tr>
</table>
</asp:Panel>
</ItemTemplate>
</asp:DataList>
</div>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<div id="dialog" style="display: none">
<br />
<b>RouteID:</b> <span id="RouteID1"></span> <label id="lblEmpId"></label>
<br />
<b>TripDate:</b> <span id="TripDate1"></span> <label id="lblEmpName"></label>
<br />
<b>Stage Name:</b> <span id="StageName1"></span><label id="lblEmpLocation"></label>
<br />
<b>Scheduled Arrival:</b> <span id="Scheduled_Time1"></span>
<br />
<b>Reached On:</b> <span id="Arrival_Time1"></span>
<br /><br />
</div>
Jquery code is:
$(document).on("click", "[id*=imginactiveBtn]", function () {
$("#RouteID1").html($(".RouteID", $(this).closest("tr")).html());
$("#TripDate1").html($(".TripDate", $(this).closest("tr")).html());
$("#StageName1").html($(".StageName", $(this).closest("tr")).html());
$("#Scheduled_Time1").html($(".Scheduled_Time", $(this).closest("tr")).html());
$("#Arrival_Time1").html($(".Arrival_Time", $(this).closest("tr")).html());
// Get the Current Row and its values.
var currentRow = $(this).parents("tr");
var RId = currentRow.find("span[id*='lblRouteID']").text();
var TDate = currentRow.find("span[id*='lblTripDate']").text();
var SName = currentRow.find("span[id*='lblStageName']").text();
// Populate labels inside the dailog.
$("#lblEmpId").text(RId);
$("#lblEmpName").text(TDate);
$("#lblEmpLocation").text(SName);
$("#dialog").dialog({
title: "Track Vehicle at <em>" + SName + "</em>",
buttons: {
Ok: function () {
$(this).dialog('close');
}
},
modal: true
});
return false;
});
    
For example let us assume on 12/10/2017, 2 Trips were active with RouteID's 1 & 2, and each Routes has 3 stages.
When the first stage of route 1 is clicked Popup should display:
Route ID: Route1
TripDate: 12/10/2017
Stage Name: Stage1
When second icon is clicked Popup should should display
RouteID: Route1
TripDate: 12/10/2017
Stage: Stage2 and so on...
Similarly when Stages of Route2 is clicked
Route ID: Route2
TripDate: 12/10/2017
Stage Name: Stage1
and when he clicks second stage of Route 2
Route ID: Route2
TripDate: 12/10/2017
Stage Name: Stage2 and so on.....
But Popup displays:
RouteID: Route1Route2
TripDate: 12/10/201712/10/2017
StageName: Stage1Stage2Stage3Stage1Stage2Stage3
for all the 3 stages of Route1 and for all the 3 stages of Route2.
How can i resolve this. Where am i doing it wrong?

ItemDataBound slowing my page rendering

1My first question ever here, forgive if I am not fluent in tech language because I am a self taught developer from deep Africa Mozambique, thanks to this site.
My question is I have a
public void topicView_ItemDataBound(object sender,e)
In my code behind for a particular aspx page with a repeater, that receives its info from a datatable (if my terminology is correct.) The ItemDataBound event is to arrange my controls in a repeater for the purpose of hiding, disabling and showing other controls according to the determined criterias. Now I have noticed that the ItemDataBound event is slowing my page load time by some 20 to 40 seconds which is really bad, even on post back. When i remove the ItemDataBound events. I am running smoothly. But i can't work with out the ItemDataBound event since its the only way i know how to arrange a repeater with alternating conditions. Is this a common problem with a quick answer or should i post my full code?? this only happens on 2 pages with this event. I am using c# if thats of any help. net.4.5
public void topicView_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
// Show or hid div here
HiddenField MediaType = (HiddenField)e.Item.FindControl("MediaType");
HiddenField PageAdmin = (HiddenField)e.Item.FindControl("PageAdmin");
HiddenField f1 = (HiddenField)e.Item.FindControl("F1");
HiddenField PP = (HiddenField)e.Item.FindControl("PP");
HiddenField isread= (HiddenField)e.Item.FindControl("isread");
HiddenField tread = (HiddenField)e.Item.FindControl("tread");
// Label Label2 = (Label)e.Item.FindControl("Label2");
// Label2.Text = myDDL.Value;
System.Web.UI.HtmlControls.HtmlContainerControl image_video = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("image_video");
System.Web.UI.HtmlControls.HtmlContainerControl image_pic = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("image_pic");
System.Web.UI.HtmlControls.HtmlContainerControl PP1 = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("PP1");
System.Web.UI.HtmlControls.HtmlContainerControl userpic = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("userpic");
System.Web.UI.HtmlControls.HtmlContainerControl compic = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("compic");
System.Web.UI.HtmlControls.HtmlContainerControl userpic2 = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("userpic2");
System.Web.UI.HtmlControls.HtmlContainerControl compic2 = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("compic2");
System.Web.UI.HtmlControls.HtmlContainerControl pf = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("pf");
System.Web.UI.HtmlControls.HtmlContainerControl attach = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("attach");
LinkButton LinkButton3 = (LinkButton)e.Item.FindControl("LinkButton3");
LinkButton LinkButton1 = (LinkButton)e.Item.FindControl("LinkButton1");
Label Label4 = (Label)e.Item.FindControl("Label4");
Label Label10 = (Label)e.Item.FindControl("Label10");
System.Web.UI.WebControls.Image readsign = (System.Web.UI.WebControls.Image)e.Item.FindControl("readsign");
System.Web.UI.WebControls.Image Image2 = (System.Web.UI.WebControls.Image)e.Item.FindControl("Image2");
if (MediaType.Value == "video")
{
image_video.Visible = false;
image_pic.Visible = true;
Image2.ImageUrl = "~/images/readmail.png";
}
if (MediaType.Value == "image")
{
image_video.Visible = true;
image_pic.Visible = false;
}
if (MediaType.Value == "" ) { attach.Visible = false; } else { attach.Visible = true; }
if (PageAdmin.Value == "False")
{
compic.Visible = false;
userpic.Visible = true;
userpic2.Visible = true;
compic2.Visible = false;
}
if (PageAdmin.Value == "True")
{
userpic.Visible = false;
compic.Visible = true;
userpic2.Visible = false;
compic2.Visible = true;
}
if (isread.Value == "True")
{
readsign.ImageUrl = "~/images/readmail.png";
Label4.Text = "foi lido ";
Label10.Text = tread.Value;
}
}
}
and my aspx code for the repeater:
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"
OnItemDataBound="topicView_ItemDataBound"><ItemTemplate>
<div id="messages" style="margin-bottom: 10px">
<asp:HiddenField ID="Status" runat="server"
Value='<%#""+Eval("Isreplyed") %>' />
<asp:HiddenField ID="Pageadmin" runat="server"
Value='<%#""+Eval("PageAdmin") %>'/>
<asp:HiddenField ID="MediaType" runat="server"
Value='<%#""+Eval("MediaType") %>' />
<asp:HiddenField ID="isread" runat="server" Value='<%#""+Eval("Isread")
%>' />
<asp:HiddenField ID="tread" runat="server" Value='<%#""+Eval("tread","
{0:d / MM " + "#" + " HH:mm}") %>' />
<div id="Omsg" style="padding: 5px; border: thin solid #FFFFFF; box-
shadow:rgba(255, 255, 255,0.9) 0 0 7px; background-color: #FFFFFF;border-
radius:5px; " >
<table style="width: 100%; text-align: left; margin-left: 0px;">
<tr><td colspan="2">
<asp:Image ID="readsign" runat="server" Height="25" Width="25"
ImageUrl="~/images/newmail.png" />
<asp:Label ID="Label4" runat="server" Text='<%# ""+Eval("Isreplyed")
%>' Font-Size="X-Small" ForeColor="#999999"></asp:Label>
<asp:Label ID="Label10" runat="server" Text='<%#""+Eval("datesent","{0:d /
MM " + "#" + " HH:mm}") %>' Font-Size="X-Small" ForeColor="#999999">
</asp:Label>
</td></tr>
<tr>
<td style="width: 66px; text-align: left;"><a id="pps" ><div
id="compic" ClientIDMode="Static" runat="server"><img id="PP1" alt=""
class="img-rounded" src='<%#"/ProfilePictures/"+Eval("logo") %>'
style="width: 50px; height: 50px" /></div><input id="Hidden2" type="hidden"
runat="server" value='<%#"/ProfilePictures/"+Eval("logo") %>' /></a>
<div id="userpic" clientidmode="Static" runat="server">
<img alt="" class="img-circle"
src='<%#"/ProfilePictures/"+Eval("ProfilePicture") %>' style="width: 50px;
height: 50px" />
</div><input id="Hidden3" type="hidden" runat="server"
value='<%#"/ProfilePictures/"+Eval("ProfilePicture") %>' />
</td>
<td style="line-height: 15px"> <div id="compic2"
ClientIDMode="Static" runat="server"> <a href='<%#"/Landing.aspx?
Restid="+Eval("id") %>' ><asp:Label ID="Label2" class="head" runat="server"
Text='<%# ""+Eval("name") %>' Font-Size="Medium" ForeColor="#B9A47B">
</asp:Label> </a><a/><br/>
<asp:Label ID="CName" runat="server"
Text='<%#""+Eval("slogan") %>' Font-Size="Smaller"></asp:Label>. ...</div>
<div id="userpic2" ClientIDMode="Static"
runat="server"><a href='<%#"/Landing.aspx?Restid="+Eval("Username") %>' >
<asp:Label ID="Label8" class="head" runat="server"
Text='<%#""+Eval("Username") %>' Font-Size="Large" ForeColor="#B9A47B">
</asp:Label> <a/><br/>
<asp:Label ID="Label9" runat="server"
Text='<%#""+Eval("Job") %>' Font-Size="Smaller"></asp:Label></a>
<br />
<a/>
<a href='<%#"notificationmaster.aspx?BlogId="+Eval("Blogid") %>'> <asp:Label
ID="Label5" runat="server" Text='<%# "Respondendo à publicação :
"+Eval("BlogTitle") %>' Font-Size="smaller" ForeColor="#B9A47B"></asp:Label>
</a><br/>
</div>
<a/><span style="font-size: x-small; color: #999999">
enviado : </span><asp:Label ID="Label3" runat="server"
Text='<%#""+Eval("datesent","{0:d MMMM yyyy - HH:mm}") %>' Font-Size="X-
Small" ForeColor="#999999"></asp:Label></a>
<br />
<div id="attach" ClientIDMode="Static" runat="server" >
<asp:Label ID="Label17" runat="server" Text="Esta mensagem tem anexo"
ForeColor="#999999" Font-Size="X-Small" Font-Underline="True">
</asp:Label> <img alt="" src="images/attach.png" style="width: 20px;
height: 20px" /></div>
</td>
</tr>
<tr>
<td colspan="2">
<br/>
<div id="msgbody" style="display: none">
<asp:Label ID="Label1" runat="server" Text='<%#""+Eval("mbody") %>'>
</asp:Label><br/>
<div id="image_pic" ClientIDMode="Static" runat="server" >
<asp:HiddenField ID="HiddenField1" runat="server"
Value='<%#"/PostImages/"+Eval("image") %>' />
<asp:Image ID="Image1" class="img-thumbnail" ClientIDMode="Static"
runat="server" ImageUrl='<%#"/PostImages/"+Eval("image") %>' alt="Broken"
Width="100%" />
</div>
<div id="image_video" runat="server" onclick="AddView" >
<video id="PostVedio" runat="server" controls
poster="/images/chimoioonline.png" src='<%#"/video/"+Eval("video") %>'
style="width: 100%">
<source src="demo.mp4" type="video/mp4" />
<source src="demo.webm" type="video/webm"/>
<source src="demo.ogv" type="video/ogg"/>
<source src="demo.ogv" type="video/avi"/>
<p>Fallback code if video isn't supported</p>/
</video></div></div>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: right">
<hr style="padding: 2px; margin: 5px" />
<div id="deletm" style="display: inline-block">
<input id="Hidden1" type="hidden" runat="server"
value='<%#Eval("id")%>' />
<asp:LinkButton ID="LinkButton3" runat="server" CssClass="btn"
onclick="pmdelet" BorderColor="#CCCCCC" BorderWidth="1px"><img
src="/images/delete.png" alt="" style=" height: 15px" />
</asp:LinkButton> <br />
</div>
<div id="sendpm" style="display: inline-block">
<input id="mido" type="hidden" runat="server"
value='<%#Eval("id")%>' />
<input id="Hidden4" type="hidden" runat="server"
value='<%#Eval("BlogId")%>' />
<input id="sender2" type="hidden" runat="server"
value='<%#Eval("sender")%>' />
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="btn"
BorderColor="#CCCCCC" BorderWidth="1px" OnClientClick=""
PostBackUrl='<%#"PMS.aspx?id=" + Eval("id") + "&BlogId=" + Eval("BlogId")+
"&sender=" + Eval("sender")%>' ><img src="images/pvtemail.png" alt=""
style=" height: 15px" /></asp:LinkButton>
</div>
<div id="read" style="display: inline-block">
<input id="H5" type="hidden" runat="server"
value='<%#Eval("id")%>' />
<input id="H7" type="hidden" runat="server"
value='<%#"/ProfilePictures/"+Eval("logo") %>' />
<input id="H8" type="hidden" runat="server"
value='<%#"/ProfilePictures/"+Eval("ProfilePicture") %>' />
<input id="H6" type="hidden" runat="server"
value='<%#Eval("Isreplyed")%>' />
<input id="H14" type="hidden" runat="server"
value='<%#Eval("Username")%>' />
<input id="H10" type="hidden" runat="server"
value='<%#Eval("name")%>' />
<input id="H13" type="hidden" runat="server"
value='<%#Eval("Subject")%>' />
<input id="H9" type="hidden" runat="server"
value='<%#Eval("BlogTitle")%>' />
<input id="H11" type="hidden" runat="server"
value='<%#Eval("datesent","{0:d / MM " + "#" + " HH:mm}")%>' />
<input id="H12" type="hidden" runat="server"
value='<%#Eval("mbody")%>' />
<input id="v5" type="hidden" runat="server" value='<%#
Eval("video")%>' />
<input id="p5" type="hidden" runat="server"
value='<%#Eval("image")%>' />
<input id="sender" type="hidden" runat="server"
value='<%#Eval("sender")%>' />
<input id="Hidden5" type="hidden" runat="server"
value='<%#Eval("Blogid")%>' />
<input id="PageAdmin2" type="hidden" runat="server"
value='<%#Eval("PageAdmin")%>' />
<asp:LinkButton ID="LinkButton2" runat="server" CssClass="btn"
BorderColor="#CCCCCC" BorderWidth="1px" OnClientClick="return false"><img
src="/images/read2.png" alt="" style=" height:15px" /></asp:LinkButton>
</div>
</td>
</tr>
</table>
</div>
<div id="Rmsg">
</div>
</div>
</ItemTemplate></asp:Repeater>
My Server profiler screen shot
This is not really an answer, but more a way for you to delve deeper into whats the problem. (And it's to long for a comment)
First of all you need to make sure you have SQL server managment tools installed, in particular you need the tool called SQL server profiler.
In profiler you go to "file" "new trace" and connect to you SQL server.
In the Trace properties you select only "RPC:completed" and "SQL:BatchCompleted".
Now you can run your aspx page, and you should se all SQL queries generated by the page in the profiler. There are two things you should look out for.
First of all, look for long running queries. The duration column is in MS and you should not have anyone longer than 1000ms.
Secondly, the number of queries run when the page is run. A normal page should not exceed 20 queries. Usualy when you get problems with this, you could run hundreds.

Image display using datalist

Here is my code which I used image slider display image using datalist but I don't have any idea how can I display big image when image slide here is my code:
<div id="photos" class="galleryview">
<img src="images/home_gallery/banner1.jpg" />
<div style="margin: 30px 0px 0px 0px">
<asp:DataList RepeatDirection="Horizontal" ID="dl_Images" runat="server" OnItemDataBound="dl_Images_ItemDataBound"
OnItemCommand="dl_Images_ItemCommand">
<ItemTemplate>
<ul class="filmstrip">
<div class="panel">
<a href="" id="img_href" runat="server">
<div class="panel-overlay" align="left">
<li>
<asp:Image BorderColor="#ececec" BorderStyle="Solid" BorderWidth="1" runat="server"
ID="i_ProductImage" Width="104" Height="104" />
</li>
</a>
</div>
<div align="center" style="margin: 0px 0px 0px 0px">
<asp:LinkButton ToolTip='<%# Eval("ProductID") %>' CommandArgument='<%# Eval("ProductID") %>'
CommandName="lbclick" ID="lb_productID" runat="server" Text='<%# Eval("ProductID") %>'
CssClass="bule-link"></asp:LinkButton>
</div>
<%--<asp:Label ID="l_ProductId" runat="server" Text='<%#Eval("ProductId") %>'></asp:Label>--%>
</div>
</ul>
</ItemTemplate>
</asp:DataList>
</div>
</div>

Categories

Resources