or
Dim stream As New System.IO.MemoryStream
Bmp1.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
Image1.DataValue = stream.GetBuffer()
Image1.DataBind()
public override IEnumerable<
ResourceType
> GetResourceTypes(RadScheduler owner)
{
ResourceType[] resourceTypes = new ResourceType[2];
resourceTypes[0] = new ResourceType("Teacher", false);
resourceTypes[1] = new ResourceType("Student", true);
return resourceTypes;
}
public override IEnumerable<
Resource
> GetResourcesByType(RadScheduler owner, string resourceType)
{
switch (resourceType)
{
case "Teacher" :
return Teachers.Values;
case "Student" :
return Students.Values;
default:
throw new InvalidOperationException( "Unknown resource type: " + resourceType);
}
}
private IDictionary<
int
, Resource> Teachers
{
get
{
if (_teachers == null)
{
_teachers = new Dictionary<
int
, Resource>();
foreach (Resource teacher in LoadTeachers())
{
_teachers.Add((int)teacher.Key, teacher);
}
}
return _teachers;
}
}
private IDictionary<
int
, Resource> Students
{
get
{
_students = new Dictionary<
int
, Resource>();
foreach (Resource student in LoadStudents())
{
_students.Add((int)student.Key, student);
}
return _students;
}
}
private IEnumerable<
Resource
> LoadTeachers()
{
List<
Resource
> resources = new List<
Resource
>();
using (DbConnection conn = OpenConnection())
{
DbCommand cmd = DbFactory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT [TeacherID], [Name], [Phone] FROM [DbProvider_Teachers]";
using (DbDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Resource res = new Resource();
res.Type = "Teacher";
res.Key = reader["TeacherID"];
res.Text = Convert.ToString(reader[ "Name" ]);
res.Attributes["Phone"] = Convert.ToString(reader["Phone"]);
resources.Add(res);
}
}
}
return resources;
}
private IEnumerable<
Resource
> LoadStudents()
{
List<
Resource
> resources = new List<
Resource
>();
using (DbConnection conn = OpenConnection())
{
DbCommand cmd = DbFactory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT [StudentID], [Name] FROM [DbProvider_Students]";
using (DbDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Resource res = new Resource();
res.Type = "Student";
res.Key = reader["StudentID"];
res.Text = Convert.ToString(reader[ "Name" ]);
resources.Add(res);
}
}
}
return resources;
}
<
asp:Content
ID
=
"Content3"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
<
telerik:RadAjaxManager
runat
=
"server"
id
=
"RadAjaxManager1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"pnlSearchBox"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"pnlSearchBox"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"pnlScheduler"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"pnlScheduler"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
id
=
"RadAjaxLoadingPanel1"
runat
=
"server"
transparency
=
"60"
Height
=
"950px"
backcolor
=
"White"
>
<
br
/><
br
/><
br
/><
br
/><
br
/><
br
/><
br
/>
<
asp:Image
ID
=
"loadingPicture"
runat
=
"server"
ImageUrl
=
"../App_Themes/myOBIS/picts/loading.gif"
/>
</
telerik:RadAjaxLoadingPanel
>
.
.
.
.
.
<
asp:Panel
ID
=
"pnlSearchBox"
runat
=
"server"
>
<
asp:Label
ID
=
"lblStandorte"
runat
=
"server"
Text="<%$ Resources:GlobalLocalization, Standort_%>" />
<
telerik:RadComboBox
ID
=
"rcbLocations"
runat
=
"server"
AutoPostBack
=
"true"
EnableEmbeddedSkins
=
"false"
Skin
=
"myOBIS"
DataTextField
=
"LocationName"
DataValueField
=
"LocationId"
CssClass
=
"field_long"
onselectedindexchanged
=
"Locations_SelectedIndexChange"
></
telerik:RadComboBox
>
<
asp:Label
ID
=
"lblProdukte"
runat
=
"server"
Text="<%$ Resources:GlobalLocalization, Produkt_%>" />
<
telerik:RadComboBox
ID
=
"rcbProducts"
runat
=
"server"
DataTextField
=
"InternalProductName"
DataValueField
=
"ProductId"
EnableEmbeddedSkins
=
"false"
Skin
=
"myOBIS"
CssClass
=
"field_long"
AutoPostBack
=
"true"
onselectedindexchanged
=
"Products_SelectedIndexChange"
></
telerik:RadComboBox
>
<
asp:Panel
/>
...
<
telerik:RadGrid
ID
=
"DistributorRadGrid"
runat
=
"server"
GridLines
=
"Both"
>
<
MasterTableView
EditMode
=
"InPlace"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
></
HeaderContextMenu
>
</
telerik:RadGrid
>
var varDistributors =
from d
in
MORContext.GetTable<Distributor>()
where (d.Active ==
true
&& d.Distributor_Type_id == 1 )
orderby d.Distributor_Name
select
new
{ Distributor_Name = d.Distributor_Name,
DistributorID = d.Destributor_ID };
Codes am using
<pages validateRequest="true"> |
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) |
Dim ex As Exception = Server.GetLastError().GetBaseException() |
If Not (ex.GetType Is GetType(HttpException)) Then |
If ex.Message.ToLower.Contains("a potentially dangerous request.form value was detected from the client") Then |
Try |
My.Log.WriteEntry("Global Error MESSAGE: " & ex.Message & "SOURCE: " & ex.Source & "STACKTRACE: " & ex.StackTrace, EventLogEntryType.Error) |
Catch ex1 As Exception |
My.Log.WriteEntry("Write event log got problem: " & ex1.Message, EventLogEntryType.Error) |
End Try |
Server.Transfer("~/UnsafeScriptErrorPage.aspx?returnURL=" & Server.UrlEncode(HttpContext.Current.Request.Url.ToString)) |
ElseIf ex.Message.Trim.ToString <> "" Then |
Try |
My.Log.WriteEntry("Global Error MESSAGE: " & ex.Message & "SOURCE: " & ex.Source & "STACKTRACE: " & ex.StackTrace, EventLogEntryType.Error, False) |
Catch ex1 As Exception |
My.Log.WriteEntry("Write event log got problem: " & ex1.Message, EventLogEntryType.Error) |
End Try |
Server.Transfer("~/GenericErrorPage.aspx?errMsg=" & ex.Message & "&returnURL=" & Server.UrlEncode(HttpContext.Current.Request.Url.ToString), False) |
End If |
End If |
Server.ClearError() |
End Sub |
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" |
CodeFile="Inbox.aspx.vb" Inherits="Inbox" Title="Inbox" %> |
<%@ Register assembly="RadAjax.Net2" namespace="Telerik.WebControls" tagprefix="radA" %> |
<%@ Register src="../datagridControl.ascx" tagname="datagridControl" tagprefix="uc1" %> |
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> |
<radA:RadAjaxPanel ID="RadAjaxPanelAppIn" runat="server" LoadingPanelID="AjaxLoadingPanelAppin" ClientEvents-OnRequestStart="pnlRequestStarted" |
Width="100%"> |
<table border="0" cellpadding="0" cellspacing="0" class="HeaderBg" width="100%"> |
<tbody> |
<tr> |
<td class="SideSpaceWidth"> |
</td> |
<td class="SideSpaceHeight"> |
<radA:AjaxLoadingPanel ID="AjaxLoadingPanelAppin" runat="server" IsSticky="True" |
MinDisplayTime="1000" Wrap="False"> |
<asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/images/indicator.gif" /> |
<strong>Loading Content ...</strong></radA:AjaxLoadingPanel> |
</td> |
<td class="SideSpaceWidth"> |
</td> |
</tr> |
<tr> |
<td > |
</td> |
<td> |
<uc1:datagridControl ID="DatagridControl1" runat="server" /> |
</td> |
<td> |
</td> |
</tr> |
<tr> |
<td> |
</td> |
<td class="SideSpaceHeight"> |
</td> |
<td> |
</td> |
</tr> |
</tbody> |
</table> |
</radA:RadAjaxPanel> |
</asp:Content> |
<radG:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowFilteringByColumn="False" |
AllowMultiRowSelection="false" AllowPaging="True" AllowSorting="True" BackColor="Transparent" |
DataSourceID="GridDataSource" EnableAJAX="false" EnableAJAXLoadingTemplate="false" |
EnableViewState="true" GridLines="None" LoadingTemplateTransparency="50" ShowGroupPanel="True" |
ShowStatusBar="False" AutoGenerateColumns="true" OnUpdateCommand="RadGrid1_UpdateCommand" |
SkinID="myGrid" OnColumnCreated="ColumnCheck" OnPreRender="ReduceFilter" Width="100%" |
OnItemDataBound="ColDatabind"> |
<MasterTableView DataSourceID="GridDataSource" GroupLoadMode="Client"> |
<Columns> |
<radG:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="~/Images/edit.gif" |
UniqueName="EditCommandColumn1" Resizable="False" Reorderable="False"> |
<HeaderStyle Width="15px" /> |
</radG:GridEditCommandColumn> |
<radG:GridTemplateColumn UniqueName="AssignUser" AllowFiltering="False" Reorderable="False" |
Groupable="False" Resizable="False" Visible="false"> |
<HeaderStyle Width="20px" /> |
<HeaderTemplate /> |
<ItemTemplate> |
<asp:ImageButton runat="Server" ID="ibtnAssignMsg" ImageUrl="~/images/Asgn.gif" CommandName="AssignMsgToUser" |
ToolTip="Assign SMS to User" Visible="false" /> |
</ItemTemplate> |
</radG:GridTemplateColumn> |
<radG:GridTemplateColumn UniqueName="myselect" AllowFiltering="False" Reorderable="False" |
Groupable="False" Resizable="False"> |
<HeaderStyle Width="20px" /> |
<HeaderTemplate> |
<asp:CheckBox ID="selectall" runat="Server" OnLoad="SelectAll" /> |
</HeaderTemplate> |
<ItemTemplate> |
<asp:CheckBox runat="Server" ID="myselect" OnLoad="ClearSAll" /> |
</ItemTemplate> |
</radG:GridTemplateColumn> |
</Columns> |
<EditFormSettings UserControlName="~/editform.ascx" EditFormType="WebUserControl" > |
<EditColumn UniqueName="EditCommandColumn"> |
</EditColumn> |
</EditFormSettings> |
<NoRecordsTemplate> |
<table width="100%"> |
<tr> |
<td align="center"> |
There are no items to display. Please check your selection criteria and retry. |
</td> |
</tr> |
</table> |
</NoRecordsTemplate> |
<FooterStyle Height="0px" /> |
<ExpandCollapseColumn Visible="False"> |
<HeaderStyle /> |
</ExpandCollapseColumn> |
<RowIndicatorColumn Visible="False"> |
<HeaderStyle /> |
</RowIndicatorColumn> |
</MasterTableView> |
<ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" AllowColumnsReorder="True" |
ColumnsReorderMethod="Reorder" ApplyStylesOnClient="True"> |
<Selecting AllowRowSelect="True" /> |
<Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True" /> |
</ClientSettings> |
</radG:RadGrid> |
<tr> |
<td nowrap="nowrap"> |
<asp:Label ID="Label3" runat="server" meta:resourcekey="Label3Resource2" Text="Recipient(s)"></asp:Label></td> |
<td> |
<asp:Label ID="Label5" runat="server" CssClass="tips" meta:resourcekey="Label5Resource1" |
Text="use ; to separate multiple numbers"></asp:Label> |
<asp:TextBox ID="txtRecipient" runat="server" Visible="False"></asp:TextBox><asp:RequiredFieldValidator |
ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtRecipient" |
ErrorMessage="RequiredFieldValidator" meta:resourcekey="ContactTextRequiredResource1" |
ToolTip="Mobile Number is required." ValidationGroup="SaveSMS">*</asp:RequiredFieldValidator> |
<asp:RegularExpressionValidator |
ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtRecipient" |
ErrorMessage="Please enter numbers only" meta:resourcekey="contactValidatorResource1" |
ValidationExpression="[0-9]+" ValidationGroup="SaveSMS"></asp:RegularExpressionValidator> |
<asp:HiddenField ID="OutlogID" runat="server" /> |
</td> |
</tr> |
<tr> |
<td> |
<asp:Label ID="Label2" runat="server" meta:resourcekey="Label2Resource2" Text="SMS Text"></asp:Label></td> |
<td> |
<asp:TextBox ID="txtSMS" runat="server" Columns="50" Rows="5" TextMode="MultiLine"></asp:TextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtSMS" |
ErrorMessage="RequiredFieldValidator" meta:resourcekey="RequiredFieldValidator2Resource1" |
ValidationGroup="QuickSMS">*</asp:RequiredFieldValidator></td> |
</tr> |
Microsoft JScript runtime error: Unexpected ajax response was received from the server.
This may be caused by one of the following reasons:
- Server.Transfer.
- Custom http handler.
- Incorrect loading of an "Ajaxified" user control
Verify that you don't get a server-side exception or any other undesired behavior, by setting the EnableAJAX property to false.
Any one Please help me in this issue. am waiting for your reply.