<
telerik:RadPageView
ID
=
"vXML"
runat
=
"server"
CssClass
=
"edit-area"
>
<
div
class
=
"padded-container"
>
<
asp:LinkButton
runat
=
"server"
EnableViewState
=
"false"
class
=
"padded-element-first"
OnClientClick
=
"clientButtonClicking();"
Text
=
"Download"
CommandName
=
"XML"
CausesValidation
=
"true"
ID
=
"btnExportXML"
OnCommand
=
"btnExport_Click"
/>
<
label
id
=
"btnImportXML"
class
=
"padded-element-last"
style="cursor: pointer; color: #0E3D4F;
text-decoration: underline; display: inline"
onclick
=
'toogleDisplays("btnImportXML","divUpldXML"); return false;'
>
Upload</
label
>
<
div
id
=
"divUpldXML"
style
=
"visibility: hidden; display: inline"
>
<
asp:FileUpload
CssClass
=
"padded-element-last"
EnableViewState
=
"false"
runat
=
"server"
ID
=
"upldXML"
/>
<
asp:RequiredFieldValidator
ValidationGroup
=
"grpInputs"
ID
=
"vldUpldXml"
ControlToValidate
=
"upldXML"
runat
=
"server"
ErrorMessage
=
"PlaceholderXML is required. Enter valid PlaceholderXML."
Text
=
"*"
/>
<
asp:RegularExpressionValidator
ValidationGroup
=
"grpInputs"
Enabled
=
"false"
ID
=
"vldRegExpUpldXml"
runat
=
"server"
ErrorMessage
=
".xml extension only"
ValidationExpression
=
"^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.xml|.XML)$"
ControlToValidate
=
"upldXML"
/>
</
div
>
</
div
>
<
tzgcontrols:XmlView
Style
=
"width: 97%; overflow: scroll; clip: auto; word-wrap: break-word;"
EnableViewState
=
"true"
ID
=
"ViewerXML"
runat
=
"server"
CssClass
=
"XmlFormat placeholder-box"
/>
</
telerik:RadPageView
>
<telerik:RadCodeBlock ID=
"RadCodeBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
RadAjax.OnStart(
{
btnExportXML: doNotUseAjax,
btnExportXSLT: doNotUseAjax,
btnExportXSD: doNotUseAjax
});
var
cancelAjax =
false
;
function
clientButtonClicking(sender, eventArgs) {
debugger;
if
(eventArgs.get_item().get_value() ==
"postback"
) {
cancelAjax =
true
;
}
}
function
onRequestStart(ajaxManager, eventArgs)
{
alert(cancelAjax);
alert(eventArgs.EventTarget);
if
((eventArgs.EventTarget ==
"btnExportXML"
) && (cancelAjax)) { alert(
'TEST'
); eventArgs.EnableAjax =
false
; }
if
((eventArgs.EventTarget ==
"btnExportXSD"
) && (cancelAjax)) { eventArgs.EnableAjax =
false
; }
//Uncomment the line below in case of a file download.
cancelAjax =
false
;
}
</script>
</telerik:RadCodeBlock>
public
static
void
DownloadFile(HttpResponse response, Constants.DownloadFileType type,
string
fileName,
byte
[] data)
{
using
(var trace =
new
TraceManager(
"Default"
))
{
try
{
response.Clear();
response.Buffer =
true
;
byte
[] storage = data;
switch
(type)
{
case
Constants.DownloadFileType.XML:
//document is xml
response.ContentType =
"application/xml"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename="
+ fileName +
".xml"
);
break
;
case
Constants.DownloadFileType.XSLT:
//document is xslt
response.ContentType =
"application/xml"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename="
+ fileName +
".xslt"
);
break
;
case
Constants.DownloadFileType.XSD:
//document is xslt
response.ContentType =
"application/xml"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename="
+ fileName +
".xsd"
);
break
;
case
Constants.DownloadFileType.DOCX:
response.ContentType =
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename="
+ fileName +
".docx"
);
break
;
case
Constants.DownloadFileType.EMAIL:
//document is email
response.ContentType =
"text/html"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename="
+ fileName +
".html"
);
break
;
default
:
//throw new Exception("Unknown Placeholder type specified.");
break
;
}
response.Cache.SetCacheability(HttpCacheability.NoCache);
response.BinaryWrite(storage);
//response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
catch
(Exception ex)
{
trace.HandleException(ex);
}
}
}
Please help to resolve this issue.
Hi,
We are facing problems with displaced RadGrid header pop-up menu on changing the zoom level of the IE browser.
If we change the IE browser’s zoom level to E.g. 200%, the RadGrid’s header menu (the pop-up on right click of the header) pop’s up away from its expected position and sometimes also goes off the screen. We expect the pop-up menu to pop-up right below the mouse pointer.
Also the header menu shows the correct text the first time, but goes blank the second time. Snapshots of these scenarios are attached along with.
Do you have a fix for the Grid Header pop-up menu to work as expected even after an IE zoom?
Hello,
I'm using a RadListView inside an UpdatePanel. When I click on a LinkButton and, from the code behind, it executes:
this.lstSkills.InsertItemPosition = RadListViewInsertItemPosition.LastItem;
this.btnShowSkillInsert.Visible = false;
function
Confirm(PageChange)
{
var
PageChangeValue=document.getElementById(PageChange).value;
if(PageChangeValue == 1)
{
if(confirm("WARNING: Any unsaved changes will be lost. Do you want to save your work? \n Press OK to stop and save (You must use the save button). \n Press Cancel to continue without saving.")== false)
{
document.getElementById(PageChange).value=0;
}
else
{
return false;
}
}
}
if the confirmation is ok then only it will go to next page.
but when i click on the next page, it fires the clientside script, opens the confirmation dialog box and didnt wait for the confirmation. automatically it goes to the next page.
both clientside and serverside pageindexchanged event fired simultanouesly.
before that in radgrid for asp.net control , this functionality works fine.
how to solve this issue.
thanks,