|
Thanks for your help, The function can run already !!
Best regards,
Chee ken
|
|
|
|
|
Hi
i am trying to add data in tree view control from database, I have folders and documents & sub folders in those folders. so i want to show hierarchy of folders in treeview.
my code is as under Here I have table called folder and in this table unique key is ID and parent key is ParentFolderID which reference to Id of the same table so if there are sub folders then ParentFolderId will be parent Folder's ID. So if there is table which is root level then its ParentFolderID will be reference to itself.
Try
RootFolderStr = "Select Name from Folder where ID=ParentFolderID"
dr = temp.ExecuteDataReader(RootFolderStr)
While dr.Read
Root = dr("Name")
tNode.Text = Root
Tree1.Nodes.Add(tNode)
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
dr.Close()
End Try
when i am adding one item it works fine but if there are more items then it returns error
"Index must be within the bounds of the List.Parameter name: index"
So please help if any one knows the answer.
Thanks in advance
|
|
|
|
|
Include Microsoft.Web.UI.WebControls.dll in your project.
For runtime addition of nodes for TreeView control do following steps
//On aspx page register TreeView as
<%@ Page language="c#" Codebehind="TreeControl.aspx.cs" AutoEventWireup="false" Inherits="UserControlApplication.TreeControl" %>
//Treeview Control
//Add the root node for User Control Tree1 in .cs file
TreeNode tNode = new TreeNode();
tNode.Text="Root";
tree1.Nodes.Add(tNode);
//Add Child Node to root node tNode
TreeNode tChileNode1 = new TreeNode();
tChileNode1.Text = str;//This string is the information retrieved form database
tNode.Nodes.Add(tChileNode1);
#Abhi#
|
|
|
|
|
hi abhi
i have try this but it will work when i have only one row.
if there are more rows that i m fetching then error is coming that i have asked in my previous question
so if there is another way to solve it please let me know
Thanks
|
|
|
|
|
Hi
Try this -
Define your chile node inside while loop and fill it and after it add to root node.
:->:->:->
#Abhi#
|
|
|
|
|
Learn how to develop your next ASP.NET2.0 application using Provider Model.
If you are interested, you can download a copy (PDF) from below URL:
http://www.agdstudio.com[^]
|
|
|
|
|
I need to add a "ENTER" whitespace into string, so when i display the string into control, the string will be continue display on next row.
How to add this "ENTER" ?
for example;
dim str as string = "A ENTER B"
so the output will be :
A
B
Best regards,
Chee ken
|
|
|
|
|
Use Environmend.NewLine:
Dim str As String = "A" + Environment.NewLine + "B"
Then of course it depends on if the control handles line breaks in the text or not.
---
b { font-weight: normal; }
|
|
|
|
|
Dim str As String = "A" + <-br-> + "B"
plz remove "-" side of the "-br-"
hi
hope can work.
-- modified at 8:10 Monday 30th October, 2006
|
|
|
|
|
|
The function can run already , thanks for your help !!
Best regards,
Chee ken
|
|
|
|
|
Hi,
I know I can specify an SMTP server in the web.config file in ASP.NET 2.0 like this
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mail.domain.com" port="25" userName="username" password="password" />
</smtp>
</mailSettings>
</system.net>
My question is it possible to set multiple SMTP servers and programmatically select which one I want to use? I may want to send mail from different addresses for instance and my mail server requires my username to be username@domain.com, so if I wanted to send mail from different addresses I would need to set the web.config file like so...
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mail.domain.com" port="25" userName="email1@domain.com" password="password1" />
</smtp>
<smtp deliveryMethod="Network">
<network host="mail.domain.com" port="25" userName="email2@domain.com" password="password2" />
</smtp>
</mailSettings>
</system.net>
Thing is it won't let me do this because the <smtp> element can't be repeated. Any ideas? Cheers!
Sunday Ironfoot
|
|
|
|
|
hai every one
im using sesson event.in gridview i have a checkbox.if i check that the bounded data stored in the sesson.so how can i store for multiple data in sesson.plz any one help me
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
hi guys
i have question about how to update, save and retrieve the appsettings and connectionsettings on the web.config file in asp.net 2.0 C#?
thanks
|
|
|
|
|
Check function configuration.appsettings(<userkey>)
Regards,
Akhilesh Yadav
|
|
|
|
|
How can i Call Postback ()
For example i have a button in my page i want when button click Page_load Functoin call ( AFTER Click event Of Button is raised and doned )
With Thanks
MHF
|
|
|
|
|
That is not possible. Page_Load is always executed before control events. If it weren't, controls created in Page_Load could not have events.
You can use Page_PreRender for anything that you want to do after control events.
---
b { font-weight: normal; }
|
|
|
|
|
hi
I am developing one network monitoring tool Which contain table..
I want to insert grid veiw in one row i.e in <asp:tablecell>.
but problem is once i put that gridview control in <asp:tablecell>
it disappear that whole column.
(I am developing the tool just like computer managment application.
You can see this on your own computer.
1. write click it on My computer.
2. Manage
)
so how can i use this control???
eg:
<asp:TableCell Width="70%" BorderWidth="3" Height="100%">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</asp:TableCell>
I am waiting for ur reply..
|
|
|
|
|
how can i able to annotate text document in a web page using c#.
Are there any Free downloads of web based annotation tools.
Plz suggest any tool...
|
|
|
|
|
It might help if you specified what kind of text document you are working with. Is it for example Microsoft Word documents?
---
b { font-weight: normal; }
|
|
|
|
|
What ever may be the document(pdf,MSword,acrobat)i get by searching for technical documents based on search keyword i enter.
|
|
|
|
|
I drag a DataList on the Web Designer,
and set a Dataset as it's DataSource.
the dataset is filled by Adapter using products table of Northwind.
oh,I paste the code here,help me found what is wrong.thank u.
aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<title>无标题页
<asp:datalist id="DataList1" runat="server">
<itemtemplate>
<asp:button id="Button1" runat="server" commandargument="<%# Eval("ProductName") %>"
="" oncommand="Button1_Command" text="<%# Eval("ProductName") %>">
---------------
aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=Northwind;User Id=sa;Password=;");
SqlCommand comm = new SqlCommand("select * from Products", conn);
SqlDataAdapter da = new SqlDataAdapter(comm);
DataSet ds = new DataSet();
da.Fill(ds);
DataList1.DataSource = ds;
DataList1.DataBind();
}
protected void Button1_Command(object sender, CommandEventArgs e)
{
Response.Write(e.CommandArgument.ToString());
}
}
|
|
|
|
|
the error is:
postback or postback arguments is invalid.use <pages enableeventvalidation="true"> in the settings or in the page to enabel event Validation....
I come from china,so the error message is Simple Chinese.I translate it.
|
|
|
|
|
I read a lot of articals on net via google.
but none of them is about event handling of controls was created at runtime For example in for next loop.
'Creation Part
Protected Sub btnCreateRuntimeButtons_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCreateRuntimeButtons.Click
For i As Integer = 0 To CInt(txtNumberOfButtons.Text)
Dim btn As New Button
btn.Text = i.ToString()
AddHandler btn.Click, AddressOf Me.btnClicked
Panel1.Controls.Add(btn)
Next
End Sub
'Event Part
Protected Sub btnClicked(ByVal sender As Object, ByVal e As EventArgs)
Dim btn As button = CType(sender, button)
Response.Write(btn.Text & "th button is clicked")
End Sub
please help and run this code :'(
-- modified at 3:31 Sunday 29th October, 2006
|
|
|
|
|
I have two frames in a frameset.once right frame is reloaded,left frame should get reloaded.how to do this using javascript
|
|
|
|