or
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frmCurrencies.aspx.vb" Inherits="BNBERP.frmCurrencies" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
</
telerik:RadWindowManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel2"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadToolBar1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadSplitter1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel2"
runat
=
"server"
Skin
=
"Default"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
//KeyDown for Alphabets
function KeyDownAlphabetsOnly(e) {
if (e.keyCode != 8 && e.keyCode != 32 && e.keyCode != 190) {
if (e.shiftKey) {
if (90 >= e.keyCode && e.keyCode >= 65) {
e.returnValue = true;
}
else {
e.returnValue = false;
}
}
else if (90 >= e.keyCode && e.keyCode >= 65) {
e.returnValue = true;
}
else {
e.returnValue = false;
}
}
else
e.returnValue = true;
}
//Keydown function for numbers only
function KeyDownForNumbersOnly(e) {
if (e.keyCode != 8) {
if (e.keyCode <
48
|| e.keyCode > 57)
return false;
else if (e.shiftKey == 1)
return false;
else
return true;
}
return true;
}
//KeyPress Function for Alphabets only
function AlphabetOnly(sender, eventArgs) {
var c = eventArgs.get_keyCode();
if ((c <
65
) ||
(c > 90 && c <
97
) ||
(c > 122))
eventArgs.set_cancel(true);
}
//KeyDown Function for Aplhanumeric fields
function KeyDownAlphaNumeric(e) {
if (e.keyCode != 8) {
if (e.shiftKey) {
if (90 >= e.keyCode && e.keyCode >= 65) {
e.returnValue = true;
}
else {
e.returnValue = false;
}
}
else if (90 >= e.keyCode && e.keyCode >= 65) {
e.returnValue = true;
}
else if (57 >= e.keyCode && e.keyCode >= 48) {
e.returnValue = true;
}
else {
e.returnValue = false;
}
}
else
e.returnValue = true;
}
//Validation Function
function OnClientClicking(sender, args) {
var button = sender.get_text();
//Closing the form
if (button == "Ok") {
//Cancel the PostBack and return
args.set_cancel(true);
//Obtain a reference to the parent window manager
var oManager = GetRadWindow().get_windowManager();
//Close the window
oManager.closeActiveWindow();
}
//Checking if any text is in the controls before closing the form on cancel event
if (button == "Cancel") {
var button1 = $find("<%= btnAdd.ClientID %>");
var txtCurrCode = $find("<%= txtCurrencyCode.ClientID %>");
var txtCurrName = $find("<%= txtCurrencyName.ClientID %>");
var txtNumericCode = $find("<%= txtNumericCode.ClientID %>");
debugger
//Check if any text is there in the controls
if (txtCurrCode.isEmpty() != true || txtCurrName.isEmpty() != true || txtNumericCode.isEmpty() != true) {
if (button1.get_text() == "Add" || button1.get_text() == "Update") {
if (!clickCalledAfterRadconfirm) {
args.set_cancel(true);
lastClickedItem = sender;
radconfirm("Any unsaved data will be lost. Do you wish to continue ?", CancelconfirmCallbackFunction, 330, 100, null, 'Currencies');
}
else {
//Cancel the PostBack and return
args.set_cancel(true);
//Obtain a reference to the parent window manager
var oManager = GetRadWindow().get_windowManager();
//Close the window
oManager.closeActiveWindow();
}
}
else {
//Cancel the PostBack and return
args.set_cancel(true);
//Obtain a reference to the parent window manager
var oManager = GetRadWindow().get_windowManager();
//Close the window
oManager.closeActiveWindow();
}
}
else {
//Cancel the PostBack and return
args.set_cancel(true);
//Obtain a reference to the parent window manager
var oManager = GetRadWindow().get_windowManager();
//Close the window
oManager.closeActiveWindow();
}
}
//Validation Starts here
if (button == "Add" || button == "Update") {
//Check for Currency Code empty
var txtCurrCode = $find("<%= txtCurrencyCode.ClientID %>");
if (txtCurrCode.isEmpty() == true) {
//Set the Focus
txtCurrCode.focus();
//Show the alert message
radalert('Please enter the Currency Code.', 330, 100, 'Currencies');
return false;
}
//Check for Currency Name empty
var txtCurrName = $find("<%= txtCurrencyName.ClientID %>");
if (txtCurrName.isEmpty() == true) {
//Show the alert message
radalert('Please enter the Currency Name.', 330, 100, 'Currencies');
return false;
//Set the Focus
txtCurrName.focus();
}
}
}
//Confirmation messagebox function
var lastClickedItem = null;
var clickCalledAfterRadconfirm = false;
function onClientButtonClicking(sender, args) {
//Confirmation Messagebox for Delete button
if (args.get_item().get_index() == "3") {
if (!clickCalledAfterRadconfirm) {
args.set_cancel(true);
lastClickedItem = args.get_item();
radconfirm("Are you sure you want to delete the currency?", confirmCallbackFunction,330, 100, null, 'Currencies');
}
}
//Confirmation Messagebox for Browse,Add,Search button
if (args.get_item().get_index() == "0" || args.get_item().get_index() == "1" || args.get_item().get_index() == "4" || args.get_item().get_index() == "5" || args.get_item().get_index() == "6" || args.get_item().get_index() == "7") {
var button = $find("<%= btnAdd.ClientID %>");
var txtCurrCode = $find("<%= txtCurrencyCode.ClientID %>");
var txtCurrName = $find("<%= txtCurrencyName.ClientID %>");
var txtNumericCode = $find("<%= txtNumericCode.ClientID %>");
//Check if any text is there in the controls
if (txtCurrCode.isEmpty() != true || txtCurrName.isEmpty() != true || txtNumericCode.isEmpty() != true) {
if (button.get_text() == "Add" || button.get_text() == "Update") {
if (!clickCalledAfterRadconfirm) {
args.set_cancel(true);
lastClickedItem = args.get_item();
radconfirm("Any unsaved data will be lost. Do you wish to continue ?", confirmCallbackFunction, 330, 100, null, 'Currencies');
}
}
}
}
}
//Call Back function for Confirmation Messagebox
function confirmCallbackFunction(args) {
if (args) {
clickCalledAfterRadconfirm = true;
lastClickedItem.click();
}
else
clickCalledAfterRadconfirm = false;
lastClickedItem = null;
}
//Call Back function for Cancel Confirmation Messagebox
function CancelconfirmCallbackFunction(args) {
if (args) {
clickCalledAfterRadconfirm = true;
//lastClickedItem.click();
//Obtain a reference to the parent window manager
var oManager = GetRadWindow().get_windowManager();
//Close the window
oManager.closeActiveWindow();
}
else
clickCalledAfterRadconfirm = false;
lastClickedItem = null;
}
//Get a reference to existing window
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadSplitter
runat
=
"Server"
ID
=
"RadSplitter1"
Width
=
"100%"
BorderSize
=
"0"
BorderStyle
=
"Inset"
PanesBorderSize
=
"1"
Orientation
=
"Horizontal"
VisibleDuringInit
=
"false"
>
<
telerik:RadPane
ID
=
"RadPane1"
runat
=
"server"
>
<%--<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
> --%>
<
telerik:RadToolBar
ID
=
"RadToolBar1"
runat
=
"server"
Width
=
"99%"
Height
=
"22px"
style
=
"position:absolute;top:1px; left:1px"
OnClientButtonClicking
=
"onClientButtonClicking"
>
<
Items
>
<
telerik:RadToolBarButton
ToolTip
=
"NEW"
ImageUrl
=
"../Images/add.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"SEARCH"
ImageUrl
=
"../Images/search16.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"EDIT"
ImageUrl
=
"../Images/edit.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"DELETE"
ImageUrl
=
"../Images/del.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"FIRST"
ImageUrl
=
"../Images/first16.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"PREVIOUS"
ImageUrl
=
"../Images/back16.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"NEXT"
ImageUrl
=
"../Images/play16.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"LAST"
ImageUrl
=
"../Images/last16.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"SAVE AS"
ImageUrl
=
"../Images/saveas.gif"
/>
<
telerik:RadToolBarButton
ToolTip
=
"BASE-DOCUMENT"
ImageUrl
=
"../Images/baseDoc.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"TARGET-DOCUMENT"
ImageUrl
=
"../Images/targetDoc.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"PRINT-PREVIEW"
ImageUrl
=
"../Images/print_preview.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"PRINT"
ImageUrl
=
"../Images/Printer.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"COPY-TO"
ImageUrl
=
"../Images/copyTo.png"
/>
<
telerik:RadToolBarButton
ToolTip
=
"COPY-FROM"
ImageUrl
=
"../Images/copyFrom.png"
/>
</
Items
>
</
telerik:RadToolBar
>
<
div
style
=
"margin-left:30px; margin-top:50px;font-size:11px;"
>
<
table
>
<
tr
>
<
td
width
=
"110px"
><
span
style
=
"color: #0F3789;"
>Currency Code</
span
> </
td
>
<
td
width
=
"250px"
>
<
telerik:RadTextBox
ID
=
"txtCurrencyCode"
runat
=
"server"
width
=
"200px"
MaxLength
=
"25"
onkeydown
=
"return KeyDownAlphaNumeric(event)"
></
telerik:RadTextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
><
span
style
=
"color: #0F3789;"
>Currency Name</
span
></
td
>
<
td
><
telerik:RadTextBox
ID
=
"txtCurrencyName"
runat
=
"server"
width
=
"200px"
MaxLength
=
"100"
>
<
ClientEvents
OnKeyPress
=
"AlphabetOnly"
/>
</
telerik:RadTextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
><
span
style
=
"color: #0F3789;"
>International Code</
span
></
td
>
<
td
><
telerik:RadTextBox
ID
=
"txtNumericCode"
runat
=
"server"
width
=
"200px"
MaxLength
=
"50"
onkeydown
=
"return KeyDownAlphaNumeric(event)"
/></
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadButton
ID
=
"btnAdd"
runat
=
"server"
Text
=
"Add"
OnClientClicking
=
"OnClientClicking"
Width
=
"50px"
>
</
telerik:RadButton
>
</
td
>
<
td
><
telerik:RadButton
ID
=
"btnCancel"
runat
=
"server"
Text
=
"Cancel"
OnClientClicking
=
"OnClientClicking"
Width
=
"50px"
>
</
telerik:RadButton
></
td
>
</
tr
>
</
table
>
</
div
>
<%--</
telerik:RadAjaxPanel
>--%>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
div
>
</
form
>
</
body
>
</
html
>
Imports
BNB.ELL
Imports
BNB.BLL
Imports
BNB.DAL
Public
Class
frmCurrencies
Inherits
System.Web.UI.Page
#Region "Variable Decleration"
''' <summary>
''' Entity Layer Object Initialisation
''' </summary>
''' <remarks></remarks>
Public
objELCurrencies
As
New
ELCurrencies
''' <summary>
''' Business Layer Object Initialisation
''' </summary>
''' <remarks></remarks>
Public
objBLCurrencies
As
New
BLCurrencies
''' <summary>
''' Data Layer Object Initialisation
''' </summary>
''' <remarks></remarks>
Public
objDLCurrencies
As
New
DLCurrencies
''' <summary>
''' Dataset to hold the browsing data
''' </summary>
''' <remarks></remarks>
Public
dsBrowse
As
DataSet
Public
rowNum
As
Integer
#End Region
#Region "Methods"
''' <summary>
''' This method is used to clear the controls
''' </summary>
''' <remarks></remarks>
Private
Sub
ClearControls()
txtCurrencyCode.Text =
""
txtCurrencyName.Text =
""
txtNumericCode.Text =
""
End
Sub
''' <summary>
''' This Method is used for enabling or disabling controls
''' </summary>
''' <param name="enabledisable">True:Enables the controls
''' False:Disables the controls</param>
''' <remarks>True:Enables the controls
''' False:Disables the controls</remarks>
Private
Sub
EnableDisableControls(
ByVal
enabledisable
As
Boolean
)
txtCurrencyCode.Enabled = enabledisable
txtCurrencyName.Enabled = enabledisable
txtNumericCode.Enabled = enabledisable
End
Sub
''' <summary>
''' This Method is used to set the form mode
''' </summary>
''' <param name="mode">0:New Mode
''' 1:Search Mode
''' 2:Browse Mode
''' 3:Edit Mode</param>
''' <remarks>Pass Integer Value</remarks>
Private
Sub
FormMode(
ByVal
mode
As
Integer
)
Select
Case
mode
Case
"0"
'Add Mode
'Disable New Record
RadToolBar1.Items(0).Enabled =
False
'Disable Save As
RadToolBar1.Items(8).Enabled =
False
'Disable Base Document
RadToolBar1.Items(9).Enabled =
False
'Disable Target Document
RadToolBar1.Items(10).Enabled =
False
'Disable Print Preview Document
RadToolBar1.Items(11).Enabled =
False
'Disable Print
RadToolBar1.Items(12).Enabled =
False
'Disable Copy To
RadToolBar1.Items(13).Enabled =
False
'Disable Copy From
RadToolBar1.Items(14).Enabled =
False
'Disable Delete
RadToolBar1.Items(3).Enabled =
False
'Disable Edit
RadToolBar1.Items(2).Enabled =
False
'Enable the Search
RadToolBar1.Items(1).Enabled =
True
'Change the button text to Add
btnAdd.Text =
"Add"
'Focus the Main Textbox
txtCurrencyCode.Focus()
Case
"1"
'Find Mode
'Disable the Search
RadToolBar1.Items(1).Enabled =
False
'Enable the New
RadToolBar1.Items(0).Enabled =
True
'Disable Save As
RadToolBar1.Items(8).Enabled =
False
'Disable Base Document
RadToolBar1.Items(9).Enabled =
False
'Disable Target Document
RadToolBar1.Items(10).Enabled =
False
'Disable Print Preview Document
RadToolBar1.Items(11).Enabled =
False
'Disable Print
RadToolBar1.Items(12).Enabled =
False
'Disable Copy To
RadToolBar1.Items(13).Enabled =
False
'Disable Copy From
RadToolBar1.Items(14).Enabled =
False
'Disable the Delete
RadToolBar1.Items(3).Enabled =
False
'Disable the Edit
RadToolBar1.Items(2).Enabled =
False
'Change the text to Search
btnAdd.Text =
"Search"
'Focus the Main Textbox
txtCurrencyCode.Focus()
Case
"2"
'Browse Mode
'Enable the New
RadToolBar1.Items(1).Enabled =
True
'Enable the Search
RadToolBar1.Items(0).Enabled =
True
'Enable the Edit
RadToolBar1.Items(2).Enabled =
True
'Enable the Save As
RadToolBar1.Items(8).Enabled =
True
'Disable Print Preview Document
RadToolBar1.Items(11).Enabled =
True
'Disable Print
RadToolBar1.Items(12).Enabled =
True
'Enable the Delete
RadToolBar1.Items(3).Enabled =
True
'Change the text to Ok
btnAdd.Text =
"Ok"
Case
"3"
'Edit Mode
'Disable Save As
RadToolBar1.Items(8).Enabled =
False
'Disable Base Document
RadToolBar1.Items(9).Enabled =
False
'Disable Target Document
RadToolBar1.Items(10).Enabled =
False
'Disable Print Preview Document
RadToolBar1.Items(11).Enabled =
False
'Disable Print
RadToolBar1.Items(12).Enabled =
False
'Disable Copy To
RadToolBar1.Items(13).Enabled =
False
'Disable Copy From
RadToolBar1.Items(14).Enabled =
False
'Disable the Delete
RadToolBar1.Items(3).Enabled =
False
'Disable the Edit
RadToolBar1.Items(2).Enabled =
False
'Change the text to Ok
btnAdd.Text =
"Update"
End
Select
End
Sub
#End Region
#Region "Properties"
#End Region
#Region "Events"
''' <summary>
''' Event for Page Load
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks>Page Initialisation Code</remarks>
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
If
Page.IsPostBack =
False
Then
Try
'Set the Form Mode to New
FormMode(0)
'Enable Controls
EnableDisableControls(
True
)
'Set the focus
txtCurrencyCode.Focus()
Catch
ex
As
Exception
Finally
End
Try
End
If
End
Sub
''' <summary>
''' ToolBar Event
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private
Sub
RadToolBar1_ButtonClick(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.RadToolBarEventArgs)
Handles
RadToolBar1.ButtonClick
Try
Select
Case
e.Item.Index
Case
"0"
'New Button
'Set The Form Mode
FormMode(0)
'Clear the controls
ClearControls()
'Enable Controls
EnableDisableControls(
True
)
'Set the focus
txtCurrencyCode.Focus()
Case
"1"
'Search Button
FormMode(1)
'Clear Controls
ClearControls()
'Enable Controls
EnableDisableControls(
True
)
'Set the Focus
txtCurrencyCode.Focus()
Case
"2"
'Edit Button
FormMode(3)
'Enable Controls
EnableDisableControls(
True
)
'Disable the Primary key field
txtCurrencyCode.Enabled =
False
'Set the Focus
txtCurrencyName.Focus()
Case
"3"
'Delete Button
' Call the Entity Layer
objELCurrencies.CurrencyCode = txtCurrencyCode.Text
'Call Business Layer Update Method
If
objBLCurrencies.Delete(objELCurrencies) =
True
Then
'Display the Message to user
Dim
radalertscript
As
String
=
"<script language='javascript'>function f(){radalert('Record Deleted Sucessfully', 330, 100,'Currencies'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>"
Page.ClientScript.RegisterStartupScript(
Me
.[
GetType
](),
"Deleteradalert"
, radalertscript)
'Set the Form mode to search
FormMode(1)
'Clear Controls
ClearControls()
'Enable Controls
EnableDisableControls(
True
)
'Set the Focus
txtCurrencyCode.Focus()
Else
End
If
Case
"4"
'First Record Browse button
'Enable Controls
EnableDisableControls(
True
)
'Intialise the DataSet
dsBrowse =
New
DataSet()
'get the data
dsBrowse = objDLCurrencies.GetAllData()
'Set the first record data
txtCurrencyCode.Text = dsBrowse.Tables(0).Rows(0)(0).ToString()
txtCurrencyName.Text = dsBrowse.Tables(0).Rows(0)(1).ToString()
txtNumericCode.Text = dsBrowse.Tables(0).Rows(0)(2).ToString()
'Set the form mode
FormMode(2)
'Disable the Controls
EnableDisableControls(
False
)
Case
"5"
'Previous record Browse button
'Intialise the DataSet
dsBrowse =
New
DataSet()
'get the data
dsBrowse = objDLCurrencies.GetPreviousRecord(txtCurrencyCode.Text)
txtCurrencyCode.Text = dsBrowse.Tables(0).Rows(dsBrowse.Tables(0).Rows.Count - 1)(0).ToString
txtCurrencyName.Text = dsBrowse.Tables(0).Rows(dsBrowse.Tables(0).Rows.Count - 1)(1).ToString
txtNumericCode.Text = dsBrowse.Tables(0).Rows(dsBrowse.Tables(0).Rows.Count - 1)(2).ToString
'Set the form mode
FormMode(2)
'Disable the Controls
EnableDisableControls(
False
)
Case
"6"
'Next record Browse button
'Intialise the DataSet
dsBrowse =
New
DataSet()
'get data
dsBrowse = objDLCurrencies.GetPreviousRecord(txtCurrencyCode.Text)
txtCurrencyCode.Text = dsBrowse.Tables(0).Rows(dsBrowse.Tables(0).Rows.Count - 1)(0).ToString
txtCurrencyName.Text = dsBrowse.Tables(0).Rows(dsBrowse.Tables(0).Rows.Count - 1)(1).ToString
txtNumericCode.Text = dsBrowse.Tables(0).Rows(dsBrowse.Tables(0).Rows.Count - 1)(2).ToString
'Set the form mode
FormMode(2)
'Disable the Controls
EnableDisableControls(
False
)
Case
"7"
'Last record Browse button
'row Number
Dim
rowNum
As
Integer
= 0
'Intialise the DataSet
dsBrowse =
New
DataSet()
'get the data
dsBrowse = objDLCurrencies.GetAllData()
rowNum = dsBrowse.Tables(0).Rows.Count - 1
'Set the last record data
txtCurrencyCode.Text = dsBrowse.Tables(0).Rows(rowNum)(0).ToString()
txtCurrencyName.Text = dsBrowse.Tables(0).Rows(rowNum)(1).ToString()
txtNumericCode.Text = dsBrowse.Tables(0).Rows(rowNum)(2).ToString()
'Set the form mode
FormMode(2)
'Disable the Controls
EnableDisableControls(
False
)
Case
"8"
'Save As
'Set the form mode to Add
FormMode(0)
'Enable the Controls
EnableDisableControls(
True
)
'Clear the Primary Key field and set focus
txtCurrencyCode.Text =
String
.Empty
txtCurrencyCode.Focus()
End
Select
Catch
ex
As
Exception
End
Try
End
Sub
#End Region
Private
Sub
btnAdd_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
btnAdd.Click
Try
Select
Case
btnAdd.Text
Case
"Add"
'Call the Entity Layer
objELCurrencies.CurrencyCode = txtCurrencyCode.Text
objELCurrencies.CurrencyName = txtCurrencyName.Text
objELCurrencies.CurrencyInternationalCode = txtNumericCode.Text
objELCurrencies.UserCode =
""
objELCurrencies.URI =
""
objELCurrencies.CreateDate = DateTime.Now
objELCurrencies.UpdateDate = DateTime.Now
'Call Business Layer Create Method
If
objBLCurrencies.Create(objELCurrencies) =
True
Then
'Display the Message to user
Dim
radalertscript
As
String
=
"<script language='javascript'>function f(){radalert('Record Saved Sucessfully', 330, 100,'Currencies'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>"
Page.ClientScript.RegisterStartupScript(
Me
.[
GetType
](),
"radalert"
, radalertscript)
'Clear the controls
ClearControls()
'Set the form mode
FormMode(0)
'set the form mode
txtCurrencyCode.Focus()
Else
End
If
Case
"Update"
'Call the Entity Layer
objELCurrencies.CurrencyCode = txtCurrencyCode.Text
objELCurrencies.CurrencyName = txtCurrencyName.Text
objELCurrencies.CurrencyInternationalCode = txtNumericCode.Text
objELCurrencies.UserCode =
""
objELCurrencies.URI =
""
objELCurrencies.CreateDate = DateTime.Now
objELCurrencies.UpdateDate = DateTime.Now
'Call Business Layer Update Method
If
objBLCurrencies.Update(objELCurrencies) =
True
Then
'Display the Message to user
Dim
radalertscript
As
String
=
"<script language='javascript'>function f(){radalert('Record Updated Sucessfully', 330, 100,'Currencies'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>"
Page.ClientScript.RegisterStartupScript(
Me
.[
GetType
](),
"Updateradalert"
, radalertscript)
'Set the Form Mode
FormMode(2)
'Disable Controls
EnableDisableControls(
False
)
Else
End
If
Case
"Ok"
Case
"Search"
If
txtCurrencyCode.Text <>
String
.Empty
Or
txtCurrencyName.Text <>
String
.Empty
Or
txtNumericCode.Text <>
String
.Empty
Then
'Intialise the DataSet
dsBrowse =
New
DataSet()
'get the data
dsBrowse = objDLCurrencies.SearchRecord(txtCurrencyCode.Text, txtCurrencyName.Text, txtNumericCode.Text)
'Set the first record data
txtCurrencyCode.Text = dsBrowse.Tables(0).Rows(0)(0).ToString()
txtCurrencyName.Text = dsBrowse.Tables(0).Rows(0)(1).ToString()
txtNumericCode.Text = dsBrowse.Tables(0).Rows(0)(2).ToString()
txtCurrencyCode.Enabled =
False
'Set the form mode
FormMode(2)
'Disable Controls
EnableDisableControls(
False
)
End
If
End
Select
Catch
ex
As
Exception
Finally
End
Try
End
Sub
End
Class
tabStrip.findTabByText(
'Child1'
).set_selected(
true
);
tabStrip.findTabByText(
'Parent4'
).set_selected(
true
);
tabStrip.findTabByText(
'Child1'
).set_selected(
true
);
<
location
path
=
"Pages/ManageCategories.aspx"
>
<
system.web
>
<
authorization
>
<
allow
roles
=
"IT Admin"
/>
<
deny
roles
=
"User"
/>
<
deny
roles
=
"Company Admin"
/>
<
deny
users
=
"?"
/>
<
deny
users
=
"*"
/>
</
authorization
>
</
system.web
>
</
location
>
<
siteMap
defaultProvider
=
"XmlSiteMapProvider"
enabled
=
"true"
>
<
providers
>
<
add
name
=
"XmlSiteMapProvider"
description
=
"Default SiteMap provider."
type
=
"TrimmedXmlSiteMapProvider "
siteMapFile
=
"Web.sitemap"
securityTrimmingEnabled
=
"true"
/>
</
providers
>
</
siteMap
>
public
override
bool
IsAccessibleToUser(HttpContext context, SiteMapNode node)
{
if
(node.Roles !=
null
&& node.Roles.Count > 0)
{
bool
ret =
false
;
// need to be atleast in one of the roles
foreach
(var item
in
node.Roles)
{
if
(System.Web.Security.Roles.IsUserInRole(item.ToString()))
{
ret =
true
;
}
}
return
ret;
}
else
{
return
true
;
}
}
<
telerik:RadSiteMapDataSource
ID
=
"SubMenuDatasource"
runat
=
"server"
ShowStartingNode
=
"False"
SiteMapProvider
=
"XmlSiteMapProvider"
StartingNodeOffset
=
"1"
/>
<
telerik:RadMenu
ID
=
"SubMenu12"
runat
=
"server"
EnableEmbeddedBaseStylesheet
=
"false"
Skin
=
"ChildMenu"
EnableEmbeddedSkins
=
"false"
DataSourceID
=
"SubMenuDatasource"
>
</
telerik:RadMenu
>
hi
I getting the following exceptions sometimes there is a new request to the server:
System.Web.HttpException (0x80004005): This is an invalid webresource request.
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at http://test.com:80/WebResource.axd?d=2GpuJsHz6f2MZvJGfqtMifySIIHrl4Fl6QhmfmHWNAle9eNy8spdiz4-9FiFaNKBKdTuA9ihLeft_btnBranch"%20class="btn"%20style="width:192px;"%20/>
تمامی%20حقوق%20این%20سایت%20محفوظ%20و%20متعلق%20به%20سامانه%20مدیریت%20تبلیغات%20اکسیر%20می%20باشد.//
System.Web.HttpException (0x80004005): The length of the query string for this request exceeds the configured maxQueryStringLength value.
at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at http://test.com:80/WebResource.axd?d=ReRJmqv0EMoIrhksHtAP9NaSkMSs8rUuezr1BVaN91
دریافت%20آگهیواریز%20به%20حساببرداشت%20از%20حسابپیام%20های%20دریافت%20شدهارسال%20پیام%20به%20سایتویرایش%20مشخصاتخروجاطلاعاتامروز:%20دوشنبه%201390.2.5تبلیغات%20امروز:تبلیغات%20دیروز:1,809%20نمایش0%20کلیک7,906%20نمایش329%20کلیکجزئیات%20بیشتر...دریافت%20آگهی
تمامی%20حقوق%20این%20سایت%20محفوظ%20و%20متعلق%20به%20سامانه%20مدیریت%20تبلیغات%20اکسیر%20می%20باشد.//
i use telerik.web.ui.dll v2011.1.315.40
and i put just this dll (telerik.web.ui.dll) in BIN folder
in client side I use windows 7 with IIS7 and I never get this exceptions, but when I publish my site on web host that installed on windows server 2003 with iis 6 i get this exceptions Regularly!
my web.config is:
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
system.web
>
<
machineKey
validationKey
=
"4E034E7E7D3A8BD7B883864A59A1DCE0F0830BBB0A8EA155F5E3C43640F53EE78D1FD427F4C7A1FC88C273BD134A4A55F329EB552379EE45E74C5FA298CD270F"
decryptionKey
=
"6D01183050AEDE29C50CC073F906B4861CEEDDD1CB1EBBE31D04220359C6794C"
validation
=
"SHA1"
decryption
=
"AES"
/>
<
compilation
debug
=
"false"
defaultLanguage
=
"C#"
targetFramework
=
"4.0"
>
<
assemblies
>
<
add
assembly
=
"System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
assemblies
>
</
compilation
>
<
httpRuntime
maxRequestLength
=
"1024"
requestLengthDiskThreshold
=
"64"
requestValidationMode
=
"2.0"
/>
<
pages
controlRenderingCompatibilityVersion
=
"3.5"
clientIDMode
=
"AutoID"
>
<
controls
>
<
add
tagPrefix
=
"csm"
namespace
=
"customWebControls"
/>
<
add
tagPrefix
=
"tlk"
namespace
=
"Telerik.Web.UI"
assembly
=
"Telerik.Web.UI"
/>
</
controls
>
</
pages
>
<
httpHandlers
>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
validate
=
"false"
/>
</
httpHandlers
>
</
system.web
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
handlers
>
<
add
name
=
"Telerik_Web_UI_WebResource_axd"
verb
=
"*"
path
=
"Telerik.Web.UI.WebResource.axd"
preCondition
=
"integratedMode"
type
=
"Telerik.Web.UI.WebResource"
/>
</
handlers
>
</
system.webServer
>
</
configuration
>
<%@ Page Language="C#" %>
<!doctype html>
<
script
runat
=
"server"
>
protected void btnLogin_Click(object sender, EventArgs e)
{
if (txtUsername.Text == "1" && txtPassword.Text == "1")
mlvLogin.ActiveViewIndex = 1;
}
</
script
>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
>???</
title
>
</
head
>
<
body
>
<
form
id
=
"form"
runat
=
"server"
enctype
=
"multipart/form-data"
>
<
tlk:RadScriptManager
ID
=
"radScriptManager"
runat
=
"server"
/>
<
tlk:RadAjaxManager
ID
=
"radAjaxManager"
runat
=
"server"
DefaultLoadingPanelID
=
"radAjaxLoadingPanel"
>
<
AjaxSettings
>
<
tlk:AjaxSetting
AjaxControlID
=
"pnlLogin"
>
<
UpdatedControls
>
<
tlk:AjaxUpdatedControl
ControlID
=
"pnlLogin"
/>
</
UpdatedControls
>
</
tlk:AjaxSetting
>
</
AjaxSettings
>
</
tlk:RadAjaxManager
>
<
tlk:RadAjaxLoadingPanel
ID
=
"radAjaxLoadingPanel"
runat
=
"server"
InitialDelayTime
=
"500"
Skin
=
"Default"
>
</
tlk:RadAjaxLoadingPanel
>
<
div
>
<
asp:Panel
ID
=
"pnlLogin"
runat
=
"server"
DefaultButton
=
"btnLogin"
>
<
asp:MultiView
ID
=
"mlvLogin"
runat
=
"server"
ActiveViewIndex
=
"0"
>
<
asp:View
ID
=
"loginView"
runat
=
"server"
>
<
asp:Label
ID
=
"lblUsername"
runat
=
"server"
AssociatedControlID
=
"txtUsername"
Text
=
"username: "
/>
<
asp:TextBox
ID
=
"txtUsername"
runat
=
"server"
/><
br
/>
<
asp:Label
ID
=
"lblPassword"
runat
=
"server"
AssociatedControlID
=
"txtPassword"
Text
=
"password: "
/>
<
asp:TextBox
ID
=
"txtPassword"
runat
=
"server"
TextMode
=
"Password"
/><
br
/>
<
asp:Button
ID
=
"btnLogin"
runat
=
"server"
OnClick
=
"btnLogin_Click"
Text
=
"signin"
/>
</
asp:View
>
<
asp:View
ID
=
"linkListView"
runat
=
"server"
>
<
div
>Some code goes here!</
div
>
</
asp:View
>
</
asp:MultiView
>
</
asp:Panel
>
</
div
>
</
form
>
</
body
>
</
html
>
what can i do for solving this important issue?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MyRuntimeEditor.aspx.vb" Inherits="MyRuntimeEditor" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Namespace="MyCustomEditors" TagPrefix="mycustom" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
div
>
<
asp:Button
ID
=
"Button1"
Text
=
"Postback"
runat
=
"server"
/>
<
telerik:RadFilter
runat
=
"server"
OnFieldEditorCreating
=
"RadFilter1_FieldEditorCreating"
OnApplyExpressions
=
"RadFilter1_ApplyExpressions"
>
<
FieldEditors
>
<
mycustom:MyRadFilterDropDownEditor
DataTextField
=
"Text"
DataValueField
=
"Value"
FieldName
=
"USR_ID"
DataType
=
"System.Int32"
DisplayName
=
"User name"
DDLType
=
"Usernames"
/>
<
mycustom:MyRadFilterDropDownEditor
DataTextField
=
"Text"
DataValueField
=
"Value"
FieldName
=
"PNT_ID"
DataType
=
"System.Int32"
DisplayName
=
"Note"
DDLType
=
"PartyNotes"
/>
<
mycustom:MyRadFilterDropDownEditor
DataTextField
=
"Text"
DataValueField
=
"Value"
FieldName
=
"PGT_ID"
DataType
=
"System.Int32"
DisplayName
=
"Group"
DDLType
=
"PartyGroups"
/>
</
FieldEditors
>
</
telerik:RadFilter
>
Expression:
<
asp:Label
runat
=
"server"
ID
=
"Log"
/>
</
div
>
</
form
>
</
body
>
</
html
>
Imports
System
Imports
System.Collections.Generic
Imports
System.Linq
Imports
System.Web
Imports
System.Web.UI
Imports
System.Web.UI.WebControls
Imports
Telerik.Web.UI
Imports
CustomEditors
Imports
MyCustomEditors
Partial
Class
MyRuntimeEditor
Inherits
System.Web.UI.Page
Protected
Sub
RadFilter1_ApplyExpressions(
ByVal
sender
As
Object
,
ByVal
e
As
RadFilterApplyExpressionsEventArgs)
Dim
provider
As
New
RadFilterSqlQueryProvider()
provider.ProcessGroup(e.ExpressionRoot)
Log.Text = provider.Result
End
Sub
Protected
Sub
RadFilter1_FieldEditorCreating(
ByVal
sender
As
Object
,
ByVal
e
As
RadFilterFieldEditorCreatingEventArgs)
e.Editor =
New
MyRadFilterDropDownEditor()
End
Sub
End
Class
Imports
System
Imports
System.Collections.Generic
Imports
System.Linq
Imports
System.Web
Imports
Telerik.Web.UI
Imports
System.Web.UI
Imports
System.Collections
Namespace
CustomEditors
Public
Class
RadFilterDropDownEditor
Inherits
RadFilterDataFieldEditor
Public
Property
DataTextField()
As
String
Get
Return
If
(
DirectCast
(ViewState(
"DataTextField"
),
String
),
String
.Empty)
End
Get
Set
(
ByVal
value
As
String
)
ViewState(
"DataTextField"
) = value
End
Set
End
Property
Public
Property
DataValueField()
As
String
Get
Return
If
(
DirectCast
(ViewState(
"DataValueField"
),
String
),
String
.Empty)
End
Get
Set
(
ByVal
value
As
String
)
ViewState(
"DataValueField"
) = Value
End
Set
End
Property
Public
Property
DataSourceID()
As
String
Get
Return
If
(
DirectCast
(ViewState(
"DataSourceID"
),
String
),
String
.Empty)
End
Get
Set
(
ByVal
value
As
String
)
ViewState(
"DataSourceID"
) = Value
End
Set
End
Property
Private
_combo
As
RadComboBox
Protected
Overrides
Sub
CopySettings(
ByVal
baseEditor
As
RadFilterDataFieldEditor)
MyBase
.CopySettings(baseEditor)
Dim
editor
As
RadFilterDropDownEditor = TryCast(baseEditor, RadFilterDropDownEditor)
If
editor IsNot
Nothing
Then
DataSourceID = editor.DataSourceID
DataTextField = editor.DataTextField
DataValueField = editor.DataValueField
End
If
End
Sub
Public
Overrides
Function
ExtractValues()
As
System.Collections.ArrayList
Dim
list
As
New
ArrayList()
list.Add(_combo.SelectedValue)
Return
list
End
Function
Public
Overrides
Sub
InitializeEditor(container
As
System.Web.UI.Control)
_combo =
New
RadComboBox()
_combo.ID =
"MyCombo"
_combo.DataTextField = DataTextField
_combo.DataValueField = DataValueField
_combo.DataSourceID = DataSourceID
container.Controls.Add(_combo)
End
Sub
Public
Overrides
Sub
SetEditorValues(values
As
System.Collections.ArrayList)
If
values IsNot
Nothing
AndAlso
values.Count > 0
Then
If
values(0)
Is
Nothing
Then
Return
End
If
AddHandler
_combo.DataBound, _
Sub
(sender, args)
Dim
item
As
RadComboBoxItem = _combo.FindItemByValue(values(0).ToString())
If
item IsNot
Nothing
Then
item.Selected =
True
End
If
End
Sub
End
If
End
Sub
End
Class
End
Namespace
Imports
Microsoft.VisualBasic
Imports
System.Data
Public
Class
DataObject
Public
Function
GetUsers()
As
DataTable
Dim
dt
As
DataTable = CreateDataTable()
dt.Rows.Add(CreateDataRow(dt.NewRow(), 1,
"Joe One"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 2,
"Joe Two"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 3,
"Joe Three"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 4,
"Joe Four"
))
Return
dt
End
Function
Public
Function
GetNoteTypes()
As
DataTable
Dim
dt
As
DataTable = CreateDataTable()
dt.Rows.Add(CreateDataRow(dt.NewRow(), 1,
"Internal"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 2,
"Email"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 3,
"Phone"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 4,
"Sales Call"
))
Return
dt
End
Function
Public
Function
GetPartyGroups()
As
DataTable
Dim
dt
As
DataTable = CreateDataTable()
dt.Rows.Add(CreateDataRow(dt.NewRow(), 1,
"Internet Lead"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 2,
"Website"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 3,
"Cold calling"
))
dt.Rows.Add(CreateDataRow(dt.NewRow(), 4,
"Phoned in"
))
Return
dt
End
Function
Private
Function
CreateDataRow(
ByVal
r
As
DataRow,
ByVal
Value
As
Integer
,
ByVal
Text
As
String
)
As
DataRow
r(
"Value"
) = Value
r(
"Text"
) = Text
Return
r
End
Function
Private
Function
CreateDataTable()
As
DataTable
Dim
dt
As
New
DataTable
dt.Columns.Add(
"Value"
,
GetType
(
Integer
))
dt.Columns.Add(
"Text"
,
GetType
(
String
))
Return
dt
End
Function
End
Class