Thursday, 28 March 2013

How put multiple Parameter using Variable in IN Clause in Sql Server

declare @val varchar(20)
declare @sql nvarchar(200)
set @val = '''A'',''B'',''C''' --Your Prameter of Program

print @val

Set @sql='select * from SomeTable where name in ('+@val+')'
--Print @sql
exec sp_executesql @Sql -- Is used to Execute Sql query

Wednesday, 13 March 2013

How to Enable Disable control using JQuery

$('#<%=DdlLocation.ClientID%>').attr('disabled', 'disabled');

How to set Selected Value of Drop Down List in Using JQuery

1. )



$("#<%=DdlLocation.ClientID%> option[value='1' ] ").attr("selected","selected");


$("#<%=DdlLocation.ClientID%> option[text='c' ] ").attr("selected","selected");


Tuesday, 15 January 2013

How Server respond when AJAX Request to the Server While one AJAX Request in Progress

Note: In my past Experience i got the scenario when one AJAX server request in Process then other AJAX request is given to server. 

Now Question arise that what will happen in that case?

Ans :- In that Case 1st one request will stopped and 2nd Request will be initialized to server on that time.

You can check with Your Self with given below Steps:

Step 1: Make AJAX Web based project and put the given below Code in body Tag of Default.aspx file.

<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <asp:Button runat="server" Text="Button" ID ="Btn" OnClick="Btn_Click"/>
        <asp:Label runat="server" Text="Label" ID ="Lbl"></asp:Label>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <asp:Label runat="server" Text="Please Wait while work in Process......" ID="Lbl2"></asp:Label>

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <asp:Button runat="server" Text="Button" ID ="Button1" OnClick="Button1_Click"/>
        <asp:Label runat="server" Text="Label" ID ="Label1"></asp:Label>
        <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
            <asp:Label ID="Label2" runat="server" Text="Please Wait while work 2 in Process......"></asp:Label>

And put the given below code in Default.cs File.

protected void Btn_Click(object sender, EventArgs e)
        Lbl.Text = "This is First Ajax";
    protected void Button1_Click(object sender, EventArgs e)
        Label1.Text = "This is Second Ajax";
  • First Button Click Response with Update Progress


  • On the Same time Click on Second Button then First one is Stopped and Second Request is initialized see below output Screen shot: