|
Posting your code is a good start. I've never seen that error. Are you sure you're using the right client side ids to look for the controls ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello everyone ,
I have a treeview with special nodes (i wanted to store extra information in them) inheriting TreeNode
public class TreeNodeWithInfo : TreeNode
{.....
}
When i add chils , i do it like this :
TreeNodeWithInfo tnGroup = new TreeNodeWithInfo("sdkh", 1);
TreeView1.Nodes.Add(tnGroup);
...
But after a button click , when i try to acces the extra information by downcasting ,
protected void Run_Click(object sender, EventArgs e)
{
...
ManageTree((TreeNodeWithInfo) TreeView1.Nodes[0]);
...
}
i get a invalid cast exception . The TreeView1.Nodes[0] still has the right information (the one correspongind to the base class , the TreeNode ) but it seems that it's not an instance of TreeNodeWithInfo anymore ..
if i do this in Run_Click
<pre> Response.Write(TreeView1.Nodes[0] is TreeNodeWithInfo); i get a "False" . but if i do the same thing in Page_Load , i get True ...
Can anyone help me out ?
Thank You !
|
|
|
|
|
Sorry for the bad tags , but i can 't edit it now , i dont know why
|
|
|
|
|
hi, What i understand is TreeView takes TreeNode as a Child.
So if you inherit TreeNode to some other object say TreeNodeWithInfo
and add it TreeView will not take extra Property you set.
Also when you access node from TreeView it will
set the node as TreeNode not TreeNodeWithInfo i.e. TreeView cast node
as TreeNode not you New Inharit Node.
So the bottom Line is I think your logic will not work.
Sorry If i m not right.
Thanks
Viral
|
|
|
|
|
Thank you for you answer !
But i think it actually has to do with inheritance , because in the page_load , after i set the nodes as TreeNodeWithInfo , it recognises it as a TreeNodeWithInfo , but at postback it becomes just a TreeNode .
I'm kinda lost
|
|
|
|
|
May be you are right!!
When You Bind this Tree? In Page Load?
As When You accessing The TreeView You will Get a Object as TreeNode.
I am Bit Confuse too.
|
|
|
|
|
Have you also created TreeNodeCollectionWithInfo and TreeViewWithInfo?
Because TreeView is still using TreeNodeCollection which uses the old TreeNode. And that's probably the reason for the invalid cast exception
|
|
|
|
|
Well , i haven't created a TreeNodeCollection .. But in Page_Load , the inheritance works perfectly . Weird stuff . Anyhow , i've managed to store the information in treenode.Value and i've given up on the TreeNodeWithInfo .
Thank you anyhow , guys !
Best luck !
|
|
|
|
|
In One of my page i need to read the data from Exel Sheet ,
and After reading the content form it I need to delete the content of Exel Sheet
(means i need to delete all rows it contain
I have done till how to read data from exel , Now i need to blank it
so Plz Guide me how to Blank Exel sheet
Well for deleting i used a function
private void call1()
{
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\OrderHeader.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
using (DbConnection connection = factory.CreateConnection())
{
connection.ConnectionString = connectionString;
using (DbCommand command = connection.CreateCommand())
{
command.CommandText = "Delete from [OrderHeader$]";
connection.Open();
command.ExecuteNonQuery();
}
}
}
But it is giving error msg
Deleting data in a linked table is not supported by this ISAM.
Raghvendra
modified on Wednesday, March 4, 2009 9:29 AM
|
|
|
|
|
You can't do that, Excel isn't a relational datasource.
You can delete values in fields (cells).
But you can't delete an entire record at once.
|
|
|
|
|
hi.
i want to use the chrome less player to play the video.
i have one text box and button. in text box any one can put the URL of video file.
when click on the button the video file should be play in chromeless player.
how this can be achieved?
|
|
|
|
|
|
Hi Experts.
Can any one let me know how to install the visual source safe.....
thanks in advance
|
|
|
|
|
Hi,
This is ASP.NET forum and your question has nothing to do with ASP.NET. Please check the microsoft forums for VSS.
|
|
|
|
|
|
Just to add - you run the installer. How can a developer ask such a question ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i think u dont know about the visual source safe
|
|
|
|
|
can any one guide me what is it and in which chapter of asp.net i can get some idea of it?????
umerumerumer
|
|
|
|
|
Web Service Chapter
Yusuf
|
|
|
|
|
hi to all...
i want to create application in asp.net1.1, which can send mail on every morning at 10.00 am.
pls help me... thnx in advance.
i like to play with programming....
modified on Wednesday, March 4, 2009 7:01 AM
|
|
|
|
|
am.net wrote: i want to create application in asp.net1.1, which can send mail on every morning at 10.00 am.
Obviously, you have no idea about how ASP.NET works. You need to write a stand-alone application which sends mail and schedule it using windows scheduler.
|
|
|
|
|
hey, he did not say automatic emailing.
He could write asp.net application, then log-in every morning at 10 and click to send emails.
Yusuf
|
|
|
|
|
Hi, use window service that will automatically send email.
Another option is to use threading for that but i am not sure about this.
Thanks,
Viral
|
|
|
|
|
Hi,
I have a .txt file in a folder. I want only ASP.NET machine account to access the folder and read the file contents. I am using IIS 5. Also ASP.NET machine account is given read permission to the folder.
I get the below error;
System.UnauthorizedAccessException: Access to the path "c:\Inetpub\wwwroot\TestProject\xxxx\xyz.txt" is denied.
Any suggesgtions plss....
|
|
|
|
|
Hi Everyone,
I want To Mixing of Mp3 song With Mp3 instrument Sound. these files will play parallel i want to record these sound. It is the website where we can create new music after mixing two or more mp3 files.
If anyone have some Idea Regarding Mixing of mp3 files in Asp.net ,c#.net,then please help me.
Thanks
Umesh Rajpoot
umesh.rajpoot@ouritvision.com
modified on Wednesday, March 4, 2009 6:55 AM
|
|
|
|