Tuesday, April 29, 2014

access textbox text in code behind in jquery popup

<script type="text/javascript">
        function ShowPopup() {

            $("#dialog-modal").dialog({

                title: "Change Default Password For Client",
                height: 230,
                width: 400,
                appendTo: "form",
                buttons: {
                    Close: function () {
                        $(this).dialog('close');
                    }
                },
                modal: true
            });
        };      
    </script>

//Use    appendTo: "form" 

Open Jquery Popup on a tag

 <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script type="text/javascript">
        function ShowPopup() {

            $("#dialog-modal").dialog({

                title: "Change Default Password For Client",
                height: 230,
                width: 400,
                buttons: {
                    Close: function () {
                        $(this).dialog('close');
                    }
                },
                modal: true
            });
        };      
    </script>



 <div id="dialog-modal" title="Basic modal dialog" style="display: none;">
        <asp:TextBox ID="txtclientdefaultpassword" runat="server"></asp:TextBox>
        <asp:Button ID="btnchangepassword" runat="server" Text="Change Password" UseSubmitBehavior="false" />
    </div>

open window in new tab javascript

  var hdfclientName = $('input[id$=hdfclientName]').val();
    var assestsallocation = "http://effectiveadvice.in:81/Login.aspx?UserName=" + hdfclientName + "";
    window.open(assestsallocation, '_blank');

popup is not opening in updatepanel

1) Code Behind :
 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ClientScript", "ShowPopup();", true);

