|
Hello Friend,
I am using a treeview and populating it from web.sitemap.
On the basis of text vlaue I want to hide some nodes for the users.
I am not finding how to hide the nodes.
can any one help me please.
thanks
Naveed Kamboh
|
|
|
|
|
Hi,
I'm not sure if this is what you are looking for but here goes.
Tree Looks like this
Tree Node 1
Tree Node 1 a
Tree Node 1 b
Tree Node 1b i
Tree Node 1b ii
Tree Node 1 c
Lets say you want to hide Tree Node 1b ii
TreeView.DataSource = SiteMapDataSource1;
TreeView.DataBind();
TreeView.Nodes[0].ChildNodes[1].ChildNodes.RemoveAt(1); //This hides tree node 1b ii
Hope this helps.
Remember in order to do this you have to programatically bind the TreeView. Note remove the DataSourceID from the IDE first.
Good luck
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
thank you very much dear, it worked.
I am happy.
Naveed Kamboh
|
|
|
|
|
i want a popup menu on right click on the datagrid at client side using javascript. please help me.
sam.
|
|
|
|
|
Create a div element and place the datagrid inside it. Then insert the below mentioned javascript(Popup menu script-Dynamicdrive.com) in the head of the page. Call this javascript from div element "oncontextmenu"
<Head>
<script language="javascript">
//DynamicDrive.com
var defaultMenuWidth="150px" //set default menu width.
var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
linkset[0]='<a href="http://dynamicdrive.com">Dynamic Drive</a>'
linkset[0]+='<hr>' //Optional Separator
linkset[0]+='<a href="http://www.javascriptkit.com">JavaScript Kit</a>'
linkset[0]+='<a href="http://www.codingforums.com">Coding Forums</a>'
linkset[0]+='<a href="http://www.cssdrive.com">CSS Drive</a>'
linkset[0]+='<a href="http://freewarejava.com">Freewarejava</a>'
linkset[1]='<a href="http://msnbc.com">MSNBC</a>'
linkset[1]+='<a href="http://cnn.com">CNN</a>'
linkset[1]+='<a href="http://news.bbc.co.uk">BBC News</a>'
linkset[1]+='<a href="http://www.washingtonpost.com">Washington Post</a>'
////No need to edit beyond here
var ie5=document.all && !window.opera
var ns6=document.getElementById
if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}
function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}
function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}
function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}
if (ie5||ns6)
document.onclick=hidemenu
</script>
<body>
<div oncontextmenu="showmenu(event,linkset[0]);return false;"><asp:datagrid id="DataGrid1"></asp:datagrid></div>
</body>
</Head>
Raghu
|
|
|
|
|
HI ,,,I ahve some div tags wiht content editable=false in a page...when i delete a div by keeping a cursor in front of div tag i want to know which div tag si going to be deleted...i can use any events inside div tag b'cos all div tags are going to be in a IFrame....
|
|
|
|
|
Please don't cross post.
---
What do you mean? Where is it that you delete the div tag? In the browser? In page source? In the design view?
-- modified at 7:41 Friday 18th August, 2006
---
b { font-weight: normal; }
|
|
|
|
|
Hello! I trying programming in WEB (ASP.NET) and have small (but BIG for me problem.
In my ASp NET page I have button which send to server some ID. The server forms locally file and then must post to client file. How client can download file from server?
Thanks!
(Forgive me for my bad eglish
qqq
|
|
|
|
|
|
Very thanks!
Bast regards, vanolviv
qqq
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
I need help to convert a excel spreadsheet to a mdb file(access database). Any idea on where I can find help on this, and read more on it.
It have to use the VB.net with my code. I know how to reads two 'sheets', and then insert that info into a database.
I know how to get the information from excel using a SELECT query and System.Data.OleDb.OleDbConnection, and OleDbDataReader. Problem is taking this information and inserting it into the access database.
Any help or suggestions?
|
|
|
|
|
When I click save button i am calling a function to RegisterClientScriptBlock
Page.RegisterClientScriptBlock("keyClientBlock",jScript);
How should i disable this...I cant remove this function bcoz i have one page inside another page...
Regards,
Sivaprasad
|
|
|
|
|
If you are re-posting a form by reloading the page, the browser sends up this warning. This is a security precausion, so that the user won't re-post data without being aware of it.
The warning might be able to disable manually in the browser, but not by using script.
---
b { font-weight: normal; }
|
|
|
|
|
hi,
i am having an appliction with one MultiLine text box and one lable.
if i selected on sentence in multi line text box it should diply on lable. using java script .
kamalnath
|
|
|
|
|
im trying to return a string value from a windowDialog.
not having much luck, ive got this closeDialog() funtion that i set the return value (retVal) from the value of a Label. the label have a Text value init ("55188") but my dialog continually return null
anm i doing somthing stupidly wrong, any help would be apreciated.
CODE:
<code><TD style="WIDTH: 127px; HEIGHT: 27px"><asp:label id="lbCustID" runat="server"></asp:label></TD>
function closeDialog()
{
var retVal = document.getElementById('lbCustID').getAttribute("Text");
window.returnValue = retVal;
//document.write(retVal); - for debug
window.close();
}
</code>
Thanks.
-- modified at 7:02 Friday 18th August, 2006
|
|
|
|
|
ended up using
document.getElementById("lbCustID").innerHTML;
works perfectly!
|
|
|
|
|
Hi there,
I'm using .net 1.1 and I have the following settings in my web.config:
<authentication mode="Forms">
<forms name="TRVAUTH" loginUrl="/logon.aspx" protection="All" timeout="20" slidingExpiration="true" path="/"></forms>
</authentication>
<authorization>
<allow users="?" />
</authorization>
And then, later on...
<location path="profile.aspx">
<system.web>
<authorization><deny users="?" /></authorization>
</system.web>
</location>
This config worked fine. Whenever an unauthorized user requested the profile.aspx, he was redirected to the logon.aspx, authorized and sent back to the profile.aspx (if authorization was successful). That was yesterday. I've done some bugfixing last night and it was a long night. Today I startup my web-project and do what I did a million times for the last 10 days: I request (unauthorized) the profile.aspx. But WTF, my browser shows me a login dialog instead of showing me the logon.aspx like he did yesterday!!!
What could I have possibly messed up?
Thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Matthias,
There are a couple of questions to narrow down the scope:
+ Do you have this problem with different browsers?
+ Do you by any chance to disable the anonymous access in the IIS snap-in?
+ Do you have this problem with other web pages?
|
|
|
|
|
hi there,
I already figured what the problem was: I've build in a bug where I'd append (manually) a ReturnUrl to specific pages. One shouldn't do that .
Anyway, thanks for your reply and a good day from rainy berlin.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
I would like to know whether the caching will have an impact in the case of Network Load Balancing. If there are more than one application server, how to do the caching? I have a doubt that if data is cached in one server and the next request goes to some other server, the cached data may not be there. I would like to know the answer for this with/without IP Affinity masking.
|
|
|
|
|
|
Hi I want to do paging in the datalist.
For that i wrote the code:
public int intStart=0;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
ViewState ["Start"]= 0;
list();
}
}
public void list()
{
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter("select name from sampledatagrid",conn);
DataSet ds1 = new DataSet();
intStart = (int) ViewState["Start"];
ViewState ["PageSize"]=7;
sda.Fill(ds1,intStart,(int)ViewState["PageSize"],"sampledatagrid");
dlistSample.DataSource=ds1.Tables[0].DefaultView;
dlistSample.DataBind();
conn.Close();
}
private void lnkPrevious_Click(object sender, System.EventArgs e)
{
intStart = (int) ViewState["Start"] -(int) ViewState["pageSize"];
ViewState["Start"] = intStart;
if (intStart <= 0 )
{
ViewState["Start"] = 0;
}
list();
}
private void lnkNext_Click(object sender, System.EventArgs e)
{
int dlistcount = dlistSample.Items.Count;
intStart = (int)ViewState["Start"] + (int)ViewState["pageSize"];
ViewState["Start"] = intStart;
if ( dlistcount < (int)ViewState["pageSize"] )
{
ViewState["Start"] = (int)ViewState["Start"] - (int)ViewState["pageSize"];
}
list();
}
}
Here the values are displayed correctly in the Datalist., But If i cliks the Next or previus linkbutton(<< or >>) at the time it shows the error:
Object reference not set to an instance of an object.
Error occured in this line:
intStart = (int)ViewState["Start"] + (int)ViewState["pageSize"];
How can we solve this one?
Prabu.T
|
|
|
|
|
on the pageindexchanged event of the datagrid write this code.
DataGrid.CurrentPageIndex = e.NewPageIndex;
after this line call the datagrid to load the contents again
this will work fine.
Vipin
|
|
|
|
|
How do i display the contents dynamically on the right pane of the IE by clicking on a link in tree view? tell me how do i create frames?
|
|
|
|