Click here to Skip to main content
15,897,226 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to call a javascript function in code behind using href..? Pin
NanaAM26-Nov-07 1:35
NanaAM26-Nov-07 1:35 
AnswerRe: How to remove “+” sign in tree view control at child node Pin
Venkatesh Mookkan26-Nov-07 1:00
Venkatesh Mookkan26-Nov-07 1:00 
GeneralRe: How to remove “+” sign in tree view control at child node Pin
Rajesh_K_Sharma26-Nov-07 14:02
Rajesh_K_Sharma26-Nov-07 14:02 
Questionconnecting sqlexpress 2005 and visual studio 2005 Pin
justintimberlake26-Nov-07 0:14
justintimberlake26-Nov-07 0:14 
AnswerRe: connecting sqlexpress 2005 and visual studio 2005 Pin
Braulio Dez26-Nov-07 3:45
Braulio Dez26-Nov-07 3:45 
QuestionHow much an navigation URL may be weighted. Pin
KANGAROO_26-Nov-07 0:07
KANGAROO_26-Nov-07 0:07 
AnswerRe: How much an navigation URL may be weighted. Pin
_AK_26-Nov-07 0:14
_AK_26-Nov-07 0:14 
GeneralRe: How much an navigation URL may be weighted. Pin
KANGAROO_26-Nov-07 0:29
KANGAROO_26-Nov-07 0:29 
GeneralRe: How much an navigation URL may be weighted. Pin
_AK_26-Nov-07 0:36
_AK_26-Nov-07 0:36 
GeneralRe: How much an navigation URL may be weighted. Pin
KANGAROO_26-Nov-07 1:07
KANGAROO_26-Nov-07 1:07 
GeneralRe: How much an navigation URL may be weighted. Pin
_AK_26-Nov-07 1:22
_AK_26-Nov-07 1:22 
AnswerRe: How much an navigation URL may be weighted. Pin
pmarfleet26-Nov-07 0:16
pmarfleet26-Nov-07 0:16 
QuestionSession problem in server..., Pin
Member 387988126-Nov-07 0:06
Member 387988126-Nov-07 0:06 
AnswerRe: Session problem in server..., Pin
Sam Xavier26-Nov-07 4:08
Sam Xavier26-Nov-07 4:08 
QuestionReturnURL encoding in Forms Authentication. Pin
Ashwani_kumar26-Nov-07 0:05
Ashwani_kumar26-Nov-07 0:05 
AnswerRe: ReturnURL encoding in Forms Authentication. Pin
Venkatesh Mookkan26-Nov-07 0:36
Venkatesh Mookkan26-Nov-07 0:36 
QuestionTreeView 's node Click Event Pin
Rocky#25-Nov-07 23:29
Rocky#25-Nov-07 23:29 
AnswerRe: TreeView 's node Click Event Pin
jagadeeshkumar198425-Nov-07 23:33
jagadeeshkumar198425-Nov-07 23:33 
GeneralRe: TreeView 's node Click Event Pin
Rocky#25-Nov-07 23:37
Rocky#25-Nov-07 23:37 
GeneralRe: TreeView 's node Click Event Pin
jagadeeshkumar198425-Nov-07 23:39
jagadeeshkumar198425-Nov-07 23:39 
GeneralRe: TreeView 's node Click Event Pin
Rocky#25-Nov-07 23:41
Rocky#25-Nov-07 23:41 
GeneralRe: TreeView 's node Click Event Pin
Rocky#26-Nov-07 0:00
Rocky#26-Nov-07 0:00 
Unable to cast object of type 'System.Web.UI.WebControls.TreeView' to type 'System.Web.UI.WebControls.TreeNode'

Thats the error I'm getting, here's my code

protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
TreeNode node = (TreeNode)sender;

int id = Convert.ToInt32(node.Value);
Categories objCat = new Categories();
objCat.Where.ID.Value = id;
if (objCat.Query.Load())
{
TextBox tb = FormView1.FindControl("CatNameTextBox") as TextBox;
tb.Text = objCat.CatName;
tb = FormView1.FindControl("DescriptionTextBox") as TextBox;
tb.Text = objCat.Description;
CheckBox ck = FormView1.FindControl("IsActiveChkBox") as CheckBox;
ck.Checked = objCat.IsActive;

}


}

what I wanna do is to take the TreeNode Object coz its text and value are the CategoryName and ID respectively. But its unable to cast it to treeNode. Now what??!!

Rocky

You can't climb up a ladder with your hands in your pockets.

GeneralRe: TreeView 's node Click Event Pin
Sherin Iranimose26-Nov-07 0:08
Sherin Iranimose26-Nov-07 0:08 
GeneralRe: TreeView 's node Click Event Pin
Rocky#26-Nov-07 0:23
Rocky#26-Nov-07 0:23 
GeneralRe: TreeView 's node Click Event Pin
Venkatesh Mookkan26-Nov-07 0:41
Venkatesh Mookkan26-Nov-07 0:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.