How to read data from an XML file and display it in a DataGrid
VB.NET dim ds as new DataSet() ds.ReadXml (Server.MapPath (‘products.xml’)) DataGrid1.DataSource =ds DataGrid1.DataBind() C# DataSet ds= new DataSet (); ds.ReadXml (Server.MapPath (‘products.xml’)); DataGrid1.DataSource =ds; DataGrid1.DataBind();
When I use the Session in component class as Session(‘CustID’), I get error message ‘Session is not declared’. Why?
Use HttpContext.Current.Session i.e VB.NET HttpContext.Current.Session(‘CustID’) = ‘1’ C# HttpContext.Current.Session[‘CustID’] = ‘1’;
How can I use Session variables in a class
Use HttpContext.Current.Session VB.NET HttpContext.Current.Session(‘Value1’) = ‘1’ C# HttpContext.Current.Session[‘Value1’] = ‘1’; In similar manner you can use Application Variables too.
Is there a TextArea in ASP.NET
You can use the TextBox webserver control and set the TextMode = MultiLine
How can I show what page the user is on using in-built paging functionality. CurrentPageIndex Property Shows Up as 0
In PageIndexChanged event write VB.NET Dim pageindex As Integer = DataGrid1.CurrentPageIndex + 1 LblPageInfo.Text = ‘Page ‘ + pageindex.ToString() + ‘ of ‘ + DataGrid1.PageCount.ToString() C# int pageindex = DataGrid1.CurrentPageIndex + 1 ; LblPageInfo.Text = ‘Page ‘ + pageindex.ToString() + ‘ of ‘ + DataGrid1.PageCount.ToString() ;