2) aspx:
  <div id="dialog-modal" title="Basic modal dialog" style="display: none">
                <asp:Button ID="btngoalbased" runat="server" Text="Goal Based" Style="width: auto;
                    background: #600ABD; color: white; text-align: center; height: 34px; border: none;"
                    OnClick="btngoalbased_Click" UseSubmitBehavior="false" />
                <br />
                <asp:Button ID="btnholisticplan" runat="server" Text="Holistic Planning" Style="width: auto;
                    background: #600ABD; color: white; text-align: center; height: 34px; border: none;"
                    OnClick="btnholisticplan_Click" UseSubmitBehavior="false" />
                <%--   <a href="RiskProfiler.aspx" id="riskprofiler">Risk Profiler</a>
        <br />
        <a id="holisticplanner" runat="server">Holistic Planning</a>--%>
            </div>
            <asp:UpdatePanel ID="uppanel" runat="server">
        <ContentTemplate>
            <table width="100%" cellpadding="10" cellspacing="0">
                <tr>
                    <td width="30%">
                        <a href="NewLeads.aspx">
                            <img src="../images/add_leads.png" width="300" height="35" /></a>
                    </td>
                    <td width="36%">
                        <a href="TrackLeads.aspx">
                            <img src="../images/track_lead.png" width="300" height="35" /></a>
                    </td>
                    <td width="34%">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="2" bgcolor="#E6FFFF" class="text">
                        <div class="tracklead">
                            <asp:GridView ID="dgvContent" AllowSorting="true" CellPadding="5" BorderStyle="None"
                                AllowPaging="true" Width="100%" CellSpacing="5" PageSize="10" AutoGenerateColumns="false"
                                runat="server" OnPageIndexChanging="dgvContent_PageIndexChanging" PagerSettings-Mode="Numeric"
                                PagerSettings-PageButtonCount="4" OnRowCommand="dgvContent_RowCommand" OnRowDataBound="dgvContent_RowDataBound">
                                <RowStyle />
                                <AlternatingRowStyle />
                                <PagerStyle HorizontalAlign="Left" CssClass="pager" />
                                <HeaderStyle BackColor="#F1A626" />
                                <EmptyDataTemplate>
                                    No Record Found
                                </EmptyDataTemplate>
                                <Columns>
                                    <asp:BoundField DataField="LeadId" HeaderText="Lead Id" HeaderStyle-Height="35" HeaderStyle-ForeColor="Black" />
                                    <asp:BoundField DataField="Name" HeaderStyle-ForeColor="Black" HeaderStyle-Height="35"
                                        HeaderText="Name" />
                                    <asp:BoundField DataField="Phone" HeaderText="Phone" HeaderStyle-Height="35" HeaderStyle-ForeColor="Black" />
                                    <asp:BoundField DataField="LeadCategoryName" HeaderText="Status" HeaderStyle-Height="35"
                                        HeaderStyle-ForeColor="Black" Visible="false" />
                                    <asp:TemplateField HeaderText="Lead Status" HeaderStyle-ForeColor="Black">
                                        <ItemTemplate>
                                            <asp:Label ID="lblLeadId" runat="server" Text='<%# Eval("LeadId") %>' Visible="false" />
                                            <asp:Label ID="lblleadstatus" runat="server" Text='<%# Eval("LeadCategoryId") %>'
                                                Visible="false" />
                                            <asp:DropDownList runat="server" ID="ddlleadstatus" AutoPostBack="true" OnSelectedIndexChanged="ddlleadstatus_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="LeadCategoryId" HeaderText="LeadCategoryId" HeaderStyle-Height="35"
                                        HeaderStyle-ForeColor="Black" Visible="false" />
                                    <asp:BoundField DataField="ReferredBy" HeaderText="Referred By" HeaderStyle-ForeColor="Black" />
                                    <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" ToolTip="Start Planning" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <table style="height: 15px; text-align: left; vertical-align: top; width: 100%;">
                                <tr>
                                    <td style="width: 200px; height: 20px; text-align: center; vertical-align: middle;">
                                        <b><i>
                                            <%=dgvContent.PageIndex + 1%>of<%=dgvContent.PageCount%></i></b>
                                    </td>
                                </tr>
                            </table>
                            <asp:HiddenField ID="hdfclientid" runat="server" />
                        </div>
                    </td>
                    <td valign="top" bgcolor="#FCEBCF">
                        <div style="width: 400px; height: 500px;">
                            <asp:Chart ID="Chart1" runat="server" Height="200px" Width="300px">
                                <Titles>
                                    <asp:Title ShadowOffset="3" Name="Items" />
                                </Titles>
                                <Series>
                                    <asp:Series Name="Default" />
                                </Series>
                                <ChartAreas>
                                    <asp:ChartArea Name="ChartArea1" BorderWidth="0">
                                        <AxisX>
                                            <MajorGrid Enabled="False" />
                                        </AxisX>
                                        <AxisY>
                                            <MajorGrid Enabled="False" />
                                        </AxisY>
                                    </asp:ChartArea>
                                </ChartAreas>
                                <Legends>
                                    <asp:Legend Alignment="Center" Docking="Right" IsDockedInsideChartArea="false" IsTextAutoFit="true"
                                        Name="Default" LegendStyle="Table">
                                    </asp:Legend>
                                </Legends>
                            </asp:Chart>
                        </div>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="dgvContent" EventName="RowCommand" />
        </Triggers>
    </asp:UpdatePanel>

Button Hide and show using jquery

 Step 1: var planType = $('input[id$=hdfPlanType]').val();

        if (planType = 'Goalbased') {
            $("#btncreatemyplan").show();
            $("#btnFA").hide();
        }
        if (planType = 'Holistic') {
            $("#btncreatemyplan").hide();
            $("#btnFA").show();
        }

Access ASP.net Hiddenfield value in javascript

  var hv = $('input[id$=hdfPlanType]').val();

Monday, April 28, 2014

Button Click on jquery popup not firing

Step 1:  <asp:Button ID="btngoalbased" runat="server" Text="Goal Based" Style="width: auto;
            background: #600ABD; color: white; text-align: center; height: 34px; border: none;"
            OnClick="btngoalbased_Click" UseSubmitBehavior="false" />

Step 2:  UseSubmitBehavior="false"

Step 3 :then it will work

Saturday, April 12, 2014

Send Multiple parameters from sql to c# e.g comma separated two column values

1) SQL :   SET @RESULT =(SELECT CONVERT(NVARCHAR, LeadId) + ',' + Name
FROM  Lead WHERE (Email = @email))

