Translate

Wednesday, 19 March 2014

Ajax:FilteredTextBoxExtender

 <table width="400">        <tr>            <td>                <asp:Label ID="label1" runat="server" Text="Only Numbers" Width="150"></asp:Label>                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>                <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TextBox1" FilterType="Numbers" />            </td>        </tr>        <tr>            <td>                <asp:Label ID="label2" runat="server" Text="Uppercase Letter" Width="150"></asp:Label>                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>                <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"TargetControlID="TextBox2" FilterType="UppercaseLetters" />            </td>        </tr>        <tr>            <td>                <asp:Label ID="label3" runat="server" Text="Lowercase Letters" Width="150"></asp:Label>                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>                <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server"TargetControlID="TextBox3" FilterType="lowercaseLetters" />            </td>        </tr>        <tr>            <td>                <asp:Label ID="label4" runat="server" Text="Custom numbers" Width="150"></asp:Label>                <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>                <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server"TargetControlID="TextBox4" FilterType="Custom, Numbers" ValidChars="+-=/*()." />            </td>        </tr>
         <tr>            <td>                <asp:Label ID="label4" runat="server" Text="Custom numbers" Width="150"></asp:Label>                <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>              <ajaxToolkit:FilteredTextBoxExtender ID="ftxtAcdD_MHTCET_Tot" runat="server" TargetControlID="txtbox1" FilterType="Custom" ValidChars="0123456789"/>            </td>        </tr>    </table>



Saturday, 8 March 2014

STUFF AND FOR XML PATH for String Concatenation



select distinct sno ,
STUFF((Select ','+Scity
from @Test T1
where T1.sno=T2.sno
FOR XML PATH('')),1,1,'') from @Test T2


Result:

Thursday, 6 March 2014

Error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

if application throw the following error,Place the script with in the body.


Error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). 

Maintain Scrollbar Position Inside UpdatePanel After Partial PostBack

<asp:ScriptManager ID="tsm" runat="server" ScriptMode="Release" />

            <script type="text/javascript">
             
                var xPos, yPos;
                var prm = Sys.WebForms.PageRequestManager.getInstance();
                function BeginRequestHandler(sender, args) {
                    if ($get('<%=Panel1.ClientID%>') != null) {
                        xPos = $get('<%=Panel1.ClientID %>').scrollLeft;
                        yPos = $get('<%=Panel1.ClientID %>').scrollTop;
                    }
                }

                function EndRequestHandler(sender, args) {
                    if ($get('<%=Panel1.ClientID%>') != null) {
                        $get('<%=Panel1.ClientID%>').scrollLeft = xPos;
                        $get('<%=Panel1.ClientID%>').scrollTop = yPos;

                    }
                }

                prm.add_beginRequest(BeginRequestHandler);
                prm.add_endRequest(EndRequestHandler);
            </script>

Reference:
http://basgun.wordpress.com/2008/06/09/maintain-scroll-position-updatepanel-postback/

Note:

if application throw the following error,Place the script with in the body.

Error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). 

Monday, 23 December 2013

ASP.net c# Avoid open the same window twice

http://blog.startq.com/index.php/2013/03/28/prevent-multiple-tabs-on-c-web-applications/

http://stackoverflow.com/questions/10336312/asp-net-c-sharp-avoid-open-the-same-window-twice

http://www.codeproject.com/Articles/35859/Detect-and-prevent-multiple-windows-or-tab-usage-i

 http://jinaldesai.net/stop-sharing-session-state-between-multiple-tabs-of-browser/

Window features in window.open()

The table below lists the string features you can pass into the "feature" parameter of window.open() to manipulate its interface. Most features support a value of true or false, though in general, simply including the name of the feature implies it should be added to the window (yes), while not including it means it shouldn't (no). Separate each feature with a comma (,).
Feature Description
channelmode Specifies if window should be opened in channel mode. IE only.
fullscreen Specifies if window should be opened in full screen mode. IE only.
height Specifies the height of the window.
left Specifies the x coordinates of the window in pixels. IE only. See "screenX" as well.
location Specifies if the location bar of the window should be included.
menubar Specifies if the menu bar of the window should be included.
resizable Specifies if window should be resizable.
screenX Specifies the x coordinates of the window in pixels. NS only. See "left" as well.
screenY Specifies the y coordinates of the window in pixels. NS only. See "top" as well.
scrollbars Specifies if window should contain scrollbars
status Specifies if the status bar of the window should be included
toolbar Specifies if the toolbar of the window (i.e., reload button) should be included.
top Specifies the y coordinates of the window in pixels. IE only. See "screenY" as well.
width Specifies the width of the window.

Sunday, 22 December 2013

Sql Query

/* Delete Duplicate records */
WITH CTE (COl1,Col2, DuplicateCount)
AS
(
SELECT COl1,Col2,
ROW_NUMBER() OVER(PARTITION BY COl1,Col2 ORDER BY Col1) AS DuplicateCount
FROM DuplicateRcordTable
)
DELETE
FROM
CTE
WHERE DuplicateCount > 1
GO

----------------------------------------------------------------------------------------


SQL SERVER – 2008 – 2005 – Rebuild Every Index of All Tables of Database – Rebuild Index with FillFactor

 DECLARE @TableName VARCHAR(255)
DECLARE @sql NVARCHAR(500)
DECLARE @fillfactor INT
SET
@fillfactor = 80
DECLARE TableCursor CURSOR FOR
SELECT
OBJECT_SCHEMA_NAME([object_id])+'.'+name AS TableName
FROM sys.tables
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
SET
@sql = 'ALTER INDEX ALL ON ' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')'
EXEC (@sql)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE
TableCursor
DEALLOCATE TableCursor
GO

-------------------------------------------------------------------------------------------
http://iis-7.blogspot.in/2012/09/iis-interview-questions.html
http://www.dotnetfunda.com/interviews/cat/122/iis
http://www.scribd.com/doc/94909071/IIS-Interview-Questions-and-Answers
http://www.iis.net/learn/web-hosting/frequently-asked-questions-%28faq%29/general-iis7-questions