Feb 16, 2004

Value formatting in DataGrid By Niladri


<%# DataBinder.Eval(Container.DataItem, "DateOfCreation","{0:d}")%>
<%# DataBinder.Eval(Container.DataItem, "number","{0:#,#####}")%>

Handle dynamic image loading errors



HTML Editor Code function doBold(item)
{
var obj = document.getElementById(item);
obj.focus();
document.execCommand('Bold', false, null);

}

function doItalic(item)
{
var obj = document.getElementById(item);
obj.focus();
document.execCommand('italic', false, null);
}

function doUnderline(item)
{
var obj = document.getElementById(item);
obj.focus();
document.execCommand('underline', false, null);
}

function doLeft(item)
{
var obj = document.getElementById(item);
obj.focus();
document.execCommand('justifyleft', false, null);
}

function doCenter(item)
{
var obj = document.getElementById(item);
obj.focus();
document.execCommand('justifycenter', false, null);
}

function doRight(item)
{
var obj = document.getElementById(item);
obj.focus();
document.execCommand('justifyright', false, null);
}

function doFont(item)
{
var fName = item.options[item.selectedIndex].value;
if(fName != '')
item.document.execCommand('FontName', false, fName);
}

function FormatTypeFace(item)
{
var obj = document.getElementById(item);
obj.focus();
var oSource = window.event.srcElement;
document.execCommand("FontName", false, oSource.options[oSource.selectedIndex].value);
}

function doSize(item1,item2)
{
var obj = document.getElementById(item2);
obj.focus();
var fSize = item1.options[item1.selectedIndex].value;
if( fSize != '' )
item.document.execCommand('FontSize', false, fSize);
}


//The HTML code to call
//Here in the Div by making it contentEditable= true u can make the div act like a TextBox







How to Perform SQL Server Row-by-Row Operations Without Cursors
ASP.Net samples, Asp.Net tutorials, download samples and examples

Feb 14, 2004

Public Function ParseGeneral(ByVal strInput As String)
Dim mstrfilePath As String = Server.MapPath("../../GeneralNameList.xml")
Dim Ds As DataSet = GetDataset(mstrfilePath)
dtReplaceGeneralWordList = Ds.Tables(0)

'Dim str1 As String = "BellSouth Inc Ltd. "
'Dim str2 As String = "Bell South Inc Ltd. "
Dim arrInitial As New ArrayList()
Dim arr As New ArrayList()
'arrInitial.Add(str1)
'arrInitial.Add(str2)
arrInitial.Add(strInput)

Dim strSentence As String = ""
Dim i As Integer

Dim dr As DataRow

For i = 0 To arrInitial.Count - 1
strSentence = arrInitial(i).ToString()

For Each dr In dtReplaceGeneralWordList.Rows

If strSentence.IndexOf((" " + dr(1).ToString().ToUpper() + " ")) > -1 Then

Dim index As String = dr(0).ToString()

Dim dr1 As DataRow
For Each dr1 In dtReplaceGeneralWordList.Rows

If dr1(0).ToString() = index Then

Dim strTemp As String = strSentence.Replace(" " + dr(1).ToString().ToUpper() + " ", " " + dr1(1).ToString().ToUpper() + " ")

arr.Add(strTemp)
End If
Next dr1
End If
Next dr
Next i

For Each dr In dtReplaceGeneralWordList.Rows

For i = 0 To arr.Count - 1

Dim str As String = arr(i).ToString()
If str.IndexOf((" " + dr(1).ToString().ToUpper() + " ")) > -1 Then

Dim index As String = dr(0).ToString()

Dim dr1 As DataRow
For Each dr1 In dtReplaceGeneralWordList.Rows

If dr1(0).ToString() = index Then

Dim strTemp As String = str.Replace(" " + dr(1).ToString().ToUpper() + " ", " " + dr1(1).ToString().ToUpper() + " ")

If Not arrFinal.Contains(strTemp.Trim()) Then
arrFinal.Add(strTemp.Trim())
End If
End If
Next dr1
End If
Next i
Next dr

End Function
Public Function ParseGeneral(ByVal strInput As String)
Dim mstrfilePath As String = Server.MapPath("../../GeneralNameList.xml")
Dim Ds As DataSet = GetDataset(mstrfilePath)
dtReplaceGeneralWordList = Ds.Tables(0)

'Dim str1 As String = "BellSouth Inc Ltd. "
'Dim str2 As String = "Bell South Inc Ltd. "
Dim arrInitial As New ArrayList()
Dim arr As New ArrayList()
'arrInitial.Add(str1)
'arrInitial.Add(str2)
arrInitial.Add(strInput)

Dim strSentence As String = ""
Dim i As Integer

Dim dr As DataRow

For i = 0 To arrInitial.Count - 1
strSentence = arrInitial(i).ToString()

For Each dr In dtReplaceGeneralWordList.Rows

If strSentence.IndexOf((" " + dr(1).ToString().ToUpper() + " ")) > -1 Then

Dim index As String = dr(0).ToString()

Dim dr1 As DataRow
For Each dr1 In dtReplaceGeneralWordList.Rows

If dr1(0).ToString() = index Then

Dim strTemp As String = strSentence.Replace(" " + dr(1).ToString().ToUpper() + " ", " " + dr1(1).ToString().ToUpper() + " ")

arr.Add(strTemp)
End If
Next dr1
End If
Next dr
Next i

For Each dr In dtReplaceGeneralWordList.Rows

For i = 0 To arr.Count - 1

Dim str As String = arr(i).ToString()
If str.IndexOf((" " + dr(1).ToString().ToUpper() + " ")) > -1 Then

Dim index As String = dr(0).ToString()

Dim dr1 As DataRow
For Each dr1 In dtReplaceGeneralWordList.Rows

If dr1(0).ToString() = index Then

Dim strTemp As String = str.Replace(" " + dr(1).ToString().ToUpper() + " ", " " + dr1(1).ToString().ToUpper() + " ")

If Not arrFinal.Contains(strTemp.Trim()) Then
arrFinal.Add(strTemp.Trim())
End If
End If
Next dr1
End If
Next i
Next dr

End Function
Google Search: asp.net viewstate vs session