2) C# :

  var outParam = new SqlParameter("@Result", SqlDbType.NVarChar);
                    outParam.Direction = ParameterDirection.Output;
                    outParam.Size = 100;
                    //  cmd.Parameters["@Result"].Direction = ParameterDirection.Output;


                    cmd.Parameters.Add(outParam);
                    cmd.ExecuteNonQuery();
                    Result = cmd.Parameters["@Result"].Value.ToString();

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

Sunday, April 6, 2014

URL Parameter Pass in Iframe Or Access Value In Aspx page

<iframe id="questionare" src="Questionare.aspx?Clienid=<%=hdfLeadId.Value %>" width="100%" height="550" frameborder="0" allowtransparency="0"></iframe>

Saturday, April 5, 2014

Access hidden field in gridview

string sValue = ((HiddenField)dgvContent.FindControl("hdfLeadId")).Value;

Remove border From Gridview

  protected void dgvContent_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            foreach (TableCell tc in e.Row.Cells)
            {
                tc.BorderStyle = BorderStyle.None;

            }
        }

Friday, April 4, 2014

Scroll bar fro gridview

 <div style="width: 294px; height: 122px; overflow: scroll">
                        <asp:GridView ID="dgvExpertise" AllowSorting="true" AllowPaging="true" PageSize="10"
                            AutoGenerateColumns="false" class="table table-bordered coursesTable" Style="border-collapse: initial;"
                            runat="server" PagerSettings-Mode="Numeric" PagerSettings-PageButtonCount="10"
                            OnPageIndexChanging="dgvExpertise_PageIndexChanging">
                            <RowStyle />
                            <AlternatingRowStyle BackColor="#f9f9f9" />
                            <PagerStyle HorizontalAlign="Left" CssClass="pager" />
                            <HeaderStyle BackColor="#D6D5D6" />
                            <EmptyDataTemplate>
                                No Record Found
                            </EmptyDataTemplate>
                            <Columns>
                                <asp:BoundField DataField="LeadId" HeaderText="LeadId" HeaderStyle-ForeColor="Black" />
                                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                                <asp:BoundField DataField="Phone" HeaderText="Phone" HeaderStyle-ForeColor="Black" />
                                <asp:BoundField DataField="LeadCategoryName" HeaderText="Status" HeaderStyle-ForeColor="Black"
                                    SortExpression="LeadCategoryName" />
                                <asp:BoundField DataField="ReferredBy" HeaderText="ReferredBy" HeaderStyle-ForeColor="Black"
                                    SortExpression="ReferredBy" />
                            </Columns>
                        </asp:GridView>
                    </div>

SqlConnectionString in ASP.NET

Step 1 :  Add this to asp.net .cs page
SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ValweaveFa"].ConnectionString);

Step 2 : Add below lines to web.conf

<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="MySql.Data.MySqlClient" />
<add name="ValweaveFa" connectionString="Data Source=ADMIN-PC\SQLEXPRESS;Initial Catalog=Valweave;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

Thursday, April 3, 2014

Replace all commas in a string with JQuery/Javascript

 var income = $("#txtincome").val();
        if (income == "") {

        }
        else {
            income = income.replace(",", "")
            alert(income);
        }

Open Page in new tab on button click ASP.NET

<asp:Button ID="btn" runat="Server" Text="SUBMIT" 
     OnClick="btnNewEntry_Click" OnClientClick="aspnetForm.target ='_blank';"/>

protected void btnNewEntry_Click(object sender, EventArgs e)
{
    Response.Redirect("Questionare.aspx");
}

Open Page in New Tab

Wednesday, April 2, 2014

Use logical operators to check conditions

1) The != operator works a lot like ==, except it’s true if the two things you’re comparing are not equal.

2) You can use > and < to compare numbers and see if one is bigger or smaller than the other.

3) The ==, !=, >, and < operators are called conditional operators. When you use them to test two variables or values, it’s called performing a conditional test.

4) You can combine individual conditional tests into one long test using the && operator for AND and the || operator for OR. So to check if i equals 3 or j is less than 5, do (i == 3) || (j < 5).

