In the sample online scenario "RadGrid bound to WCF Web Service" the sample code binds to a WCF method. The sample client settings are below (I copied them straight from the sample code)
<ClientSettings>
<DataBinding SelectMethod="GetDataAndCount" Location="GridWcfService.svc"
SortParameterType="Linq" FilterParameterType="Linq">
</DataBinding>
</ClientSettings>
Now if the endpoint (which GetDataAndCount() belongs) requires message level encryption how do I provide credentials as part of the client call?
For instance in the code behind the following is how I would have performed this on the server side...
MySampleClient ac = new MySampleClient("SampleEndpointWSHttpBinding");
ac.ClientCredentials.UserName.UserName = Session["Username"].ToString();
ac.ClientCredentials.UserName.Password = Session["Password"].ToString();
List<DataPoints> dp = ac.GetDataAndCount(...);
So how do you do this on the client side. Any help appreciated
| var oWin = radopen("Report.aspx?r_Key=1", null); |
| // this could be browser specific... |
| oWin.setSize(document.body.clientWidth, document.body.clientHeight -100); |
| oWin.moveTo(0, 100); |
| oWin.set_behaviors( Telerik.Web.UI.WindowBehaviors.Resize + |
| Telerik.Web.UI.WindowBehaviors.Minimize + |
| Telerik.Web.UI.WindowBehaviors.Close + |
| Telerik.Web.UI.WindowBehaviors.Maximize + |
| Telerik.Web.UI.WindowBehaviors.Move ); |
| <table cellpadding="0" cellspacing="0"> |
| <tr> |
| <td align="left" valign="top"> |
| <telerik:RadUpload ID="ruAttachment" runat="server" OverwriteExistingFiles="True" |
| AllowedFileExtensions=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.pdf,.mov,.wmv,.mpg,.avi,.wma,.mp3,.jpg,.gif,.png,.bmp" |
| Width="300px" MaxFileInputsCount="1" ReadOnlyFileInputs="True" ControlObjectsVisibility="None" |
| EnableEmbeddedSkins="False" Skin="Vinsume" MaxFileSize="2147483647" /> |
| <telerik:RadProgressArea runat="server" ID="rpaAttachment" OnClientProgressUpdating="checkUploadedFilesSize" |
| Language=""> |
| <Localization Uploaded="Uploaded"></Localization> |
| </telerik:RadProgressArea> |
| <telerik:RadProgressManager runat="server" ID="rpmAttachment" /> |
| </td> |
| </tr> |
| </table> |
| <script language="javascript" type="text/javascript"> |
| function checkUploadedFilesSize(progressArea, args) { |
| alert("fgdfgdf"); |
| //progressArea.confirmed is a custom variable, |
| // you can use another if you want to |
| if (!progressArea.confirmed && |
| args.get_progressData().RadUpload.RequestSize > 1000000) { |
| if (confirm("The total size of the selected files" + |
| " is more than the limit." + |
| " Do you want to cancel the upload?")) { |
| progressArea.cancelRequest(); |
| } |
| else { |
| progressArea.confirmed = "confirmed"; |
| } |
| } |
| } |
| </script> |