|
Currently, I am using the DataList to display the data. My DataList code looks something like this:
<datalist>
<itemTemplate>
<tr>
<td>Name:</td>
<td><% DataBinder.....%></td>
</tr>
<tr>
<td>Company:</td>
<td><% DataBinder.....%></td>
</tr>
</itemTemplate>
</datalist>
My question is: How can I have an easy way of sorting this data. I would like the users to be able to sort the data by Name or by Company. I understand I can add AllowSorting to DataList or DataGrid, but then I would have to display the column names and display the data in 2 columns, which I dont want to do.
So is there any other way to allow the users to sort this data, without having to write much code? I am using ASP.NET 2.
Thanks
|
|
|
|
|
I have a page "A" in which ther is a table in which i include another page "B" in . I want to use a function of "B" in "A" . Please help me.
|
|
|
|
|
Make the functions of B page public and create the object of B in A's code file and use those functions
|
|
|
|
|
Or a more object oriented and reusable way would be to include the common method in a seperate class, in you App_Code folder if using 2.0, that could be used by both pages.
only two letters away from being an asset
|
|
|
|
|
Hi friends
I have tree view.
i want to expand and collapse it without page reload
Thanks in advence
Pathan
|
|
|
|
|
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
|
|
|
|