| 1. Select File and then Page Setup | 2. Tick on Fit to page check box |
| 1. Select File and then Page Setup | 2. Tick on Fit to page check box |
| 1. Select File and then Page Setup | 2. Tick on Fit to page check box |
| 1. Select File and then Page Setup | 2. Tick on Fit to page check box |
| 1. Open Tools | 2. Select Advanced and under print options, tick on print background colors and images |
| 1. Select File then Page Setup | 2. Then tick print background colors and images |
| 1. Select File and then Page Setup | 2. Tick print background colors and images check box |
public class Thumbnail { public string Url { get; set; } public Bitmap ThumbnailImage { get; set; } public int Width { get; set; } public int Height { get; set; } public int BrowserWidth { get; set; } public int BrowserHeight { get; set; } public Thumbnail(string Url, int BrowserWidth, int BrowserHeight, int ThumbnailWidth, int ThumbnailHeight) { this.Url = Url; this.BrowserWidth = BrowserWidth; this.BrowserHeight = BrowserHeight; this.Height = ThumbnailHeight; this.Width = ThumbnailWidth; } public Bitmap GenerateThumbnail() { Thread thread = new Thread(new ThreadStart(GenerateThumbnailInteral)); thread.SetApartmentState(ApartmentState.STA); thread.Start(); thread.Join(); return ThumbnailImage; } private void GenerateThumbnailInteral() { WebBrowser webBrowser = new WebBrowser(); webBrowser.ScrollBarsEnabled = false; webBrowser.Navigate(this.Url); webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(WebBrowser_DocumentCompleted); while (webBrowser.ReadyState != WebBrowserReadyState.Complete) Application.DoEvents(); webBrowser.Dispose(); } private void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { WebBrowser webBrowser = (WebBrowser)sender; webBrowser.ClientSize = new Size(this.BrowserWidth, this.BrowserHeight); webBrowser.ScrollBarsEnabled = false; this.ThumbnailImage = new Bitmap(webBrowser.Bounds.Width, webBrowser.Bounds.Height); webBrowser.BringToFront(); webBrowser.DrawToBitmap(ThumbnailImage, webBrowser.Bounds); this.ThumbnailImage = (Bitmap)ThumbnailImage.GetThumbnailImage(Width, Height, null, IntPtr.Zero); } }Test Page:
<%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <script runat="server"> protected void CreateThumbnailImage(object sender, EventArgs e) { string url = string.Format("http://{0}", txtWebsiteAddress.Text); int width = Int32.Parse(txtWidth.Text); int height = Int32.Parse(txtHeight.Text); Thumbnail thumbnail = new Thumbnail(url, 800, 600, width, height); Bitmap image = thumbnail.GenerateThumbnail(); image.Save(Server.MapPath("~") + "/Thumbnail.bmp"); imgThumbnailImage.ImageUrl = "~/Thumbnail.bmp"; imgThumbnailImage.Visible = true; } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtWebsiteAddress" runat="server" Text="www.google.com" /> <asp:Button ID="btnCreateThumbnailImage" runat="server" Text="Create Thumbnail Image" OnClick="CreateThumbnailImage" /></td> <asp:TextBox ID="txtWidth" runat="server" Text="200" /> <asp:TextBox ID="txtHeight" runat="server" Text="200" /> <asp:Image ID="imgThumbnailImage" runat="server" Visible="false" /> </div> </form> </body> </html>
<%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <script runat="server"> public string RootUrl { get { Uri requestUri = Context.Request.Url; HttpRequest request = Context.Request; string rootUrl = string.Format("{0}{1}{2}{3}{4}", requestUri.Scheme, Uri.SchemeDelimiter, requestUri.Host, requestUri.IsDefaultPort ? string.Empty : string.Format(":{0}", requestUri.Port), request.ApplicationPath); return rootUrl.EndsWith("/") ? rootUrl : string.Format("{0}/", rootUrl); } } protected override void Render(HtmlTextWriter writer) { StringBuilder sb = new StringBuilder(); HtmlTextWriter htw = new HtmlTextWriter(new StringWriter(sb)); base.Render(htw); string html = sb.ToString(); string tag = "a"; List<string> tags = new List<string>(); int limit = 0, lb = 0, ub = 0; string startTag = string.Format("<{0}", tag); string endTag = string.Format(">", tag); string lHtml = html.ToLower(); do { lb = lHtml.IndexOf(startTag, limit); if (lb > 0) { limit = ub = lHtml.IndexOf(endTag, lb) + endTag.Length; tags.Add(html.Substring(lb, ub - lb)); } else limit = lb; } while (limit > 0); foreach (string a in tags) { string link = a.ToLower(); link = link.Replace("'", "\""); lb = link.IndexOf("href"); lb = link.IndexOf("\"", lb); ub = link.IndexOf("\"", lb + 1); string href = link.Substring(lb + 1, ub - (lb + 1)); if (href.StartsWith("http://") && !href.StartsWith(this.RootUrl.ToLower())) { link = link.Replace(href, string.Format("{0}StopUrl.aspx", this.RootUrl)); html = html.Replace(a, link); } } writer.Write(html); } </script> </head> <body> <form id="form1" runat="server"> <div> <a href="About.aspx">About</a> <a href="Default.aspx">Home</a> <a href="http://www.yahoo.com">Yhaoo</a> <a href="http://localhost/ActiveTest/Test.aspx">Test Page</a> </div> </form> </body> </html>
<%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <script runat="server"> public string Value { get { return (string)ViewState["Value"]; } set { ViewState["Value"] = value; } } protected override void LoadViewState(object savedState) { Response.Write("Load View State <br />"); base.LoadViewState(savedState); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); Response.Write("Page Load <br />"); } protected void Save(object sender, EventArgs e) { Response.Write("My Save Method - I didnt add anyting to View state <br />"); } protected override object SaveViewState() { Response.Write("Save View State <br />"); return base.SaveViewState(); } protected void Add(object sender, EventArgs e) { Response.Write(string.Format("My Add Method - I add some value to view state <strong>{0}</strong> <br />", string.IsNullOrEmpty(this.Value) ? "Next time page will load view sate" : string.Empty)); this.Value = DateTime.Now.ToShortTimeString(); } </script> </head> <body> <form id="form1" runat="server"> <div> <div id="ProductList"> <asp:Button runat="server" ID="btnSave" OnClick="Save" Text="Save" /> <asp:Button runat="server" ID="btnAdd" OnClick="Add" Text="Add" /> </div> </div> </form> </body> </html>
<%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>ClientScriptManager Example</title> <script type="text/javascript"> window.onbeforeunload = function (evt) { var message = 'Are you sure you want to leave?'; if (typeof evt == 'undefined') { evt = window.event; } if (evt) { evt.returnValue = message; } return message; } </script> </head> <body> <form id="Form1" runat="server"> <div> </div> </form> </body> </html>
<%@ Page Language="C#" CodeBehind="~/Test.aspx.cs" Inherits="ActiveTest.Test" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>ClientScriptManager Example</title> <script type="text/javascript"> var value1 = 0; var value2 = 0; function ReceiveServerData2(arg, context) { Message2.innerText = arg; value2 = arg; } function ProcessCallBackError(arg, context) { Message2.innerText = 'An error has occurred.'; } </script> </head> <body> <form id="Form1" runat="server"> <div> Callback 1 result: <span id="Message1">0</span> <br /> Callback 2 result: <span id="Message2">0</span> <br /> <br /> <input type="button" value="ClientCallBack1" onclick="CallTheServer1(value1, alert('Increment value'))" /> <input type="button" value="ClientCallBack2" onclick="CallTheServer2(value2, alert('Increment value'))" /> <br /> <br /> <asp:Label ID="lblMessage" runat="server"></asp:Label> </div> </form> </body> </html>Code Behind:
namespace ActiveTest { public partial class Test : Page, ICallbackEventHandler { #region Attributes public int callBackCount = 0; private string script = @" function ReceiveServerData1(arg, context) { Message1.innerText = arg; value1 = arg; } "; #endregion #region ICallbackEventHandler Members public void RaiseCallbackEvent(String eventArgument) { callBackCount = Convert.ToInt32(eventArgument) + 1; } public string GetCallbackResult() { return callBackCount.ToString(); } #endregion protected void Page_Load(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); sb.Append("No page postbacks have occurred."); if (Page.IsPostBack) { sb.Append("A page postback has occurred."); } this.lblMessage.Text = sb.ToString(); ClientScriptManager cs = Page.ClientScript; String cbReference1 = cs.GetCallbackEventReference(this, "arg", "ReceiveServerData1", this.script); String cbReference2 = cs.GetCallbackEventReference("'" + Page.UniqueID + "'", "arg", "ReceiveServerData2", "", "ProcessCallBackError", false); String callbackScript1 = "function CallTheServer1(arg, context) {" + cbReference1 + "; }"; String callbackScript2 = "function CallTheServer2(arg, context) {" + cbReference2 + "; }"; cs.RegisterClientScriptBlock(this.GetType(), "CallTheServer1", callbackScript1, true); cs.RegisterClientScriptBlock(this.GetType(), "CallTheServer2", callbackScript2, true); } } }
Line 34: <error statusCode="500" redirect="error.html"/> Line 35: </customErrors> Line 36: <pages pageBaseType="WebNamespace.PageBase" ...> Line 37: <controls> Line 38: <add tagPrefix="ajax" .../> |
<pages pageBaseType="WebApplication.PageBase, WebAssemblyName"...But still no luck, .net can’t distinguish the type in conflicting assemblies.
<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <script language="javascript"> function SayHello() { alert("Hello"); } </script> </head> <body> <form id="form1" runat="server"> <p>This is sample paragraph and this is my image <img src="Images/Picture.jpg" alt="Picture" /></p> </form> </body> </html>
<img src="Images/Picture.jpg" alt="Picture" />Please refer this article for more information
function SayHello() { alert("Hello"); }Please refer this article for more information
protected override void Render(HtmlTextWriter writer) { StringBuilder sb = new StringBuilder(); HtmlTextWriter htw = new HtmlTextWriter(new StringWriter(sb)); base.Render(htw); string html = sb.ToString(); string tag = "img"; List<string> tags = new List<string>(); int limit = 0, lb = 0, ub = 0; string startTag = string.Format("<{0}", tag); string endTag = string.Format(">", tag); string lHtml = html.ToLower(); do { lb = lHtml.IndexOf(startTag, limit); if (lb > 0) { limit = ub = lHtml.IndexOf(endTag, lb) + endTag.Length; tags.Add(html.Substring(lb, ub - lb)); } else limit = lb; } while (limit > 0); /// /// all the image tags are in tags list. /// writer.Write(html); }
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...