web stats analysis

Archive for August 13th, 2013

How to create dynamic div tag using javascript?

Creating dynamic div tag using javascript.

I had a simple solution:

Following will create a div dynamiclly

document.createElement(“div”);

It will Removes a child node from the DOM. Returns removed node.

var oldChild = element.removeChild(child);
element.removeChild(child);

Javascript Create New Div HTML Element Dynamically,JS adding dynamic div tag,
Show/Hide HTML div tags using JavaScript,Create Dynamic Div tag.

How to Use control.bringtofront in web pages?

Use control.bringtofront in web pages

I try and get solution is below:

you can always use z-index CSS property[^] to set the required element in front of another element.
z-index is a CSS property that sets the stack order of specific elements.

Follow below CSS:


p {
position: relative;
z-index: -1;
}

Note:-z-index only works on elements that have a position value (e.g. position: relative;)

How to save the data of dynamically created textbox on clicking the save button in asp.net?

save the data of dynamically created textbox on clicking the save button

I try and get solution is below:

Declared at the top:


Dim WithEvents txt As TextBox

Then write the below code:


Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
txt = New TextBox
txt.Name = "tb1"
Controls.Add(txt)
End Sub

You can get the Text Of the textbox


Private Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click
Dim a As String = Me.Controls("tb1").Text
MessageBox.Show(a)
End Sub
Save and Retrieve Dynamic TextBox values,How can save the dynamically created textbox value in database
How to create dynamic controls and save the values,Dynamically creating rows of textboxes

How to collect loop through records in a dataset?

How to loop through records in a dataset

I try and get solution:

I have a one dataset and inside dataset have a some data.
I want to loop this dataset so I will insert one by one value in database.

Follow by below code:


If dataset.Tables(0).Rows.count <> 0 then
For i = 0 To dataset.Tables(0).Rows.Count - 1
'Do Something (insert)
Next
End If

How to use for loop in php wordpress?

Use for loop in php wordpress.

Following demo to use php in wordpress.


<?php
for ($i = 0; $i < 10; $i++)
{
echo '<div class="pin">

<a href="#" title="Photo number 1" pin_id="1">
<img alt="Photo number 1" src="photos/pic1.jpg">
</a>

</div>';
echo '<div class="pin">

<a href="#" title="Photo number 4">
<img alt="Photo number 4" src="photos/pic4.jpg">
</a>

</div>';
}
?>

The type or namespace name ‘SqlConnection’ could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlConnection’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlDataReader’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlCommand’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlDataAdapter’ could not be found
(are you missing a using directive or an assembly reference?)

I have a Solution Is Like Below.

When this type of any error occure,so you simply add below namespace.

add System.Data.SqlClient; namespace at the top of the class().

Hope your problem has been solved.

The type or namespace name ‘Bitmap’ could not be found.

The type or namespace name ‘Bitmap’ could not be found
(are you missing a using directive or an assembly reference?)

I have a Solution Is Like Below.

When this type of error occure,so you simply add below namespace.

use System.Drawing; namespace.

Hope your problem has been solved.

The name ‘Directory’ or ‘File’ does not exist in the current context

The name ‘Directory’ does not exist in the current context

The name ‘File’ does not exist in the current context

I have a Solution Is Like Below.

When this type of error occure,so you simply add below namespace.
you use System.IO; namespace at the top of the class().
And also with other namespace declarations.

Hope your problem has been solved.

How to set ckeditor in wordpress?

How to add ckeditor in WordPress??

How to insert ckeditor in WordPress?

I had find the simple Solution is below:

Step:1-Go to the plugin option in your wordpress-admin.
Step:2-Then select Add New
Step:3-Now,search the ckeditor plugin.
Step:4-Install the ckeditor plugin.
Step:5-Then Active your installed ckeditor plugin.

Hope your plugin has been successfully install.

Then add the following ckeditor code where you want:


<textarea id="editor1" name="editor1"><p>Initial value.</p></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1' );
</script>

Below the complete demo of ckeditor:


<html>
<head>
<title>Sample CKEditor Site</title>
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
</head>
<body>
<form method="post">
<p>
My Editor:<br />
<textarea id="editor1" name="editor1">&lt;p&gt;Initial value.&lt;/p&gt;</textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1' );
</script>
</p>
<p>
<input type="submit" />
</p>
</form>
</body>
</html>

How to convert text to integer in SQL?

In SQL, How to convert text to integer?

I have a Solution Is Like Below.

Using below function you can convert:

Using CAST or CONVERT function you can convert.

Syntex of CAST or CONVERT function.

Syntax for CAST:
CAST ( expression AS data_type [ (length ) ])
Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

Example

Use of CAST function to convert table column value in
select clause:

SELECT ProductName, UnitPrice, CAST(UnitPrice AS INT) AS AroundPrice
FROM Products

Output

ProductName UnitPrice AroundPrice
Konbu 6.00 6
Tofu 23.25 23
Genen Shouyu 15.50 16

Above example returns converted unitprice in an integer value named as AroundPrice of table products.