5)  E.g private void button2_Click(object sender, EventArgs e)
{
int x = 5;
if (x == 10)
{
MessageBox.Show(“x must be 10”);
}
else
{
MessageBox.Show(“x isn’t 10”);
}
}

private void button3_Click(object sender, EventArgs e)
{
int someValue = 4;
string name = “Bobbo Jr.”;
if ((someValue == 3) && (name == “Joe”))
{
MessageBox.Show(“x is 3 and the name is Joe”);
}
MessageBox.Show(“this line runs no matter what”);
}

Don’t confuse the two equals sign operators!

1) You use one equals sign (=) to set a variable’s value

2) two equals signs (==) to compare two variables.


Loop Functionality

1) while (x > 5)
{
x = x - 3;
}
In a while loop, all of the statements inside the curly brackets get executed as long as the condition in the
parentheses is true.

2) for (int i = 0; i < 8; i = i + 2)
{
MessageBox.Show(“I’ll pop up 4 times”);
}

Every for loop has three statements. The first sets up the loop. The statement will keep looping as long as
the second one is true. And the third statement gets executed after each time through the loop.

use variables to work with data

1) A variable is what your program uses to store data.

2) Whenever you declare a variable, you tell your program its type and its name.

3) int maxWeight;    string message;      bool boxChecked; variable Types
   
    int myHeight = 63;

What Is CLR

1) When you double-click on the executable, Windows runs your program.
But there’s an extra “layer” between Windows and your program called
the Common Language Runtime, or CLR.

2) Once upon a time, not so long ago (but before C# was around), writing programs was harder,
because you had to deal with hardware and low-level machine stuff.

3) The CLR—often referred to as a virtual machine—takes care of all that for you by doing a sort of “translation” between your program and the computer running it.

Tuesday, April 1, 2014

How C# program executes


When you select “Build Solution” from the Build menu, the IDE
compiles your program. It does this by running the compiler, which
is a tool that reads your program’s source code and turns it into an
executable. The executable is a file on your disk that ends in .exe—
that’s what you double-click on to run your program. When you build
the program, it creates the executable inside the bin folder, which is
inside the project folder. When you publish your solution, it copies
the executable (and any other files necessary) into the folder you’re
publishing to.

Javascript Alert in C#

1) Response.Write("<script>alert('Either User Name Or Password Is Wrong')</script>");

2) Page.ClientScript.RegisterStartupScript(this.GetType(), "ErrorMessage", "Notification('" + ex.Message + "')", true);

3) ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Myscript", "alert('Course have Subjects under it, can not change name');", true);

SETTING UP VISUAL STUDIO 2010 EXPRESS EDITION

Step 1 : It’s easy enough to download and install Visual C# 2010 Express Edition. Here’s the link to the                   Visual Studio 2010 Express Edition download page:
           
             http://www.microsoft.com/express/downloads/

             http://www.visualstudio.com/downloads/download-visual-studio-vs

Step 2 : Download the installation package for Visual C# 2010 Express Edition. Make sure you do a complete installation. That should install everything that you need: the IDE (which you’ll learn about),.NET Framework 4.0, and other tools.

Delete data using template button in gridview

