START YOUR WEBSITE FROM HERE||OUT SOURCE YOUR PROJECT||CONTACT US

WE ARE LOOKING FOR NEW CLIENTS -->>DEVELOP YOUR COMPANY WITH US -->DELIVER PROJECT ON TIME->CONTACT US FOR MORE DETAILS

Development De Tech || A Technological Blog ||ASPNET||MS SQL||

Find Your Asp.net || Php || Ms Sql || Android ||Webistes||. Join The Site

Computer Hardwares || Instalations || Development De Tech

WE ARE LOOKING FOR NEW CLIENTS -->>DEVELOP YOUR COMPANY WITH US -->DELIVER PROJECT ON TIME->CONTACT US FOR MORE DETAILS

You Need Helping Hands

WE ARE LOOKING FOR NEW CLIENTS -->>DEVELOP YOUR COMPANY WITH US -->DELIVER PROJECT ON TIME->CONTACT US FOR MORE DETAILS

Development De Tech

WE ARE LOOKING FOR NEW CLIENTS -->>DEVELOP YOUR COMPANY WITH US -->DELIVER PROJECT ON TIME->CONTACT US FOR MORE DETAILS

Saturday 17 November 2012

WORDPRESS TUTORIAL FOR BEGINNERS




HOW START A WORDPRESS PROJECT

GO TO   http://wordpress.org/ DOWNLOAD wordpress

After download unzip the file

And places in any folder like F:\My work\wordpress

Start wamp server or xampp server
(install wamp is better )

In wamp start all services then its icon turned green

Then click on wamp select->apache->alias->create new
Then it automatically open command window type just like the example
Give path where your wordpress file is(F:\My work\wordpress)
Alias name should be unique and with out space

After that
In wamp click the localhost
And in that in bottom your alias select your created alias and click it





Then its open wordpress in your browser and complete the details and click next on that
 

Go to phpmyadmin in wamp and  
1,create database
2,create user AND assign privillage



Database Name 

Give your Database Name and password
 
Fill the site name

Submit


Wordpress is now installed and then admin fill username and password

Enter to admin and in admin
 

Admin dashboard 


select themes and select one theme and activate it


 the site is ready in local system


 Next Step Customisation ->


































Sunday 7 October 2012

mail sending code in c#-asp.net-smtp mail send



Code for sending mail in website easy smtp mail transfer code just replace username and password with
your credentials and add it your website




