• Home
  • SQL Server
    • Articles
    • T-SQL Puzzles
    • Output Puzzles
    • Interview Questions
    • Performance Tuning
    • SQL SERVER On Linux
    • Resources
  • SSRS
    • SSRS Articles
    • Interview Questions
  • SSAS
    • SSAS Articles
    • DAX
  • SQL Puzzles
  • Interview Questions
    • SQL Interview Questions
    • Data Interview Questions
  • Python Interview Puzzles
  • New Features(SQL SERVER)
    • SQL SERVER 2017
    • SQL SERVER 2016
    • SQL SERVER On Linux
  • Social
    • Expert Exchange
      • Top Expert in SQL
      • Yearly Award
      • Certifications
      • Achievement List
      • Top Expert of the Week
    • HackerRank (SQL)
    • StackOverflow
    • About Me
      • Contact Me
      • Blog Rules

Improving my SQL BI Skills

Improving my SQL BI Skills

Category Archives: C#

C# related stuff

How to add events to a dynamically created Div’s in JavaScript ?

12 Sunday Sep 2010

Posted by Pawan Kumar Khowal in C#

≈ Leave a comment


How to add events to a dynamically created Div’s in JavaScript ?

Use the following JavaScript code

// If you are using Internet Explorer as your browser

divId.attachEvent(‘onclick’, clickEvent);
divId.attachEvent(‘onmousemove’, mousemoveEvent);

Note : divId would be Id of the dynamically added Div.

function clickEvent()
{
alert(“i am in click”);
}

function mousemoveEvent()
{
alert(“i am in mousemove”);
}

Enjoy…..

Saurabh D / Pawan Kumar
Pawankkmr@hotmail.com

20.000000 77.000000

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

MS

04 Saturday Sep 2010

Posted by Pawan Kumar Khowal in C#

≈ Leave a comment


Add in MS
 
if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
        {
            Request.Browser.Adapters.Clear();
        }
 
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="refresh" content="10" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>New Billing Application</title>
    <link href="Includes/CSS_Files/style.css" rel="stylesheet" type="text/css" />
    <link href="Includes/CSS_Files/Calendar.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scriptfiles/liberate.js"></script>
    <script type="text/javascript" src="../Includes/JS_Files/GeneralScript.js"></script>
    <script type="text/javascript" src="../Includes/JS_Files/Validation.js"></script>
    <link type="text/css" href="../Includes/CSS_Files/CalendarControl.css" rel="stylesheet" />
    <script type="text/javascript" src="../Includes/JS_Files/CalendarControl.js" language="javascript"></script>
    <script type="text/javascript">
 
            function noBack()
            {
                window.history.forward()}
                noBack();
                window.onload=noBack;
                window.onpageshow=function(evt){if(evt.persisted)noBack()}
                window.onunload=function(){void(0)
            }
            function ShowTime()
            {
                var dt = new Date();
                 document.getElementById("<%= txtDateTime.ClientID %>").value = dt.toLocaleDateString() + ‘ : ‘ + dt.toLocaleTimeString();
                 window.setTimeout("ShowTime()", 1000);
            }     
    </script>
 
<body onload="noBack();ShowTime();">

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

Alert Me

04 Saturday Sep 2010

Posted by Pawan Kumar Khowal in C#

≈ Leave a comment


 
.CommonMessageTitleRight
{
 BACKGROUND: url(../images/bg_heading.png) no-repeat 0px -70px; FLOAT: right;
   OVERFLOW: hidden; WIDTH: 5px; POSITION: relative; HEIGHT: 5px; _height: =1px
}
.CommonContent
{
 PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: =0px;
 OVERFLOW: hidden; PADDING-TOP: 0px; HEIGHT: 1%
}
.CommonMessageTitle
{
 BORDER-RIGHT: #000 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #000 0px solid;
 PADDING-LEFT: 8px; FONT-WEIGHT: bold; FONT-SIZE: 180%; PADDING-BOTTOM: 6px; MARGIN: 0px; BORDER-LEFT: #000 0px solid; COLOR: #000; PADDING-TOP: 6px; BORDER-BOTTOM: #000 1px solid; LETTER-SPACING: -1px; TEXT-ALIGN: left 
}
.CommonMessageArea
{
 MIN-HEIGHT: 1px; BACKGROUND: url(../images/bg_bucket.png) repeat-x 0px -44px; POSITION: relative; _height: 1px
}
.CommonMessageTop {
 BORDER-RIGHT: #9fbde5 2px solid; BACKGROUND: url(../images/bg_bucket.png)no-repeat; BORDER-LEFT: #9fbde5 2px solid; HEIGHT: 10px
}
.CommonMessageContent {
 BORDER-RIGHT: #9fbde5 2px solid; PADDING-RIGHT: 10px; PADDING-LEFT: 10px; MIN-HEIGHT: 1px; PADDING-BOTTOM: 0px; BORDER-LEFT: #9fbde5 2px solid; PADDING-TOP: 0px; POSITION: relative; _height: 1px
}
.CommonMessageBottom {
 BACKGROUND: url(../images/bg_bucket.png) no-repeat 0px -22px; MARGIN-BOTTOM: 4px; HEIGHT: 10px
}
.CommonContentArea {
 MARGIN: 2px 0px 0px
}

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

