In Front page we take two label and another one is button. Label showing email ID and Mobile No.
HTML Page structure
- <form id="form1" runat="server">
- <div>
- <asp:Label runat="server" ID="name"></asp:Label>
- <br />
- <asp:Label runat="server" ID="Mobile"></asp:Label>
- </div>
- <asp:Button runat="server" ID="clickme" OnClick="clickme_Click" Text="test me " />
- </form>
- protected void clickme_Click(object sender, EventArgs e)
- {
- name.Text = Getemail("[email protected]");
- Mobile.Text = GetMobile("1234567890");
- }
- public string Getemail(string Name)
- {
- if (Name.Length < 1)
- {
- Response.Write("No records found");
- }
- else
- {
- for (i = 0; i < Name.Length; i++)
- {
- if (i >= 2)
- {
- if (Name[i] != _char)
- {
- temp += "*";
- }
- else
- {
- temp += Name[i];
- break;
- }
- }
- else
- {
- temp += Name[i];
- }
- }
- for (int m = i + 1; m < Name.Length; m++)
- {
- temp += Name[m];
- }
- }
- return temp;
- }
- public string GetMobile(string Mobile)
- {
- temp = string.Empty;
- if (Mobile.Length < 1)
- {
- temp = "No Mobile no found";
- }
- else
- {
- for (int i = 0; i < Mobile.Length; i++)
- {
- if (i < 1)
- {
- temp += Mobile[i];
- }
- else
- {
- if (i+1 == Mobile.Length)
- {
- temp += Mobile[i];
- }
- else
- {
- temp += "*";
- }
- }
- }
- }
- return temp;
- }
Final Output of code
Last word
I know this is not a big code but i share with any one help.

Jitendra KumarPosted Dec 20, 2014, 10:41 AM
Good..
Manish Kumar ChoudharyPosted Dec 20, 2014, 3:20 AM
Nice one Joginder Banger sir..