public bool sndmail(string s9 ,string password )
    {
        string s9 = your to address where to send
        try
        {
           
            MailMessage msg1 = new MailMessage();
            msg1.From = new MailAddress("your user name");
            msg1.To.Add(new MailAddress(s9.Trim()));
            msg1.Subject = " Password";
            msg1.Body = "This is your Password:" + password;
            msg1.IsBodyHtml = true;
            SmtpClient sc = new SmtpClient("smtp.gmail.com", 587);
            System.Net.NetworkCredential basicAuthentication = new System.Net.NetworkCredential("youremail user name" your password");
            sc.EnableSsl = true;
            sc.UseDefaultCredentials = false;
            sc.DeliveryMethod = SmtpDeliveryMethod.Network;
            sc.Credentials = basicAuthentication;
            sc.Send(msg1);
            return flag;
        }
        catch (Exception e)
        {
            flag = false;
            return flag;
        }
    }

















Random number generation in c#

How to generate random number in c#

For used to Send Random number as Password in Website ,and get random id for new registration
or used for captcha in website easy code

find the below text


public string genpwd()
    {

        string password;
        int minPassSize = 6;
        int maxPassSize = 12;
        StringBuilder stringBuilder = new StringBuilder();
        char[] charArray = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()".ToCharArray();
        int newPassLength = new Random().Next(minPassSize, maxPassSize);
        char character;
        Random rnd = new Random(DateTime.Now.Millisecond);
        for (int i = 0; i < newPassLength; i++)
        {
            character = charArray[rnd.Next(0, (charArray.Length - 1))];
            stringBuilder.Append(character);
        }
        password = stringBuilder.ToString();
        return password;
    }


















Thursday 4 October 2012

ALL Datalist PROPERTIES AND EVENTS EDITING,DELETING,PAGING


ALL Datalist PROPERTIES AND EVENTS EDITING,DELETING,PAGING




Source part

<asp:DataList ID="dlstImages" runat="server" RepeatColumns="4" RepeatDirection="Horizontal" Width="100%" DataKeyField="Image_Gallery_ID" OnItemCommand="dlstImages_ItemCommand">

<ItemTemplate>
 <div id="gallery" style="padding-top: 0 !important; width: 126px !important">

<div id="dlstImg">

<div class="GridHeader" style="height: 15px !important;">

<asp:Label ID="Label1" runat="server" Text='<%# Eval("Image_Gallery_NAME")      %>'></asp:Label>

</div>

<div>
<a href="../Uploads/imagegallery/<%# Eval("Image_Gallery_IMAGE")%>" rel="lightbox[roadtrip]" title='<%# Eval("Image_Gallery_NAME") %>'>
<asp:Image ID="imgAlbum" runat="server" ImageUrl='<%# "../Uploads/imagegallery/thum_"+Eval("Image_Gallery_IMAGE")%>'
                                        BorderColor="#50A5DE" BorderWidth="2px" BorderStyle="Solid" Height="100px" Width="121px" /></a>
                                <br />
</div>

<br />

<asp:Label ID="lblId" runat="server" Text='<%# bind("Image_Gallery_ID") %>' Visible="False"></asp:Label>

<div style="padding: 0 4px 0 31px;">

 <asp:ImageButton ID="Image3" runat="server" ImageUrl="~/admin/images/edit_icon.png" Width="20px" Height="20px" ToolTip="Edit" CommandName="edit" />
                                

<asp:ImageButton ID="imgbtnDelete" runat="server" CommandName="delete" Width="20px" Height="20px" ImageUrl="~/admin/images/delete_icon.png" OnClientClick='javascript:if(confirm("Do you wish to delete?")){return true;} return false;' ToolTip="Delete" />
 </div>
                            <br />
                            <br />

</div>

</div>

</ItemTemplate>

<HeaderStyle CssClass="GridHeader" HorizontalAlign="Left"></HeaderStyle>
 </asp:DataList>


C # code part

  private void Filldatalist(int id)
    {
         //bind dtalist by select all images from database
        DataTable dt = ObjImages.SEL_ALL_Image_GalleryBy_CategoryID(id);
        if (dt.Rows.Count > 0)
        {
            dlstImages.DataSource = dt;
            dlstImages.DataBind();
            dlstImages.Visible = true;
        }
        else
        {

            idWarning.Visible = true;
            dlstImages.Visible = false;
        }

    }


protected void dlstImages_ItemCommand(object source, DataListCommandEventArgs e)
    {
        lblMsg.Visible = false;
        if (e.CommandName == "delete")//seted on source part
        {
            Label lblId = (Label)e.Item.FindControl("lblId");

            int Id = Convert.ToInt32(lblId.Text);
            bool i = ObjImages.DeleteImages(Id);
            if (i == true)
            {
                lblMsg.Visible = true;
                lblMsg.Text = "Successfully Deleted ";
                ImgGal.Style["display"] = "null";
                Filldatalist(int.Parse(HiddenField1.Value));

            }

        }
        else if (e.CommandName == "edit")// seted on source part
        {

            //find value of label using find control
            Label lblId = (Label)e.Item.FindControl("lblId");
            int Id = Convert.ToInt32(lblId.Text);
            FillPhotoDetails(Id);
            Filldatalist(int.Parse(HiddenField1.Value));

        }

    }

GRIDVIEW ALL IN ONE-GRIDVIEW EDIT DELETE AND UPDATE EVENTS


ALL GRIDVIEW PROPERTIES AND EVENTS EDITING,DELETING,PAGING



DESIGN PART




SOURCE PART
<asp:GridView ID="gvModule" runat="server" AutoGenerateColumns="False" DataKeyNames="Module_ID"
            Width="100%" ForeColor="#333333" AllowPaging="true" PageSize="10" CellPadding="4"
            CellSpacing="2" GridLines="None" OnRowDataBound="gvModule_RowDataBound" OnSelectedIndexChanged="gvModule_SelectedIndexChanged"
            OnPageIndexChanging="gvModule_PageIndexChanging" OnRowDeleting="gvModule_RowDeleting">
            <Columns>
                <asp:BoundField DataField="Module_Id" HeaderText="Module_Id" Visible="false">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="#No">
                    <ItemTemplate>
                        <%# Container.DataItemIndex +1  %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Module_NAME" HeaderText="Module">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:ImageButton ID="ibEdit" runat="server" CommandName="select" Width="16px" Height="16px"
                            ImageUrl="~/admin/images/edit_icon.png" />
                    </ItemTemplate>
                    <HeaderStyle Width="100px" />
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:ImageButton ID="ibDelete" runat="server" CommandName="delete" Width="16px" Height="16px"
                            ImageUrl="~/admin/images/delete_icon.png" OnClientClick='javascript:if(confirm("Do you wish to delete?")){return true;} return false;' />
                    </ItemTemplate>
                    <HeaderStyle Width="100px" />
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="GridHeader" HorizontalAlign="Left"></HeaderStyle>
            <PagerStyle CssClass="GridHeader" HorizontalAlign="Center" />
            <RowStyle BorderColor="#f08f40" BackColor="#EFF3FB" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EmptyDataTemplate>
                No Data Found
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#DCE6F7" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle Font-Names="Helvetica" VerticalAlign="Middle" Height="25px" />
            <EditRowStyle BackColor="#2461BF" Font-Bold="true" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>




C# CODE PART

private void FillGrid()
    {
  DataTable dt = objMd.Select_All_Modules();//CODE FOR TAKING VALUE AS DATATABLE
        if (dt.Rows.Count > 0)
        {
            gvModule.DataSource = dt;
            gvModule.DataBind();
        }
        else
        {
            idWarning.Visible = true;//MESSAGE
        }
    }

    private void FillForm(int Id)
    {
        DataTable dt=objMd.Select_One_Modules(Id);
        if (dt.Rows.Count > 0)
        {
            hidVid.Value = Id.ToString();
           
        txtModule.Text = dt.Rows[0]["Module_NAME"].ToString();
        txtDescription.Text = dt.Rows[0]["Module_DESCRIPTION"].ToString();
        }

    }

  //SELECTED INDEX CHANGED FOR EDITING ONE ROW IN GRID GIVES COMMAND NAME AS SELECT
    protected void gvModule_SelectedIndexChanged(object sender, EventArgs e)
    {
        FillForm(int.Parse(gvModule.SelectedDataKey[0].ToString()));
        FillGrid();
    }


//FOR ALTERNATE ROW STYLES
protected void gvModule_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#fdfcf6'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#f6f6f6'");
        }
    }


//FOR PAGE INDEXING OR PAGING
protected void gvModule_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        gvModule.PageIndex = e.NewPageIndex;
        FillGrid();
        idWarning.Visible = false;
        lblMsg.Visible = false;
    }

//DELETE FUNCTION
    private void Delete(int Id)
    {
        bool Del = objMd.Delete_Module(Id);
        if (Del == true)
        {
            lblMsg.Visible = true;
lblMsg.Text = "Module deleted sucessfully . ";
          

        }
    }

//FOR DELETING IN GRID USING DELETE COMMAND
    protected void gvModule_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        dvModule.Style["display"] = "none";
        Delete(int.Parse(gvModule.DataKeys[e.RowIndex].Value.ToString()));
        FillGrid();
     

    }