Your Ad Here
Welcome To Mega Star Party,Megafans,Chiru&Pawanfans, Ram Charanfans Site
Featured Blogs: Related To Naidu Community

Monday, December 15, 2008

Adding Node In TreeView Dynamically:-

Frist Tree View Like this:-
+fname
mahen
manish
+lname
singh
rajpurohit
Node Name : Input Selected Node name :- singh(TextBox1)
New Node Name : Input New Node name :- barwa(TextBox2)
Click on Button1 and the result is like this
After Click Structure is like this
+fname
mahen
manish
+lname
+singhbarwa
rajpurohit
Code:--
protected void Button1_Click(object sender, EventArgs e)
{
AddChild();
final_rtn = false;
}
public bool AddChild(string cknode, string value)
{
for (int i = 0; i < TreeView1.Nodes.Count; i++)
{
if (Retun_index( TreeView1.Nodes[i], cknode, value)){return true;
}
}
return false;
}
public bool Retun_index(TreeNode tr, string cknode, string value)
{
if (tr.ChildNodes.Count > 0)
{
for (int i = 0; i < tr.ChildNodes.Count; i++)
{
TreeNode tn1 = tr.ChildNodes[i];
if ( tn1.Text == cknode)
{
TreeNode NewNode = new TreeNode();
NewNode.Text = value;tn1.ChildNodes.Add(NewNode);
final_rtn = true;goto End;
}
bool a = Retun_index(tn1, cknode, value);
}
}
else
{
return false;
}
End: ;
if (final_rtn)
{
return true;
}
else
{
return false;
}
}

send message using the smtp server

Using C#using System.Web.Mail;public static void SendSecureEmail(string send_emailid){try{MailMessage mail = new MailMessage();mail.To = send_emailid;mail.From = "from email id";mail.Subject = "Test Email";mail.BodyFormat = MailFormat.Text;mail.Body = "Hello Guest Welcome on Qualispace Mail server";mail.Priority = MailPriority.High;SmtpMail.SmtpServer = "mail server name";mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sales@eresourceinfotech.com");mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "sales123");SmtpMail.Send(mail);}catch (Exception ex){throw new Exception("Message : " + ex.Message + "Source: " + ex.Source);}}


Using using VB
Imports System.Web.Mail

Dim mail As New MailMessagemail.[To] = send_emailidmail.From = "sales@eresourceinfotech.com"mail.Subject = "Test Email"mail.BodyFormat = MailFormat.Textmail.Body = "Hello Guest Welcome on Qualispace Mail server"mail.Priority = MailPriority.HighSmtpMail.SmtpServer = "mail.eresourceinfotech.com"mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sales@eresourceinfotech.com")mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "sales123")SmtpMail.Send(mail)

Disable Back Button of Browser Using C# and JavaScript

Put This Code In Your Html Page and Disable
Put This Code In Javascript :-
history.forward(0);
window.history.forward(1);
history.go(+1)

No Investment By just Referring Friends..!

Get Extra Income By just Reading Mails In u r Inbox,100% Free,No Investment...!

http://www.emailcashpro.com
http://www.emailcashpro.com

Code for Logout in aspx.cs file

protected void logout_OnClick(object sender, EventArgs e)
{
Session.Abandon();Response.Redirect("login.aspx");
}protected void Page_Init(object sender, EventArgs e)
{
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
}

Wonder code..!