Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strText As String = Server.UrlDecode(Request.QueryString("ImageText"))
Dim sf As StringFormat = New StringFormat()
sf.FormatFlags = StringFormatFlags.DirectionVertical
Dim f As System.Drawing.Font = New System.Drawing.Font("Tahoma", 8)
Dim gText As Graphics = Graphics.FromImage(New Bitmap(1000, 1000))
Dim imageSize As SizeF = gText.MeasureString(strText, f, 25, sf)
Dim i As Image = DirectCast(New Bitmap(CType(imageSize.Width, Integer), CType(imageSize.Height, Integer)), Image)
Dim g As Graphics = Graphics.FromImage(i)
g.FillRectangle(Brushes.White, 0, 0, i.Width, i.Height)
'//flip the image 90 degrees
g.TranslateTransform(i.Width, i.Height)
g.RotateTransform(90.0F)
g.DrawString(strText, f, Brushes.Black, 0, 0, sf)
Response.ContentType =
"image/JPEG" 'Tell browser, what we are sending
i.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg)
End Sub
I've done something similar in a page setting the src of an image control to a page that renders an image. My first attempts have not rendered corrrectly i'm just getting the missing image placeholder. Is it going to be possible to attempt this with the RadTabStrip or am I wasting my time? Perhaps I need to do something with the CSS for image sizing or something?
Cheers,
Rob.


This is very common in the old Radcontrols for ASP.NET...
1. In the master page
| <form id="form1" runat="server" style="height:100%"> |
| <telerik:RadScriptManager ID="MasterRadScriptManager" runat="server" EnableScriptCombine="true"></telerik:RadScriptManager> |
| <telerik:RadAjaxManager ID="MasterRadAjaxManager" runat="server" OnAjaxRequest ="MasterRadAjaxManager_AjaxRequest" EnablePageHeadUpdate="False"> |
| <AjaxSettings/> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| </form> |
| public RadAjaxManager RadAjaxManager |
| { |
| get |
| { |
| return this.MasterRadAjaxManager; |
| } |
| } |
| <asp:Content ID="CLP" ContentPlaceHolderID="MCPH" runat="server"> |
| <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_OnClick" /> |
| <asp:Label ID="lblClientScript" runat="server" Text=""></asp:Label> |
| </asp:Content> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| this.Master.RadAjaxManager.AjaxSettings.AddAjaxSetting(btnSave, lblClientScript); |
| this.Master.RadAjaxManager.AjaxSettings.AddAjaxSetting(this.Master.RadAjaxManager, lblClientScript); |
| } |
| protected void btnSave_OnClick(object sender, EventArgs e) |
| { |
| lblClientScript.Text = "alert('test "+ DateTime.Now.ToLongTimeString() +"');"; |
| } |
| protected void btnSave_OnClick(object sender, EventArgs e) |
| { |
| lblClientScript.Text = "updating "+ DateTime.Now.ToLongTimeString(); |
| } |
Hi,
I have referred to the below thread to develop file download with Ajax.
http://www.telerik.com/community/forums/aspnet/ajax/ajax-and-file-download.aspx
The steps are as below:
ajm.ResponseScripts.Add("SetContentPage('Download.aspx')");
3. Logic in Download.aspx.cs page processes and user is prompted to Open, Save, Cancel file download.
FileInfo fileInfo = new FileInfo(filepath);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content- Disposition", "attachment; filename=" + fileInfo.Name);
HttpContext.Current.Response.AddHeader("Content-Length", fileInfo.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.WriteFile(fileInfo.FullName);
4. Done.
The download function is working fine. However, Page is just reloaded instead of download for the first time due to IE download security block.
This can be solved by follow setting as below:
IE Tools -> Internet Options -> Security -> Internet -> Custom Level ->Downloads (Automatic prompting for file downloads) ->Enable.
Unfortunately, the above setting is not a good option. May I know is there any solution to solve the above issue by coding?
Thanks.
Regards,
Teik Ee