Step 1 :  Add In Gridview ASPX Page


                  <asp:TemplateField>
                  <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server"
                            CommandArgument='<%# Eval("biInvitationId") %>' 
    CommandName="dele">Delete</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "dele")
        {
          string biInvitationId = e.CommandArgument.ToString();
          strResult = DeleteCourseYearDetails(entCourse); 
        }
    }

 public string DeleteCourseYearDetails(object Id)
        {
            Ent_Course entCourse = (Ent_Course)Id;

            using (SqlCommand cmd = DBhelper.Instance.GetCommand("SP_DELETE_COURSEYEAR", CommandType.StoredProcedure))
            {
                cmd.Parameters.AddWithValue("@COURSEID", entCourse.CourseId);
                cmd.Parameters.AddWithValue("@RESULT", "");
                cmd.Parameters["@Result"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                Result = cmd.Parameters["@Result"].Value.ToString();
                DBhelper.Instance.CloseConnection(cmd);

            }
            return Result;
        }

Step 2 : Stored Procedure 

CREATE PROCEDURE [dbo].[SP_DELETE_COURSEYEAR]
 @COURSEID INT,
 @RESULT CHAR(1) OUTPUT
AS
BEGIN
 --DECLARE @COUNT INT
 --SET @RESULT='N'
 --SET @COUNT=(SELECT COUNT(*) FROM CourseYear WHERE Id=@COURSEID)
 --IF(@COUNT > 0)
  BEGIN
   DELETE FROM CourseYear WHERE Id=@COURSEID 
   
   SET @RESULT='Y'
   
  END
 
END


Make Field in Gridview Sortable

Step 1: Add SortExpression=""

 <asp:BoundField DataField="CourseId" HeaderText="Course Id" SortExpression="CourseId"
   HeaderStyle-CssClass="hideTemplateField" ItemStyle-CssClass="hideTemplateField"                                           ControlStyle-CssClass="hideTemplateField" />

Bind Database data to Gridview

Step 1: ASPX Page

  <asp:GridView ID="dgvVertical" AllowSorting="true" AllowPaging="true" PageSize="10"
                                                                        AutoGenerateColumns="false" class="table table-bordered coursesTable" Style="width: 785px;
                                                                        border-collapse: initial;" runat="server" OnRowCreated="dgvVertical_RowCreated"
                                                                        OnSorting="dgvVertical_Sorting" OnPageIndexChanging="dgvVertical_PageIndexChanging"
                                                                        PagerSettings-Mode="Numeric" PagerSettings-PageButtonCount="4">
                                                                        <PagerStyle CssClass="gridpager" HorizontalAlign="Left" />
                                                                        <RowStyle />
                                                                        <AlternatingRowStyle BackColor="#f9f9f9" />
                                                                        <PagerStyle CssClass="pager" />
                                                                        <HeaderStyle BackColor="#D6D5D6" />
                                                                        <EmptyDataTemplate>
                                                                            No Record Found
                                                                        </EmptyDataTemplate>
                                                                        <Columns>
                                                                            <asp:BoundField DataField="CourseId" HeaderText="Course Id" SortExpression="CourseId"
                                                                                HeaderStyle-CssClass="hideTemplateField" ItemStyle-CssClass="hideTemplateField"
                                                                                ControlStyle-CssClass="hideTemplateField" />
                                                                            <asp:BoundField DataField="RowNumber" HeaderText="Sr.No" SortExpression="CourseId"
                                                                                HeaderStyle-ForeColor="Black" />
                                                                            <asp:BoundField DataField="CourseName" HeaderText="Course Name" SortExpression="CourseName"
                                                                                HeaderStyle-ForeColor="Black" />
                                                                            <asp:BoundField DataField="Yearofcourse" HeaderText="Year Of The Course" SortExpression="Yearofcourse"
                                                                                HeaderStyle-ForeColor="Black" />
                                                                            <asp:BoundField DataField="SpecializationSubid" HeaderText="SpecializationSubid"
                                                                                SortExpression="SpecializationSubid" HeaderStyle-CssClass="hideTemplateField"
                                                                                ItemStyle-CssClass="hideTemplateField" ControlStyle-CssClass="hideTemplateField" />
                                                                            <%-- <asp:BoundField DataField="SpecializationSubid" HeaderText="Specialization Subject ID" SortExpression="SpecializationSubid" HeaderStyle-ForeColor="Black" />--%>
                                                                            <%--Commented by Shekhar 6/11/2013 to hide id on gridview page --%>
                                                                            <asp:BoundField DataField="specialSubject" HeaderText="Specialization Subject Name"
                                                                                SortExpression="specialSubject" HeaderStyle-ForeColor="Black" />
                                                                            <asp:BoundField DataField="courseCode" HeaderText="Course Code" SortExpression="courseCode"
                                                                                HeaderStyle-ForeColor="Black" Visible="false" />
                                                                            <asp:TemplateField HeaderText="Edit" Visible="false">
                                                                                <ItemTemplate>
                                                                                    <input id='btnEdit<%#Eval("CourseId") %>' type="image" title="Edit Course Details"
                                                                                        value="" class="icon-edit" onclick="DisplayVertical(this,'U','<%#Eval("CourseId") %>');"
                                                                                        style="width: 14px;" />
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="Delete">
                                                                                <ItemTemplate>
                                                                                    <input id='btnDelete<%#Eval("CourseId") %>' type="image" onclick="DeleteCourse(this,'<%#Eval("CourseId") %>','D');"
                                                                                        title="Delete Course Details" value="" class="icon-remove" style="width: 14px;" />
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                        </Columns>
                                                                    </asp:GridView>
                                                                    <table style="height: 15px; text-align: left; vertical-align: top; width: 200px;">
                                                                        <tr>
                                                                            <td style="width: 200px; height: 20px; text-align: center; vertical-align: middle;">
                                                                                <b><i>
                                                                                    <%=dgvVertical.PageIndex + 1%>
                                                                                    of
                                                                                    <%=dgvVertical.PageCount%></i></b>
                                                                            </td>
                                                                            <td style="width: 150px; height: 20px; text-align: center; vertical-align: middle;">
                                                                                <%--<input class="icon-pencil" id="btnAddNew" onmousemove="HighLight(this);" onmouseover="HighLight(this);"
                                                                        type="image" value="Add New" onclick="DisplayVertical(this,'I')"style="width: 14px;" />
                                                                                --%>
                                                                                <input type="image" class="icon-pencil" id="Image2" value="" onclick="DisplayVertical(this,'I')"
                                                                                    style="width: 15px;" />
                                                                                <asp:LinkButton ID="btnAddNew" Style="width: 20px;" Text="Add New" OnClientClick="DisplayVertical(this,'I')"
                                                                                    runat="server" />
                                                                            </td>
                                                                        </tr>
                                                                    </table>

Step 2: Bind data to grid Code on .cs page

private void BindGrid()
        {
         
            DataSet ds = GetCourseMaster();
                         
            try
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataView dv = ds.Tables[0].DefaultView;
                    if (ViewState["SortExp"] != null)
                    {
                        dv.Sort = this.ViewState["SortExp"].ToString() + " " + this.ViewState["SortOrder"].ToString();
                        dgvVertical.DataSource = dv.ToTable();
                        dgvVertical.DataBind();
                    }
                    else
                    {
                        dgvVertical.DataSource = ds;
                        dgvVertical.DataBind();
                    }
                }
                else
                {
                    dgvVertical.DataSource = null;
                    dgvVertical.DataBind();
                }
            }
            catch (Exception ex)
            {
                ErrorMessage(ex);
            }
        }

  public DataSet GetCourseMaster()
        {        
            string strQuery = @"SELECT  row_number() OVER (ORDER BY CourseMaster.CourseName) AS RowNumber,   CourseYear.Id AS CourseId, CourseMaster.CourseName, CourseYear.YearOfCourse,SubjectsMaster.SubjectName as specialSubject,
                      CourseYear.SpecializationSubId
FROM         CourseMaster INNER JOIN
                      CourseYear ON CourseMaster.CourseId = CourseYear.CourseId LEFT OUTER JOIN
                      SubjectsMaster ON CourseYear.SpecializationSubId = SubjectsMaster.Subjectid";
            using (SqlCommand cmd = GetCommand(strQuery, CommandType.Text))
            {
                ds = new DataSet();
                SqlDataAdapter SqlAdp = new SqlDataAdapter(cmd);
                SqlAdp.Fill(ds);
                DBhelper.Instance.CloseConnection(cmd);
            }
            return ds;

        }

