|
use tree properties and methods
tree.ExpandAll(); // to expand full tree
tree.CollapseAll(); // to collapse full tree
tree.Nodes[i].ExpandAll(); // to expand all sub nodes of i node
tree.Nodes[i].CollapseAll(); // to collapse all sub nodes of i node
tree.Nodes[i].Expand(); // to expand i node
tree.Nodes[1].Collapse(); // to collapse i node
|
|
|
|
|
Use Javascript on the client side to expand and collapse, or use something like the Atlas UpdatPanel.
only two letters away from being an asset
|
|
|
|
|
I can use Server.MapPath to find and read from files on my server; however I can only do this from within the code-behind for a web-page and not a separate class which gets compiled into the application dll.
if I have function within this class/dll that wants to read from an xml file located in the same /bin folder, how do I do it? Is it just a matter of the right import statement in the class, or do I need to use another method altogether?
OK, I could use server.mappath before calling the function and pass the full path as a parameter, but apart from that...
thanks
Fred
|
|
|
|
|
use
using System.IO; // for C#
Imports System.IO // for VB.NET
and then try using Server.MapPath
|
|
|
|
|
Thanks - but that doesn't work (which doesn't actually surprise me as "server" is not a member of system.io, as far as I can see...)
In case it's not clear: I want to read a file from within a class module (as opposed to a code-behind module of a webapge)
cheers
F
|
|
|
|
|
its working fine at my side i m using it in a code class file (i.e. a data access class) not code behind file and it is working
|
|
|
|
|
Well, I don't know. Thanks for ytour answer, but in my environment (VS2003) it simply doesn't recognise server.mappath within a class module....
remind me not to visit your akaas.net site again!! I lost count of the unwanted popups offering to install this that and the other... nothing turns me off a site faster than that! Didn't get past the first page but closed them all down as fast as I could....
cheers
Fred
|
|
|
|
|
How to get the India time zone with asp
Kumar.a
email : akumar8_k@yahoo.com
info@livecriket2007.com
|
|
|
|
|
|
asp.net 2.0,ATLAS and XAML must i unit in one application.
how can merge this in one appliaction?
i am making presentation of component parts ASP.NET,ATLAS and XAML.
Have anyone any idea,what a application let i develop ?
i would be grateful,for any exampel or idea?
danks,
M
|
|
|
|
|
i am having the grid which displays some table content,
how to take printout of the whole datagrid content with the same format.
Help me.
abul
|
|
|
|
|
make this function in your .aspx.cs file
public static void PrintWebControl(Control ctrl)
{
PrintWebControl(ctrl, string.Empty);
}
public static void PrintWebControl(Control ctrl, string Script)
{
StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
if (ctrl is WebControl)
{
Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
}
Page pg = new Page();
pg.EnableEventValidation = false;
if (Script != string.Empty)
{
pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
}
HtmlForm frm = new HtmlForm();
pg.Controls.Add(frm);
frm.Attributes.Add("runat", "server");
frm.Controls.Add(ctrl);
pg.DesignerInitialize();
pg.RenderControl(htmlWrite);
string strHTML = stringWrite.ToString();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(strHTML);
HttpContext.Current.Response.Write("<script>window.print();</script>");
HttpContext.Current.Response.End();
}
and then on button_click event write like following
protected void printreport_Click(object sender, EventArgs e)
{
PrintWebControl(gvAnualReport);
}
|
|
|
|
|
may i know the diff b/w view state and hidden fields
|
|
|
|
|
view state is the property of asp.net's pages and controls which can be enabled or disabled but is enable by default. The purpose of enabling view state is to maintain the user's input on controls after the post back which was not available in ASP's post backs. In ASP when page is post back all the inputs on form are lost and we need to enter all the values or input again but its not the case with ASP.NET after the post back all the user input or values remain on the form and are not lost.
Hidden field is a simple input control put is hidden. Suppose if u dont want to show user some values dat you may be using in ur client side scripting then u can store these values in hidden fields and can get using javascript
|
|
|
|
|
Yeah, that's absolutely correct...but just to emphasize the main point here, view state IS one of the three hidden fields available in ASP.Net.
sam
|
|
|
|
|
In my application css file for page is genrating at run time .
Now when i made some changes old file is get deleted and new file is created.
Problem is that css which is getting applied on page is previous one as it get
stored on client machine in Temporary Internet Files.
Name of file has to be same otherwise useless files will get stored on server.
How can i apply newly genrated css file which is stored on server.
Thanks in advance.
|
|
|
|
|
Add a random parameter to the url:
MyStyle.css?t=9838459873645
That will make the url unique each time and load the file from the server every time.
This of course removes any advantage of having a css file in the first place, so you can just as well put the style in the page instead.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks,
But i can't use response.redirect.
|
|
|
|
|
What was it in my post that did make you think that you should use Response.Redirect?
---
b { font-weight: normal; }
|
|
|
|
|
how to write the code for sending image with message
|
|
|
|
|
|
|
|
i have a datagrid that i want create the column of datagrid myself. i write this code but its not right in visual studio 2005 how can i do this work?
BoundColumn dgColStord = new BoundColumn();
dgColStord.HeaderText = dsHeader.Tables[0].Rows[i]["stord_desc"].ToString();
dgColStord.DataField = i.ToString();
dgColStord.Columns.Add(dgColStord);
the last line is not right it give error for columns.
|
|
|
|
|
check that what is the value of i? coz i's value shd be the name of column in the datasource whose value will be set in the bound column
why dont u try using a template column and sets the value in that columns coz bound column always requires a column name in the DataField here in ur code i seems to be an index
|
|
|
|