Sunday, 18 November 2012

web editor in windows form


        private void frmPrdouctVariant_Load(object sender, EventArgs e)
        {
            _objMdiMalta = (mdiAMalta)this.MdiParent;

            ClearProductDetails();
            wbFullDescription.Navigate(Path.GetDirectoryName(Application.ExecutablePath).Replace("\\bin\\Debug", string.Empty) + "\\tinymce\\examples\\HtmlEditor.html");

        }
        public string HtmlFullDescription
        {
            get
            {
                string content = string.Empty;
                if (wbFullDescription.Document != null)
                {
                    object html = wbFullDescription.Document.InvokeScript("GetContent");
                    content = html as string;
                }
                return content;
            }
            set
            {
                if (wbFullDescription.Document != null)
                {
                    wbFullDescription.Document.InvokeScript("SetContent", new object[] { value });
                    // wbFullDescription.DocumentText = wbFullDescription.DocumentText.Replace("@@content@@", value);
                }
            }
        }

      public void CreateHtmlEditor(String strContent)
        {
            // String strFilePath = AppDomain.CurrentDomain.BaseDirectory + "tinymce\\examples\\index.html";
            String strBasePath = Path.GetDirectoryName(Application.ExecutablePath).Replace("\\bin\\Debug", string.Empty);
            String strFilePath = strBasePath + "\\tinymce\\examples\\index.html";
            if (File.Exists(strFilePath))
            {
                String strFileContent = File.ReadAllText(strFilePath);

                strFileContent = strFileContent.Replace("@@content@@", strContent);
                if (File.Exists(strBasePath + "\\tinymce\\examples\\HtmlEditor.html"))
                {
                    File.Delete(strBasePath + "\\tinymce\\examples\\HtmlEditor.html");
                }
                File.WriteAllText(strBasePath + "\\tinymce\\examples\\HtmlEditor.html", strFileContent);
            }
        }

Add two gridview column deatils to one gridview column


 <div style="background-color: White; height: 600px; overflow-y: scroll;">
                <asp:GridView ID="gvCategory" runat="server" AutoGenerateColumns="false"
                    Width="200px" Height="90%"
                    OnPageIndexChanging="gvSuppliers_PageIndexChanging1"
                    onrowdatabound="gvCategory_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="Category names">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtnCategory" runat="server"  CommandArgument='<%#Eval("CategoryID") %>'
                                    OnClick="lbtnCategory_Click"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerSettings Mode="NumericFirstLast" />
                </asp:GridView>
            </div>


  protected void lbtnCategory_Click(object sender, EventArgs e)
         {
             LinkButton lbtnSupplier = (LinkButton)sender;
             int categoryid = int.Parse(lbtnSupplier.CommandArgument);
             int intSupplierID = Convert.ToInt32(Session["intSupplierID"]);
             BindProductGrid(intSupplierID, categoryid);
          }

          protected void gvCategory_RowDataBound(object sender, GridViewRowEventArgs e)
          {
              if (e.Row.RowType == DataControlRowType.DataRow)
              {
                LinkButton lbtn= (LinkButton) e.Row.FindControl("lbtnCategory");
                //Text='"<%#Eval("Name")"+"("+Eval("ProductCount")%>+")"'
                DataRow rowView = ((DataRowView)e.Row.DataItem).Row;
               
                if (lbtn != null)
                {
                    lbtn.Text = rowView["Name"] + " (" +  rowView["ProductCount"] + ")";
                }
              }
          }
     

Saturday, 29 September 2012

Test Credit Card Account Numbers


Test Credit Card Account Numbers

Credit Card Type
Credit Card Number
American Express
378282246310005
American Express
371449635398431
American Express Corporate
378734493671000
Australian BankCard
5610591081018250
Diners Club
30569309025904
Diners Club
38520000023237
Discover
6011111111111117
Discover
6011000990139424
JCB
3530111333300000
JCB
3566002020360505
MasterCard
5555555555554444
MasterCard
5105105105105100
Visa
4111111111111111
Visa
4012888888881881
Visa
4222222222222
Note : Even though this number has a different character count than the other test numbers, it is the correct and functional number.
Processor-specific Cards
Dankort (PBS)
76009244561
Dankort (PBS)
5019717010103742
Switch/Solo (Paymentech)
6331101999990016

