|
If you want someone to learn from you example. Please explain step by step.
Thanks.
|
|
|
|
|
Where is the context ??
|
|
|
|
|
I have this in my UI
<a id="DetailLink" runat="server">
<%-- href='<%# "Handler.ashx?img_id=" + Eval("img_id") + "&" + "imagesize=F" %>'>
--%>
<img id="ImgThumbnails" class="photo_198" style="border: 4px solid white" src='<%# DataBinder.Eval(Container, "DataItem.img_id", "Handler.ashx?img_id={0}&imagesize=T") %>'
alt="Thumbnail of Photo Number <%# Eval("img_id") %>" />
</a>
protected void DLThumbnails_ItemDataBound(object sender, DataListItemEventArgs e)
{
// if you selects the thumbnail then treat image as the primary image.
// SELECT [img_id], [img_title], [img_stream] FROM [tbl_images] where img_is_primary = 1
// There is only one priary image.
if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem))
{
System.Web.UI.WebControls.Image ImgNewFullSize = (System.Web.UI.WebControls.Image)e.Item.FindControl("ImgNewFullSize");
This will not work if I use Eval ==> ImgNewFullSize.ImageUrl = "Handler.ashx?img_id=" + Eval("img_id") + "&" + "imagesize=F";
there must be a way through hyperlink?
//imageRef.Attributes.Add("style", "filter:alpha(opacity=90);-moz-opacity .2;");
//imageRef.Attributes.Add("onmouseover", "javascript:makevisible(this,0);");
//imageRef.Attributes.Add("onmouseout", "javascript:makevisible(this,1);");
}
|
|
|
|
|
Hey Always remember,
If you make runat=server, only then you can access it in the server side code.
Also for runat=server controls you cant do Eval in designer to evaluate.
So do this :
<asp:linkbutton runat="server" ID="ImgNewFullSize" ....
Now you can findcontrol imgNewFullSize.
|
|
|
|
|
protected void DLThumbnails_ItemDataBound(object sender, DataListItemEventArgs e)
{
// if you selects the thumbnail then treat image as the primary image.
// SELECT [img_id], [img_title], [img_stream] FROM [tbl_images] where img_is_primary = 1
// There is only one priary image.
if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem))
{
System.Web.UI.WebControls.Image ImgNewFullSize = (System.Web.UI.WebControls.Image)e.Item.FindControl("ImgNewFullSize");
==>this is where I don't know what to do? ImgNewFullSize.ImageUrl = "Handler.ashx?img_id=" + Eval("img_id") + "&" + "imagesize=F";
//imageRef.Attributes.Add("style", "filter:alpha(opacity=90);-moz-opacity .2;");
//imageRef.Attributes.Add("onmouseover", "javascript:makevisible(this,0);");
//imageRef.Attributes.Add("onmouseout", "javascript:makevisible(this,1);");
}
|
|
|
|
|
|
There are lots of differences in Server side code and client side.In client everything that goes are html. So if you want to call a server side, the only option is AJAX. You may use ICallBackEventHandler, UpdatePanel etc to do the trick.
To call a javascript function on the other hand requires you to add Attribute(Using Attributes.Add) which actually represents a client side call.
So you cant mix up them ever.
If you want to mix, you need to rely on AJAX callback to call a few code in the client side.
|
|
|
|
|
to use a javascript function and assing it in the codebehind (Attributes.Add), you must declare the <a> label including runat="server" like this
<a href="Login.aspx" runat="server" id="Link1" >Go to first page</a>
and here
protected void Page_Load(object sender, EventArgs e)
{
Link1.Attributes.Add("OnClick", "JavascriptFunction()");
}
and finally the javascript function in the page
<script language="javascript" type="text/javascript">
function JavascriptFunction() {
alert("You have recive this message when you've clicked Link1");
}
</script>
|
|
|
|
|
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ListView ID = "lstview" runat ="server" DataSourceID="orderdatasource">
<LayoutTemplate>
<table id ="itemplaceholdercontainer">
<tr>
<th>
Order ID
</th>
<th>
Customer ID
</th>
<th>
Order Date
</th>
<th>
Ship Address
</th>
<th>
Ship Country
</th>
</tr>
<tr runat ="server" id ="itemPlaceholder"></tr>
</table>
</LayoutTemplate>
<tr>
<td>
<asp:Label ID = "lblorderid" runat ="server" text = '<%#eval(orderid)%>'></asp:Label>
</td>
<td>
<asp:Label ID = "lblcustomerid" runat ="server" text = '<%#eval(customerid)%>'></asp:Label>
</td>
<td>
<asp:Label ID = "orderdate" runat ="server" text = '<%#eval(orderdate)%>'></asp:Label>
</td>
<td>
<asp:Label ID = "shipaddress" runat ="server" text = '<%#eval(shipaddress)%>'></asp:Label>
</td>
<td>
<asp:Label ID = "shipcountry" runat ="server" text = '<%#eval(shipcountry)%>'></asp:Label>
</td>
</tr>
</asp:ListView>
<asp:ObjectDataSource ID="orderdatasource" runat="server"
SelectMethod="GetOrdersByCustomer" TypeName="BAL.CustomerBAL">
<SelectParameters>
<asp:ControlParameter ControlID="dpcustomers" Name="customer"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</ContentTemplate>
</asp:UpdatePanel>
Tauseef A Khan
MCP Dotnet framework 2.0.
modified on Wednesday, November 18, 2009 6:01 PM
|
|
|
|
|
Very hard to understand the code if it is not formatted perfectly.
Check "Do not interpret HTML tags"
Also let me know what exactly the problem you are getting..
|
|
|
|
|
i have updated code.
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
As I can see the updated code, you cant place html inside a listview.
You need to place <ItemTemplate> to define your html. Just use it below your layout template.
Read this for further help :
Complete ListView in ASP.NET 3.5[^]
|
|
|
|
|
I can see your signature in between code. This is funny.
|
|
|
|
|
Maybe the old Copy/Paste doesn't work here!
mmm i can't understand that... or your problem... specify!!!
|
|
|
|
|
i have updated code.
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
Hi,
I am doing dissertation on web service performance testing.How we can expose distributed database using REST WEB SERVICES and how we can query the distributed database using REST Web services?We have a chance to query the distributed database using soap web service by WSDL Interface.But REST don't have WSDL Interface.
|
|
|
|
|
REST Web Services don't use SOAP either.
REST Web Services in ASP.NET 2.0 (C#)[^] might be a good start point for REST web services from .NET. Exposing anything through a REST web service is up to the writer of the Web Service just like any Web Service.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
I want the "default printer name" on the client's computer to print the document.How can we use/write the activX control in c# to get the name of the client's computer default printer.
thanks
swapnil
|
|
|
|
|
Why ActiveX? It will work only on IE.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Is there any other way to do it to get the output on all browser?...
|
|
|
|
|
Well... You might use IE activeX controls or addons for Mozilla. But In both cases the controls will be dependent on browser.
Check this tutorial on ActiveX control in VC++.NET. You can easily modify them to C# if you wish.
http://msdn.microsoft.com/en-us/library/599w5e7x(VS.80).aspx[^]
Hope this help you.
|
|
|
|
|
Respected,
How we connect SqlServer to Tally using Asp.Net .Please Help Me.
Thanks.
|
|
|
|
|
Maybe you could try this[^] first.
|
|
|
|
|
|
Hello I am raising this once more since the suggestions have not been provided a result for me. I think I could not make myself clear enough.
I need to create an HTML page for emailing from a web-page displayed on my site. The page contains data gridviews that are filled according to clienty choice.
When I try render() option I receive (only one form can be in context) error,
Then I asked to load the data from the page from code behind, Christian Graus told me that it can not be done. Now I am clueless and I am running out of time.
Could somebody tell me a flexible way of creating html page for emailing (I want exactly the same which is displayed on the browser).
Thanks alot.
|
|
|
|