MessageBox

04 Saturday Sep 2010

Posted by Pawan Kumar Khowal in C#

≈ Leave a comment


/*Message Box*/
.info, .success, .warning, .error, .validation {
    border: 1px solid;
    margin: 10px 0px;
    background-repeat: no-repeat;
    background-position: 10px center;
}
.info {
    color: #00529B;
    background-color: #BDE5F8;
    background-image: url(‘../images/MessageImages/info.png’);
}
.success {
    color: #4F8A10;
    background-color: #DFF2BF;
    background-image:url(‘../images/MessageImages/success.png’);
}
.warning {
    color: #9F6000;
    background-color: #FEEFB3;
    background-image: url(‘../images/MessageImages/warning.png’);
}
.error {
    color: #D8000C;
    background-color: #FFBABA;
    background-image: url(‘../images/MessageImages/error.png’);
}
.info p, .success p, .warning p, .error p {
    padding: 0px 50px;
    text-align:center;
}
.info a, .success a, .warning a, .error a {
    float: right;
    cursor:pointer;
    padding-top:5px;
}
.messageheader
{
    background: url(../images/MessageImages/sprite.png) repeat-x 0px -200px;
    height:18px;
    padding:5px;
    border-bottom: solid 1px black;
}
.messageheadertext
{
    color: Black;
    float:left;
    font-weight:bold;
}
.messagefooter
{
    text-align:center;
    padding-top: 5px;
}
.messagemodalbackground
{
    background-color:Gray;
    /*filter:alpha(opacity=50); */
     /*opacity:0.6; */
    z-index:998;
}
/* validation */
.validation {
    color: #D8000C;
    background-color: #FFBABA;
    background-image: url(‘../images/MessageImages/error.png’);
}
.validation ul
{
 padding: 0px 30px;
}
  .hiddencol
    {
        display:none;
    }
    .viscol
    {
        display:block;
    }
 

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

Reading XML file from C# Code

28 Saturday Aug 2010

Posted by Pawan Kumar Khowal in C#

≈ Leave a comment


Reading XML file from C# code.

The following code will also help us in getting messages dynamically from XML file which we can use in our application.

First create Message.XML , an XML File

Record Inserted Successfully

Record Updated Successfully

Record Deleted Successfully

Error occur during Process

Now add a class file MessageCode.cs in App_Code folder of your project.

public class MessageCode
{
//Function to set message from XML file.
public string GetMessage(string MessageId)
{
XmlDocument xmlDoc;
XmlNode xmlNode;
String xpathExpr;
xmlDoc = new XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath(“../ReadXMLThroughASPX/Message.xml”)); //Load XML
xpathExpr = “/AemesssageList/Message[@id=’" + MessageId + "’]/DisplayMessage”; //Node Path
xmlNode = xmlDoc.SelectSingleNode(xpathExpr); //Get node by Message ID
return xmlNode.InnerText; //Get Node Text
}
}

Next step would be call the function on click event of a button.

protected void btnSubmit_Click(object sender, EventArgs e)
{
MessageCode messageCode = new MessageCode();
Response.Write(“Message : ” + messageCode.GetMessage(“3″));
}

Output : Message : Record Deleted Successfully

Write to me ( pawankkmr@gmail.com ) in case of any queries.

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email
← Older posts

Blog Stats

  • 1,085,263 hits

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 1,131 other subscribers

Pawan Khowal

502 SQL Puzzles with answers

Achievement - 500 PuzzlesJuly 18, 2018
The big day is here. Finally presented 500+ puzzles for SQL community.