Wednesday, 26 September 2012

Ajax model pop up


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="samplemodel.aspx.cs" Inherits="vScreenSite.pages.samplemodel" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

.ModalPopupBG
{
    background-color: #666699;
    filter: alpha(opacity=50);
    opacity: 0.7;
}

.HellowWorldPopup
{
    min-width:200px;
    min-height:150px;
    background:white;
}
    </style>
</head>
<body>
    <form id="form1" runat="server">
 <cc1:ToolkitScriptManager ID="tlkt1" runat="server">
                </cc1:ToolkitScriptManager>
<%--<asp:button id="Button1" runat="server" text="Button" />--%>

<%--<cc1:modalpopupextender id="ModalPopupExtender1" runat="server"
cancelcontrolid="btnCancel" okcontrolid="btnOkay"
targetcontrolid="Button1" popupcontrolid="Panel1"
popupdraghandlecontrolid="PopupHeader" drag="true"
backgroundcssclass="ModalPopupBG">
</cc1:modalpopupextender>--%>



<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Button ID="btnLogin1" runat="server" Text="Already have an account? Log in." OnClick="btnLogin1_Click" />
        <asp:Button ID="BtnTarget" runat="server" Text="Target" Style="display: none" />
       
        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="BtnTarget"
            PopupControlID="Panel1">
        </cc1:ModalPopupExtender>
        <asp:Panel ID="Panel1" runat="server" BackColor="WhiteSmoke" Width="300px" Height="200px">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                <ContentTemplate>
                <table>
                <tr>
                <td>
                    <asp:Label ID="lblEmail" runat="server" Text="enter id value"></asp:Label>
                </td>
                <td>
                 <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                </td>
                 
                </tr>
                <tr>
                <td><asp:Label ID="lblPassword" runat="server" Text="enter pass value"></asp:Label>
             
                </td>
                <td><asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
                </td>
                </tr>
                </table>
                <asp:Label ID="lbl" runat="server" ></asp:Label>
               
                    <asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnLogin" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </asp:Panel>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnLogin1" EventName="Click" />
    </Triggers>
</asp:UpdatePanel>
    </form>
</body>
</html>

codebehind file code

    protected void btnLogin1_Click(object sender, EventArgs e)
        {
            ModalPopupExtender1.Show();
            txtEmail.Text = "sai";
            txtPassword.Text = "babu";
     
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtEmail.Text == "sai" && txtPassword.Text == "babu")
            {
                Response.Redirect("child_login.aspx");
            }
            else
            {
                ModalPopupExtender1.Show();
                lbl.Text = txtEmail.Text;
            }
          //  Response.Write(TextBox1.Text+" and "+TextBox2.Text);
          //  Response.Redirect("child_login.aspx");
        }
    }



Monday, 24 September 2012

