w.Content is undefined
[Break On This Error]
w.Content.Page.MarshalUploads();
Teleri...e2c54c1 (line 30193)
Unhandled Error
in
Silverlight Application Failed to Invoke: _onFilesSelected. at System.Windows.Browser.ScriptObject.Invoke(String name, Object[] args) at UploadPrototype.EventManager.FilesSelected(Int32 filesCount) at UploadPrototype.MainPage.OpenDialog() at UploadPrototype.MainPage.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ImageUploader.ascx.cs" Inherits="ArtsHub.Controls.ImageUploader" %>
<
telerik:RadAjaxPanel
ID
=
"rapImageUpload"
runat
=
"server"
LoadingPanelID
=
"alpLoadingPanel"
RenderMode
=
"Inline"
>
<
telerik:RadBinaryImage
ID
=
"imgMainImage"
runat
=
"server"
ResizeMode
=
"Fit"
/>
<
telerik:RadAsyncUpload
ID
=
"rauMainImage"
runat
=
"server"
InitialFileInputsCount
=
"1"
MaxFileInputsCount
=
"1"
OnFileUploaded
=
"rauMainImage_FileUploaded"
/>
</
telerik:RadAjaxPanel
>
<
telerik:RadAjaxLoadingPanel
ID
=
"alpLoadingPanel"
runat
=
"server"
/>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function <%= this.ClientID %>_ClientFileUploaded(sender, eventArgs) {
var rap = $find("<%= rapImageUpload.ClientID %>");
rap.ajaxRequest();
}
</
script
>
</
telerik:RadCodeBlock
>
public
partial
class
ImageUploader : System.Web.UI.UserControl
{
public
RadAsyncUpload UploaderControl {
get
{
return
rauMainImage; } }
public
RadBinaryImage BinaryImageControl {
get
{
return
imgMainImage; } }
public
Images.ImageFactory.ImageTypes ImageType {
get
;
set
; }
public
Globals.SectionIds SectionId {
get
;
set
; }
public
string
ImageURL {
get
;
set
; }
public
int
Width {
get
;
set
; }
public
int
Height {
get
;
set
; }
public
string
[] AllowedFileExtensions {
get
;
set
; }
protected
void
Page_Init(
object
sender, EventArgs e)
{
UploaderControl.OnClientFileUploaded =
this
.ClientID +
"_ClientFileUploaded"
;
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!Page.IsPostBack)
{
//rauMainImage.AllowedFileExtensions = AllowedFileExtensions;
}
// Get Preview Image
if
(imgMainImage.DataValue ==
null
&& ImageURL !=
""
&& ImageURL !=
null
)
{
imgMainImage.ImageUrl = ImageURL;
imgMainImage.Width = System.Web.UI.WebControls.Unit.Pixel(Width);
imgMainImage.Height = System.Web.UI.WebControls.Unit.Pixel(Height);
}
}
protected
void
rauMainImage_FileUploaded(
object
sender, FileUploadedEventArgs e)
{
try
{
if
(e.IsValid)
{
imgMainImage.Width = System.Web.UI.WebControls.Unit.Pixel(Width);
imgMainImage.Height = System.Web.UI.WebControls.Unit.Pixel(Height);
// Update preview
using
(Stream stream = e.File.InputStream)
{
byte
[] imageData =
new
byte
[stream.Length];
stream.Read(imageData, 0, (
int
)stream.Length);
imgMainImage.DataValue = imageData;
imgMainImage.AlternateText = e.File.FileName;
}
// Do upload
IListing thisItem;
switch
(SectionId)
{
case
Globals.SectionIds.News:
thisItem = ContentMain.GetContentMain(ContentMain.GetContentId);
break
;
case
Globals.SectionIds.Jobs:
thisItem = Job.GetJob(Job.GetJobId);
break
;
case
Globals.SectionIds.Classifieds:
thisItem =
null
;
break
;
case
Globals.SectionIds.Events:
thisItem =
null
;
break
;
case
Globals.SectionIds.MembersResumes:
thisItem = MemberResume.GetMemberResume(MemberResume.GetMemberResumeId,
null
,
true
);
break
;
case
Globals.SectionIds.Directory:
default
:
thisItem =
null
;
break
;
}
thisItem.UploadListingImage(e.File, ImageType);
}
}
catch
(Exception ex)
{
BLL.Emailing.Emailing.EmailBug(
"Error in ImageUploader.rauMainImage_FileUploaded!"
,
"Section"
+ SectionId.ToString() +
"<br>Error:"
+ ex.Message.ToString());
}
}
}
I want to read the Header text of child grid and then use it in displaying alert for specific row.
Below is my codeBehind Code:
Telerik.Web.UI.GridColumn col = null;
col = rgdLabTest.MasterTableView.DetailTables[0].Columns.FindByUniqueNameSafe("StartAge");
if (col != null)
{
StartAgeCaption = col.HeaderText;
}
And in javascript i am using:
if (document.getElementById(id) != null && document.getElementById(id).value == "") {
var control = $("#" + id + "_text");
var message = '<%=BariAnalyticsEHR.Utility.ContentFetcher.GetValidationMessage("MANDATORY_1", BariAnalyticsEHR.BOL.Classes.EHRSessions.Culture)%>';
jAlert(message.replace("#caption#", "<%= StartAgeCaption %>"), control[0].id, null, function (r) {
if (r == true) {
$("#" + control[0].id).focus();
}
});
return false;
}
StartAgeCaption value is assigend successfully in the codebehind but in javascript i am not getting that value. Its empty.