|
i have a panel control that i set as dragable with dragdropextender of ajax control. but the problem that i face is on page load this dragable panel gets repositioned to top left corner of page. how to avoid this problem?
|
|
|
|
|
Hello, Ive got a problem with all new sub nodes in a treeview getting multiplied with every postback
--------------------------- (GOOD) before any node check change ---------------
node1
node2
node3
--------------------------- (GOOD) after checking node 1 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
node2
node3
--------------------------- (BAD) after checking node 2 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
node2
subnode1:113431
subnode2:113431
subnode3:113431
node3
---------------------------(BAD) after checking node 3 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
node2
subnode1:113431
subnode2:113431
subnode3:113431
subnode1:113431
subnode2:113431
subnode3:113431
node3
subnode1:113434
subnode2:113434
------------------- ASP code -----------------------
<body>
<form id="form1" runat="server">
<div>
<asp:PlaceHolder ID="PHForTree" runat=server ></asp:PlaceHolder>
</div>
</form>
</body>
---------------- Code behind --------------
protected void Page_Load(object sender, EventArgs e)
{
TreeView obTreeView = null;
if (IsPostBack == false)
{
obTreeView = new TreeView();
obTreeView.Nodes.Add(new TreeNode("node1"));
obTreeView.Nodes.Add(new TreeNode("node2"));
obTreeView.Nodes.Add(new TreeNode("node3"));
Session["m_obTreeView"] = obTreeView;
}
else
obTreeView = (TreeView)Session["m_obTreeView"];
obTreeView.SelectedNodeChanged += new EventHandler(this.Node_Change);
PHForTree.Controls.Add(obTreeView);
}
void Node_Change(object sender, EventArgs e)
{
TreeView obTreeView = (TreeView)Session["m_obTreeView"];
string strDateTimeStamp = DateTime.Now.ToString("hhmmss");
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode1:" + strDateTimeStamp));
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode2:" + strDateTimeStamp));
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode3:" + strDateTimeStamp));
Session["m_obTreeView"] = obTreeView;
}
I hope someone can help,....
With Regards, Siggi
|
|
|
|
|
Like first clear childnodes before you add them,and you will not get duplicate childnodes.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
No, thats not it.
TreeView obTreeView = (TreeView)Session["m_obTreeView"];
//1//obTreeView.SelectedNode.ChildNodes.Clear();
//2//obTreeView.Nodes.Clear();
string strDateTimeStamp = DateTime.Now.ToString("hhmmss");
line //1// makes no difference
line //2// casts nullreferenceexception
|
|
|
|
|
Before firing SelectedNodeChanged event call loop down below.
<br />
if (obTreeView.Nodes.Count > 0)<br />
{<br />
for (int i = 0; i <= obTreeView.Nodes.Count - 1; i++)<br />
{<br />
obTreeView.Nodes[i].ChildNodes.Clear();<br />
}<br />
<br />
}<br />
obTreeView.SelectedNodeChanged += new EventHandler(this.Node_Change);<br />
<br />
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
thanks for the help Blue Boy, it worked.
If I had better understanding of the asp.net dynamics Id probably know why it worked
why clear the treeview, and load it again, instead of just keeping the already populated tree?
wouldnt it save time?
and why clear the treeview in page_load and not the node_change function?
thanks again, regards, Siggi
|
|
|
|
|
Your TreeView populated on each time when page is loaded so because of it you have to clear childitems before add them.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
hi,
let suppose
function f1()
{ var btn = document.getElementById('btn');
btn.onclick ="" ???????????? :sigh:
}
how ?
|
|
|
|
|
function ButtonClickHandler()
{
alert('Button was clicked');
}
function f1()
{
var btn = document.getElementById('btn');
btn.onclick = ButtonClickHandler;
}
|
|
|
|
|
wao.. so easy
|
|
|
|
|
document.getElementById('button1').onclick=alert('place your code');
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
hi all,
I am currently using asp.net 2.0 with vb.net and want to use dynamic chart controls in my application.The sample chart controls should be similar to the controls in this link (http://www.macroaxis.com).
Please give me some ideas how can I start to make a sample application with the chart dynamic controls present in that site.
I think flash has used in the site but how can i do the same with asp.net 2.0.
Thanks and regards
bikash pattanayak
|
|
|
|
|
You might consider purchasing a professional chart control package.
One to consider would be Dundas Chart[^].
|
|
|
|
|
Hi Bikash,
There are many chart control are available for .net. If you are using .NET 3.5 SP1 , Microsoft having their own Chart Control.
If you are looking for 3rd Party, you can go with Dundas and Fusion Chart
|
|
|
|
|
Hi,
I have created the Login form in asp.net web application, after login it redirects to the dash board,
Suppose if i copy that URL & paste it on the another browser, the same page is displaying , I need to check the credentials there.. The Page Should not Login in that browser or in the new tab of the same browser.. How can i Do This... If Possible Post the Code using C#..
|
|
|
|
|
In Page_Load check if user is logged in,in case is not then redirect to login page.
Search on google and you will find more usefull manners how to manage user's login.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Use a Session object in your login page and use an if statement in your redirected page Page-load method to check the session object.
|
|
|
|
|
Already I have used Session in my application... The Issue Does Not Resolve...
|
|
|
|
|
hi all ,
i have a html table wher r several rows and each row has id ,how can i scroll and highlight the specific row upon the id? and i one thing more
how can i use on html button click as in <a href="Test.aspx#a8">Click </a>
thanks
|
|
|
|
|
You want to scroll the table? Then you can use DIV for that. But i am not clear about the highlight part
|
|
|
|
|
highlight mean change the row color.
|
|
|
|
|
zeeShan anSari wrote: highlight mean change the row color.
I understand that. I just want to know how you are relating this with Scrolling ? You are talking about selection of Rows?
|
|
|
|
|
Use javascript function to specify which row have to be highlightet in onmouseover event of row.
Check this link for getting clue.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
<input type=button onclick ="location.href='Test.aspx#a8'" />
this is my solution
thanks
|
|
|
|
|
Good but your original post (I guess you modified it) wasn't related to problem about opening specific page on click of button,your question was how to get highlight specific row of table.
Anyway,it's good news that you have solution.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|