Friday, April 11, 2014

how to make a asp textbox visible true using javascript

 <asp:TextBox ID="txtclientname" runat="server" Style="display: none;"></asp:TextBox>

  <a href="#" onclick="ChangeClient();">
                        <img src="images/logout.jpg" width="20" height="20" /></a></div>

<script type="text/javascript">
        function ChangeClient() {
            document.getElementById('<%= lblclientName.ClientID %>').style.display = 'none';
            document.getElementById('<%= txtclientname.ClientID %>').style.display = '';
        }
    </script>

Change visibility of ASP.NET label with JavaScript

document.getElementById('<%= lblclientName.ClientID %>').style.display = 'none';

how to Destroy all sessions at one Time in asp.net?

Session.Clear()
Session.RemoveAll()
Session.Abandon()

Thursday, April 10, 2014

access session variable in web service

 [System.Web.Services.WebMethod(EnableSession = true)]
        public static string[] Save_Data(string args)
        {
            string[] KeyValues = null;
            string[] arguments = args.Split('&');
            string income = arguments[0];
            string bonus = arguments[1];
            string Investment = arguments[2];
  string LeadId = Convert.ToString(HttpContext.Current.Session["LeadId"]);
            string Result = CommonClass.Common.Instance.AddModifyIncomeDetails(income, bonus, Investment);
            return KeyValues;
        }

Passing multiple argument through CommandArgument of Button in Asp.net

1) ASPX Page
<asp:TemplateField HeaderText="Start Planning" HeaderStyle-ForeColor="Black">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/track1.jpg" CausesValidation="false"
                                                    CommandName="start" CommandArgument='<%#Eval("LeadId") + "," +Eval("Name")%>'
                                                    Text="Start Plan" OnClientClick="aspnetForm.target ='_blank';" ToolTip="Start Planning" />
                                            </ItemTemplate>
                                        </asp:TemplateField>

2) CS Page

 protected void dgvContent_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string[] arg = new string[2];
            arg = e.CommandArgument.ToString().Split(',');
            Session["LeadId"] = arg[0];
            Session["ClientName"] = arg[1];

            //string LeadId = e.CommandArgument.ToString();
            string Commandname = e.CommandName;
            if (Commandname == "start")
            {
                lblclientName.Text = Convert.ToString(Session["ClientName"]);
                //Response.Redirect("Riskprofiler.aspx?id=" + LeadId + "");
            }

        }

Tuesday, April 8, 2014

Copy and Paste is not working on my Remote Desktop Connection… what’s wrong?

Luckily fixing the issue is pretty straightforward and involves a few simple steps.
  1. Load up task manager (right click taskbar and select Task Manager)
  2. Go to the Processes Tab
  3. Select rdpclip.exe
  4. Click End Process
  5. Go to the Application Tab
  6. Click New Process
  7. Type rdpclip
  8. Click Ok