Working on a web application at the moment. Need some general information on how events are declared in asp.net/javascript, and how these fit in in the code behind (c# in this case).
My own situation to which this applies is the following: I've got an AccountsTreeView, and need to update a second TreeView with information, depending on which Nodes are checked in AccountsTreeView. Since the TreeNodeCheckChanged event doesn't post a callback the (simple) solution is to implement a simple script to provide the postback. I'm just not sure how to go about catching the postback/event in my code behind.
the javascript code i found, which i would embed into my .aspx file : http://forums.asp.net/p/1109288/1888180.aspx
<script language="javascript" type="text/javascript">
function postBackByObject()
{
var o = window.event.srcElement;
if (o.tagName == "INPUT" && o.type == "checkbox")
{
__doPostBack("","");
}
}
</script>
The result I'm hoping for would be like this:
protected void TreeView_onCheckBoxChanged(Object sender, someEvent? e)
{
e.SelectedNode.Text = "able to access the selected node.";
}
Any help would be greatly appreciated! Please excuse me for any wrongdoings in my post, it is my first one after all.