Passing variable from code behind to HTML tag in ASP.NET

Some how in some case, we want to directly passing variable that we already declare in ASP.NET with code behind to the HTML tag, like <input type = “TEXT”> tag in HTML, we can do that just with the simple code, here is the way:

Declare test as a property (at the class level) instead of a local variable, then refer to it as you currently do in your markup (aspx).

VB.NET 10 (automatic properties):

Protected Property test As String = "Test" 

---------------------------------------------

Pre-VB.NET 10 (no support for automatic properties)

Private _test As String
Protected Property Test As String
Get
     Return _test
End Get
Set(value As String)
     _test = value
End Set
End Property

——————————————————–

place that variable in HTML tag that you want to place, such as :

<input type=”TEXT” name=”SomeThing” size=”50″ maxlength=”250″ value = “<%= test %>”>

 

that’s all, hope this helpful

Enable content expiration under IIS 7

In IIS6, it was with the website properties –> HTTP Headers. Here in IIS7, you can do this on the “HTTP Response Headers” feature on the website.

  • Select the website in the Connections pane.
  • Double click on the “HTTP Response Headers” feature in the features pane
  • In the action pane, click on the “Set Common Headers…”

image

  • You will see the following popup

image

Now, you know what to select. You should enable the HTTP Keep-Alive on this popup only.

 

Source : http://blogs.msdn.com/b/rakkimk/archive/2007/07/10/iis7-how-to-enable-content-expiration.aspx

Run CGI program under IIS 7.0

Looking around I didn’t find a good documentation on how to get good old CGI’s running on IIS 7 or 7.5. Here is a quick walkthrough:

1. Let’s write a quick CGI:
Take the following code and save it as simplecgi.cs in the directory c:\inetpub\wwwroot\cgi

using System;
using System.Collections;

class SimpleCGI
{
    static void Main(string[] args)
    {
        Console.WriteLine("\r\n\r\n");
        Console.WriteLine("<h1>Environment Variables</h1>");
        foreach (DictionaryEntry var in Environment.GetEnvironmentVariables())
            Console.WriteLine("<hr><b>{0}</b>: {1}", var.Key, var.Value);
    }
}

2. Change into the C:\inetpub\wwwroot\cgi directory and compile the source by using the following command-line:

%windir%\Microsoft.NET\Framework\v2.0.50727\csc.exe SimpleCGI.cs

Read more of this post

Excel 2003 Add-in: XML Tools Add-in

Instructions

To install the add-in, complete the following steps:

    1. Start Excel.
    2. On the Tools menu, click Add-Ins.
    3. Click the Browse button and navigate to the .xla file.
    4. Select it and then click OK.
    5. Click Yes to any file copy or overwrite prompts.

 

How to install Add-in in MS Excel 2007

1. Click the ball office logo at the top-left of the program
2. Click button “Excel Option”

3. Select item “Add-Ins”
4. Select “Excel Add-Ins” in Manage list box and click button “Go…”

5. Tick the add-ins that you want and click button “OK”