Information is Wealth...: ASP.Net
Showing posts with label ASP.Net. Show all posts
Showing posts with label ASP.Net. Show all posts

How to find build date of an asp.net assembly


How to find build date of an asp.net assembly and name of connection string 


Let us first have a label named lblversion, where we shall display the name of the connection string and build date of assembly


Code to be placed in codebehind :


lblVersion.Text = String.Format("Schema: {0}Build Date: {1}", Schema, System.IO.File.GetLastWriteTime (System.Reflection.Assembly.GetExecutingAssembly().Location).
ToShortDateString());

How to create RSS Feeds and Google Sitemap for ASP.Net MVC using LINQ to xml




The two most popular reasons why we have a XML in most of our personal websites
  1. RSS Feed

  2. Google Site Map

The above said two reasons can be be implemented using LINQ to XML


Read more...

How to implement Auto Suggest using an Auto complete Extender Control




This Auto Suggest control shall suggest the user
  1. Text based on text entered.

  2. Shall suggest you images based on the image name entered as input in the text box.

Read More...

How to build Custom SEO friendly paging with ASP.NET Repeater or DataList control




Asp.net Controls like Data Grid and Grid view have paging functionality out of the box. How about controls like repeater and data list control which do not having paging out of the box.


Advantages of these controls:
  1. View State need not be maintained.

  2. They are SEO (Search engine Optimization) friendly, so search engines like google and bing can even crawl through all the records in this Repeater or DataList

Read More...

asp.net chart vertical horizontal strip lines

asp.net chart vertical horizontal strip lines

How to enable vertical and horizontal strip lines for improved readability in an asp.net chart control

Add the following code in the Code behind :

/*For Vertical and horizontal Lines:

 chart.ChartAreas[0].AxisY.MajorGrid.Enabled = true; 

 chart.ChartAreas[0].AxisX.MajorGrid.Enabled = true;

Here is the developer network reference to asp.net chart controls http://msdn.microsoft.com/en-us/library/dd456632.aspx

asp.net chart vertical horizontal strip lines

asp.net chart vertical horizontal strip lines

legend top of ASP.net chart control

legend top of ASP.net chart control, To place the legend on top of ASP.net chart control

 /*Add the following Code in the Code Behind

   Chart.Legends[0].Docking = Docking.Top;

   Chart.Legends[0].BackColor = Color.White;


ASP.net chart control stacked bar column chart

ASP.net chart control stacked bar column chart

To  make ASP.net chart control look like a stacked bar column chart

Add the Following in Code behind:

// Code to make the chart look like stacked
 Chart2.Series[0].ChartType = SeriesChartType.StackedColumn;

 Chart2.Series[1].ChartType = SeriesChartType.StackedColumn;

 Chart2.Series[2].ChartType = SeriesChartType.StackedColumn;

 Chart2.Series[3].ChartType = SeriesChartType.StackedColumn;

x axis labels stacked bar ASP.Net chart controls


x axis labels stacked bar ASP.Net chart controls


If the X-axis doesn't show all labels for the stacked bar chart control

 

We need to add this in codebehind :

 

Chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;

 

In .aspx :

 

AxisX  IsLabelAutoFit="true"

LabelStyle Angle="-90" Interval="1" 

MajorTickMark Enabled ="false"