|
Hi,
You have to write code like this,
Protected Sub TvwPages_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TvwPages.SelectedNodeChanged
If TvwPages.SelectedNode.Text = "Screens" Then
If TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(1).Collapse() 'Collapse Reports
End If
TvwPages.Nodes(0).Expand() 'Expand Screens
ElseIf TvwPages.SelectedNode.Text = "Reports" Then
If TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(0).Collapse() 'Collapse Screens
End If
TvwPages.Nodes(1).Expand() 'Expand Reports
End If
End Sub
If you have more than one Tree View item,
Use this line ,( PUT in a For Loop) till List Count
TvwPages.Nodes(i).Collapse()
Ramesh Sambari
|
|
|
|
|
Hi
this is good for selecting child nodes. because "SelectedNodeChanged" event hires when child node is selected. But I want when Parent node is selected it should be expanded and if any expanded nodes are there they should be collapsed.
Plz help me
Its urgent
|
|
|
|
|
Hi,
Try Using this....
Protected Sub TvwPages_TreeNodeExpanded(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TvwPages.TreeNodeExpanded
If e.Node.Text = "Screens" And TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(1).Collapse()
End If
If e.Node.Text = "Reports" And TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(0).Collapse()
End If
End Sub
and..one thing...never say URGENT. It is completely irrelevent to others.
Ramesh Sambari
|
|
|
|
|
when user logged in i set its LoginBit and didnt allow same user to log in again but if user closes without signing out and he returns then how can i found that it is the same user who was actually using the session. he must not receive error that user is already signed in
|
|
|
|
|
Try any one,
1 - Handle session_end and rest the DB flag. session_end fires even user closes the browser(not immediately).
1 - Handle the window closing event using JS, do AJAX call to reset the DB flag.
2 - Run a DB job which will check the records frequently and resets the flag.
|
|
|
|
|
HI.
hi i devloping a web site , and i have two colums in data one is indate and other is outdate . the both column in varchar type and i have typecasting in date format . but when my update column is --- means not update in database . i got error . so for that i want to decode function . pls help me how i to decode in sql query.
|
|
|
|
|
sanju05 wrote: the both column in varchar type
Poor way of keeping dates. Why don't you make the column type as Date?
sanju05 wrote: but when my update column is --- means not update in database . i got error
What do you mean? What error are you getting?
|
|
|
|
|
HOW TO DECODE SQL QUERY IN ASP.NET .
|
|
|
|
|
sanju05 wrote: HOW TO DECODE SQL QUERY IN ASP.NET .
Read this[^]. Specially, point 6.
|
|
|
|
|
I have multiple reports . I want to change report and datasource
of reportviewer at runtime to show another report. I try this
but showing error. If anybody knows please help.
sachin
|
|
|
|
|
check the below link
really a good article for your problem..
http://www.aspfree.com/c/a/ASP.NET/Binding-Data-to-the-ReportViewer-Control-Dynamically-in-ASPNET-20
One person's data is another person's program.
--J.Walia
|
|
|
|
|
i need what is the difference between div and Form
and what is the good usage example
thanks in advance
|
|
|
|
|
Whats your exact question ? where do you want to use form or div ?
|
|
|
|
|
If I create the web page inside a folder on the root, ... Create image folder in root file only... Now i run directly on subfolder page... i am not get the image from image folder....
Can you help to me
|
|
|
|
|
Good Morning nithydurai
Can we see the image reference code ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i create the reseller account...
i wil give one aspx page to reseller.....
image folder have in root directory
how to access the image folder on reseller .aspx page...
Image1.ImageUrl = Page.ResolveUrl("~/image/02.gif");
how to share a web.config file in different path..
|
|
|
|
|
You are really Confusing me, now you talk about account. I thought your only Problem is that you have an image folder that contains images and you have a sub folder that has a page and it does not show an image on the page, and i requested a part where you reference the image.
Please Please Explain Clearly exactly what is your problem , because i don't have a problem on my side.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All
I have a web site. This web site connected multiple databases. After user(1st user) successfully logged in then we received database name, user id, and password and create a connection string and store the value in class file as a static property. Its work all over the website and class file. But my problem is that when another user (2nd User) login then class property is changed with (2nd User) connection string. An user(1st user) data changed with 2nd User data.
That means 1st user going connect with 2nd User database.
There I any way to recover from this problem, I don’t use different way. Because my project almost completed. Please help me out
Thanks
Rajesh
|
|
|
|
|
|
In class file session is not working properly.....
|
|
|
|
|
|
As I'm sure you are well aware, static properties values are shared (hence I believe the VB keyword for it) among all the application's instances. Which means your application is seriously flawed if you expose user data to other users.
The answer: don't use static properties the way you do.
Use normal properties.
And don't mean to be rude, but it seems your project is far away from completion, if you want it to work correctly.
var question = (_2b || !(_2b));
|
|
|
|
|
I agree with Greg. You are using static keyword without knowing how it works. Static variables will stay in memory until the application domain unloads and it is shared between all threads under that application domain. To solve this, Use session variables. These are unique for each visitor.
|
|
|
|
|
But how can I used session variable in class file, its through "Objects reference not set to be instant of an objects". Please check my class file.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.SessionState;
namespace MyStore
{
public class GetConnection
{
static string _conString = null;
public GetConnection()
{
//
// TODO: Add constructor logic here
//
}
public static String DBConnectionString
{
get
{
if (HttpContext.Current.Session["ConnStr"] != null)
{
return HttpContext.Current.Session["ConnStr"].ToString();
}
else
{
return "";
}
}
set
{
HttpContext.Current.Session["ConnStr"] = value;
}
}
}
}
|
|
|
|
|
The way you do it is overkill, and it's flawed.
You should pass the connection string to the constructor, get rid of the static keyword for the DBConnectionString property, add a private field _dbConnection and assign the value of it to the parameter you get in the constructor.
public class GetConnection
{
public GetConnection(string connectionStr)
{
_dbConnection = connectionStr;
}
private string _dbConnection;
public string DBConnectionString
{
get{return _dbConnection;}
}
}
}
It's still overkill.
Having a class with one string property that you set to something you already know.
As you have the connection string (hopefully stored in web.config), just fetch it from web.config everytime you want to connect into the database. In other words, don't keep the whole connection string in a session variable, but rather a key to fetch it by.
var question = (_2b || !(_2b));
|
|
|
|