public SqlCommand GetCommand(string spName, CommandType CommandType)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = spName;
            cmd.CommandType = CommandType;
            cmd.Connection = ConnectionString;
            return cmd;

        }

   public SqlConnection ConnectionString
        {
            get
            {

                _connectionString = new SqlConnection(Getconnect());
                _connectionString.Open();

                return _connectionString;
            }

        }

        public string Getconnect()
        {
            string connectionsring = ConfigurationManager.ConnectionStrings["Elearning"].ConnectionString;

            return connectionsring;

        }

Fill DropDown In ASP.NET

Step 1 : Create Function

       private void FillSubjects()
           {
               DataSet ds = new DataSet();
              ds = FillSubject();

              if (ds.Tables[0].Rows.Count > 0)
                {
                ddlsplsub.DataTextField = "SubjectName";
                ddlsplsub.DataValueField = "SubjectId";
                ddlsplsub.DataSource = ds;
                ddlsplsub.DataBind();

                 }
           }    

public DataSet FillSubject()
        {
            ds = new DataSet();
            try
            {
                ds = GetSubject();   //12/11/2013
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].NewRow();
                    dr["SubjectId"] = "0";
                    dr["SubjectName"] = "Select Subject";
                    ds.Tables[0].Rows.InsertAt(dr, 0);
                }
            }
            catch (Exception ex)
            {
                ds = null;
            }
            return ds;
        }