200 SQL Server Puzzle with Answers

The Big DayAugust 19, 2016
The big day is here. Completed 200 SQL Puzzles today

Archives

March 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Oct    

Top Articles

  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…

Archives

  • October 2020 (29)
  • September 2018 (2)
  • August 2018 (6)
  • July 2018 (25)
  • June 2018 (22)
  • May 2018 (24)
  • April 2018 (33)
  • March 2018 (35)
  • February 2018 (53)
  • January 2018 (48)
  • December 2017 (32)
  • November 2017 (2)
  • October 2017 (20)
  • August 2017 (8)
  • June 2017 (2)
  • March 2017 (1)
  • February 2017 (18)
  • January 2017 (2)
  • December 2016 (5)
  • November 2016 (23)
  • October 2016 (2)
  • September 2016 (14)
  • August 2016 (6)
  • July 2016 (22)
  • June 2016 (27)
  • May 2016 (15)
  • April 2016 (7)
  • March 2016 (5)
  • February 2016 (7)
  • December 2015 (4)
  • October 2015 (23)
  • September 2015 (31)
  • August 2015 (14)
  • July 2015 (16)
  • June 2015 (29)
  • May 2015 (25)
  • April 2015 (44)
  • March 2015 (47)
  • November 2012 (1)
  • July 2012 (8)
  • September 2010 (26)
  • August 2010 (125)
  • July 2010 (2)

Article Categories

  • Analysis Services (6)
    • DAX (6)
  • Data (2)
    • Data warehousing (2)
  • Integration Services (2)
  • Magazines (3)
  • Python (29)
  • Reporting Services (4)
  • SQL SERVER (820)
    • Download SQL Interview Q's (212)
    • SQL Concepts (323)
    • SQL Performance Tuning (155)
    • SQL Puzzles (331)
    • SQL SERVER 2017 Linux (6)
    • SQL Server Interview Questions (308)
    • SQL SERVER Puzzles (332)
    • T SQL Puzzles (547)
    • Tricky SQL Queries (439)
  • UI (30)
    • ASP.NET (5)
    • C# (13)
    • CSS (9)
    • OOPS (3)
  • Uncategorized (5)

Recent Posts

  • Python | The Print and Divide Puzzle October 30, 2020
  • Python | Count consecutive 1’s from a list of 0’s and 1’s October 30, 2020
  • Python | How to convert a number into a list of its digits October 26, 2020
  • Python | Validate an IP Address-IPV6(Internet Protocol version 6) October 26, 2020
  • Python | Print the first non-recurring element in a list October 26, 2020
  • Python | Print the most recurring element in a list October 26, 2020
  • Python | Find the cumulative sum of elements in a list October 26, 2020
  • Python | Check a character is present in a string or not October 26, 2020
  • Python | Check whether a string is palindrome or not October 26, 2020
  • Python | Find the missing number in the array of Ints October 26, 2020
  • Python | How would you delete duplicates in a list October 26, 2020
  • Python | Check whether an array is Monotonic or not October 26, 2020
  • Python | Check whether a number is prime or not October 26, 2020
  • Python | Print list of prime numbers up to a number October 26, 2020
  • Python | Print elements from odd positions in a list October 26, 2020
  • Python | Print positions of a string present in another string October 26, 2020
  • Python | How to sort an array in ascending order October 26, 2020
  • Python | How to reverse an array October 26, 2020
  • Python | Find un-common words from two strings October 26, 2020
  • Python | How to convert a string to a list October 26, 2020
  • Python | Find unique words from a string October 26, 2020
  • Python | Calculate average word length from a string October 26, 2020
  • Python | Find common words from two strings October 26, 2020
  • Python | Find the number of times a substring present in a string October 26, 2020
  • Python | Find maximum value from a list October 26, 2020
  • Python | How to find GCF of two numbers October 26, 2020
  • Python | How to find LCM of two numbers October 26, 2020
  • Python | How to convert a list to a string October 26, 2020
  • Python | Replace NONE by its previous NON None value October 26, 2020
  • Microsoft SQL Server 2019 | Features added to SQL Server on Linux September 26, 2018

Create a website or blog at WordPress.com

  • Follow Following
    • Improving my SQL BI Skills
    • Join 231 other followers
    • Already have a WordPress.com account? Log in now.
    • Improving my SQL BI Skills
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar