How to reduce the flicker in IE on postback ?

Asp.net causes browsers / webpages to flash or flicker during a postback to the server. To reduce this flicker you should include below meta tag inside the header tag. 

<meta http-equiv="Page-Exit" content="Alpha(opacity=100)" />

Below is the Definition and Usage of the Tag/Value

http-equiv

The http-equiv attribute provides an HTTP header for the information in the content attribute.The http-equiv attribute can be used to simulate an HTTP response header.The value of the http-equiv attribute depends on the value of the content attribute.If the name attribute is set, the http-equiv attribute should not be set.

Page-Exit

defines what filter to apply when user leaves the page.

Content

The required content attribute specifies the content of the meta information.The value of the content attribute depends on the value of the name or http-equiv attribute.

Textbox readonly in asp.net

If TextBox’s ReadOnly property is “true”, postback data won’t be loaded e.g it essentially means TextBox being readonly from server-side standpoint (client-side changes will be ignored).

If you want TB to be readonly in the “old manner” use

TextBox1.Attributes.Add(”readonly”,”readonly”)

as that won’t affect server-side functionality.

Allow to select only one radiobutton in repeater (Using JavaScript)

When we use the the radio Button inside the gridview or the repeater at that time radiobutton is not working as it’s  default behaviour.
Means,Inside the gridview/repeater user able to select more then one option at a time.For which radioButton is not built.

To allow a user to select only one optional at a time.You need to something more then just putting radiobutton control inside the gridview/Reapeter.

In This article I have taken the example of the radiobutton inside the repeater.However,Similar thing can be implement for gridview  / DataList.
Step 1:
Drag and drop Radiobutton control inside the Repeater’s item-template. And give the ID and group name same. ( It’s not Mandatory that they both same)

<asp:RadioButton runat=”server” ID=”IdOfRepeter” GroupName=”IdOfRepeter” />

Step 2:
Binding javascript with RadioButton’s onclick Evetn inside the Repeter’s ItemDataBound Event.

protected void RepeterName_ItemDataBound(object sender, RepeaterItemEventArgs e)
{       
          //if control is not Radiobutton retun
               if (e.Item.ItemType != ListItemType.Item &&
                             e.Item.ItemType  != ListItemType.AlternatingItem)
                        return;

            //get  the reference of the radioButton by id
           //“IdOfRepeter” means your Repeter id
          RadioButton rdo = (RadioButton)e.Item.FindControl(”IdOfRepeter”);
        // Create the javascriot function with paramater value.
        //“IdOfRepter”Means group Name
         string script = “SetUniqueRadioButton(’IdOfRepter ‘,this)”;
     
          //register javaScript with Radiobutton click Event.
           rdo.Attributes.Add(”onclick”, script);

}
Setp 3:
Create javascipt block in head section and add function which we have register with Radiobutton.
<script type=”text/javascript” language=”javascript”>

//<summary>This function will provide used to select the only one radioButton at a time.</summary>
//<param name=’nameregex’>point to name Groupname of RadioButton</param>
//<param name=’current’>point to clicked RadioButton</param>
function SetUniqueRadioButton(nameregex, current)
{
 //Get the group name of checkBox
 var re = nameregex;
 
 //Looping through the all the control on the page
 for(i = 0; i < document.forms[0].elements.length; i++)
  {
    //get the current control
   elm = document.forms[0].elements[i]
       
 //check for the type(if it’s radio button then go inside the loop)
 if (elm.type == ‘radio’)
 {
        //if radiobutton belong to same Groupname
     if(re.match(elm.value))
    {
         //set selected to false for all
      elm.checked = false;
    }
 }
  }
 //Set currently click Radio Button selected as true.
 current.checked = true;
}
</script>

Generating random Numbers

public string GetRendomNumber()
{
       Random randomClass = new Random();

    //This will return  random number length between the 6 to 30.
     int length = randomClass.Next(6, 30); 
    StringBuilder rndNumberCollected = new StringBuilder();

    //This will generate the random number With the size of length
    for (int i = 0; i < length; i++)
    {
        int getRndNumber = randomClass.Next(0, 9);
        rndNumberCollected.Append(Convert.ToString(getRndNumber));
    }
    string getRandemNumber = Convert.ToString(rndNumberCollected);
    return getRandemNumber;
}