facebook share


 <script>
        function fbs_click()
         {
            u = location.href;
            t = document.title;
         window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436'); return false; }</script>
    <style>
        html .fb_share_link
        {
            padding: 2px 0 0 20px;
            height: 16px;
            background: url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left;
        }
    </style>
    <a rel="nofollow" href="http://www.facebook.com/share.php?u=>" onclick="return fbs_click()"
        target="_blank" class="fb_share_link">Share on Facebook</a>

Thursday, 20 September 2012

twitter share code

<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.domain.com/gfgf+11/" runat="server"  data-count="none" data-via="AnGe7s" data-lang="fr">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>






Properties which can be used by all types of the Tweet Button

The properties in this table can be used by the Javascript, IFRAME and build your own Tweet Buttons. Each property is a query string parameter for the https://twitter.com/share URL.

Query String Parameter   Description
url                                  URL of the page to share
via                                 Screen name of the user to attribute the Tweet to
text                                 Default Tweet text
related                         Related accounts
count                        Count box position
lang                               The language for the Tweet Button
counturl                       URL to which your shared URL resolves
hashtags                      Comma separated hashtags appended to tweet text
size                               The size of the rendered button
dnt                                See this section for information
Properties which can be used by the Javascript Tweet Button

The properties in this table can only be used by the Javascript Tweet Button. When used they provide additional places the Tweet Button can look for information on what to pre fill the Tweet with. The Tweet Button looks for property values in the priority order given in the table. For example when looking for the URL to use, the Tweet Button will:


Monday, 17 September 2012

Radio button validation


  <asp:Button ID="btnStep3" CssClass="btn-continue" runat="server" Text="Continue" OnClientClick="return validateRadio();" ValidationGroup="SignUP" OnClick="btnStep3_Click" />
            <script type="text/javascript">
                function validateRadio() {
                    var ErrorMessage = '';
                   // var ErrorMessage1 = '';
                    var GvId = document.getElementById('<%=TxtbxGvtID.ClientID%>');
                    //debugger;
                    if (GvId.value.length == 0) {
                        ErrorMessage = "Please enter Government ID \n";
                    } else if (isNaN(parseInt(GvId.value))) {
                    ErrorMessage += "Please Enter Numeric Value in Govt Id \n";
                                     
                    }          
               
                var Ck1 = document.getElementById('<%=rbn1Year.ClientID %>');
                //debugger;
                var Ck2 = document.getElementById('<%=rb2Year.ClientID %>');
                var Ck3 = document.getElementById('<%=rbing3to5years.ClientID %>');
                var Ck4 = document.getElementById('<%=rbingMoreThan5years.ClientID %>');

                var Ck5 = document.getElementById('<%=rbOptionExperienceLessThan1year.ClientID %>');
                var Ck6 = document.getElementById('<%=rbOptionExperience1to2years.ClientID %>');
                var Ck7 = document.getElementById('<%=rbOptionExperience3to5years.ClientID %>');
                var Ck8 = document.getElementById('<%=rbOptionExperienceMoreThan5Years.ClientID %>');


                var Ck9 = document.getElementById('<%=rbExperienceLessThan1Yers.ClientID %>');
                var Ck10 = document.getElementById('<%=rbExperience1to2years.ClientID %>');
                var Ck11 = document.getElementById('<%=rbExperience3to5years.ClientID %>');
                var Ck12 = document.getElementById('<%=rbCDFTradingExperienceMoreThan5Years.ClientID %>');

                var Ck13 = document.getElementById('<%=rbExperienceLessThan1Year.ClientID %>');
                var Ck14 = document.getElementById('<%=rbExperience1to2years.ClientID %>');
                var Ck15 = document.getElementById('<%=rbExperience3to5years.ClientID %>');
                var Ck16 = document.getElementById('<%=rbFutresMoreThan5Years.ClientID %>');

                var Ck17 = document.getElementById('<%=rbExperienceLessThan1Year.ClientID %>');
                var Ck18 = document.getElementById('<%=rbExperience1to2years.ClientID %>');
                var Ck19 = document.getElementById('<%=rbExperience3to5years.ClientID %>');
                var Ck20 = document.getElementById('<%=rbExperienceMoreThan5years.ClientID %>');


                if (Ck1.checked == true || Ck2.checked == true || Ck3.checked == true || Ck4.checked == true) { } else { ErrorMessage += "Please fill Currency’s trading experience?\n"; }
                if (Ck5.checked == true || Ck6.checked == true || Ck7.checked == true || Ck8.checked == true) { } else { ErrorMessage += "Please fill experience?\n"; }
                if (Ck9.checked == true || Ck10.checked == true || Ck11.checked == true || Ck12.checked == true) { } else { ErrorMessage += "Please fill  CDF/Commodities trading experience? \n"; }
                if (Ck13.checked == true || Ck14.checked == true || Ck15.checked == true || Ck16.checked == true) { } else { ErrorMessage += "Please fill Futures trading experience\n"; }
                if (Ck17.checked == true || Ck18.checked == true || Ck19.checked == true || Ck20.checked == true) { } else { ErrorMessage += "Please fill Securities trading experience?\n"; }

                if (ErrorMessage.length != 0) {
                    alert(ErrorMessage);
                   //alert(ErrorMessage1);
                    return false;
                }