public DataSet GetSubject()
        {
            strQuery = "select  SubjectId,rtrim(SubjectName)  as SubjectName from SubjectsMaster order by subjectName asc";
            using (SqlCommand cmd = GetCommand(strQuery, CommandType.Text))
            {
                ds = new DataSet();
                SqlDataAdapter SqlAdp = new SqlDataAdapter(cmd);
                SqlAdp.Fill(ds);
                DBhelper.Instance.CloseConnection(cmd);
            }
            return ds;
        }

 public SqlCommand GetCommand(string spName, CommandType CommandType)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = spName;
            cmd.CommandType = CommandType;
            cmd.Connection = ConnectionString;
            return cmd;

        }

  public SqlConnection ConnectionString
        {
            get
            {

                _connectionString = new SqlConnection(Getconnect());
                _connectionString.Open();

                return _connectionString;
            }

        }

  public string Getconnect()
        {
            string connectionsring = ConfigurationManager.ConnectionStrings["Elearning"].ConnectionString;

            return connectionsring;

        }

Video Conferencing in ASP.NET with BigBlueButton

Step 1 : Visit https://code.google.com/p/bigbluebutton/wiki/BigBlueButtonVM Read All Instructions.

Step 2 : Please install VMware.

Step 3 : Below is the link where you'll find all the bbb-conf commands. You will need those while configuring the                BBB server. https://code.google.com/p/bigbluebutton/wiki/BBBConf

Step 4 : Download API or Project http://bigbluebutton.codeplex.com/releases/view/64151

Step 5 : If You are not able to figure out what it is then send me your mail id i will send you c# library

step 6 : Enter ServerIPAddress to ServerIPAddress.txt from VMWare Ip Address

Step 7 : Enter Salt id to ServerId.txt 

Step 8 : You will get these two IP Addresses bbb-conf commands  https://code.google.com/p/bigbluebutton/wiki/BBBConf         

Step 9 : UI Screen Show Below 

Step 10 : On Join Click Moderator i.e. admin will create meeting and join meeting and others can join it

Step 11 : Code On Join Button

 protected void btnJoin_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            ClsBigBlueButton ObjBigBlueButton = new ClsBigBlueButton();

            if (txtPwd.Text.ToUpper().Equals("MODERATOR"))
            {
                dt = ObjBigBlueButton.CreateMeeting("DemoClassroom", ddlClassrooms.Text, "student", "moderator");
                ObjBigBlueButton.JoinMeeting(txtUsername.Text, ddlClassrooms.Text, "moderator", true);
            }
            else
            {
                dt = ObjBigBlueButton.IsMeetingRunning(ddlClassrooms.Text);
                if (dt != null && dt.Rows[0][1].ToString().ToUpper().Equals("TRUE"))
                    ObjBigBlueButton.JoinMeeting(txtUsername.Text, ddlClassrooms.Text, txtPwd.Text, true);
                else
                    lblMsg.Text = "Classroom Unavailable!";
            }            
        }