C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Browser problem(ie 8)


Posted Date: 04 Jul 2009      Posted By: gaurav tyagi      Member Level: Silver     Points: 1   Responses: 9



I have a small asp.net application which runs fine in IE 7 but when I run it in IE 8 ,then in place of rendering the contents on the page the inline code is displayed on the web page.Actually a hidden <pre>tag is automatically generated in the HTML body in IE8,which can be seen by pressing F12 button.This is causing the trouble.I also tried
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
but of no use.also i used the compatibility mode but in vain.Can I get some idea to rectify this critical problem






Responses

Author: Madeshwaran    04 Jul 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

Hi gourav,
Try this
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>

for more information you may check http://www.microsoft.com/windows/internet-explorer/readiness/developers-new.aspx



Author: gaurav tyagi    04 Jul 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

thanks buddy for the response.I tried this one also but it was not working.I am really stuck on this issue for the last few days.I dont know how to stop this <pre> tag


Author: monisha    04 Jul 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

send me generated HTML code.


Author: gaurav tyagi    04 Jul 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

fr


html.doc
Author: Madeshwaran    05 Jul 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

hi in your html file also i am not able find the <pre> tag you mentioned so i am not sure what <pre> tag you are talking about.

Moreover i am also using IE8 only and the html document you gave rendered me a crop button and a div with the inner html and an image.

So not clear what exactly your problem is.



Author: gaurav tyagi    05 Jul 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

thanks Madeshwaran for reply. I finally got the solution.Actually I commented the Response.ContentType line from my aspx.cs file.Its working now


Author: gaurav tyagi    10 Jul 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

lblResults.Text = "X: " + this._txtX.Value + ", Y: " + this._txtY.Value +" "+
"Width: " + this._txtWidth.Value + ", Height: " + this._txtHeight.Value;


int Tmpwidth = Convert.ToInt32(this._txtWidth.Value);
int TmpHeight = Convert.ToInt32(this._txtHeight.Value);

int _x = Convert.ToInt32(this._txtX.Value);
int _y = Convert.ToInt32(this._txtY.Value);

BaseDataDB tmpDB1 = new BaseDataDB();
BaseDataDB tmpDB2 = new BaseDataDB();
SqlDataReader tmpReader1 = null;
try
{
binaryID = Convert.ToInt32(Utility.GetFromtheContext("id"));

tmpReader1 = tmpDB1.GetBinaryData(binaryID, Utility.GetUserID(), false, Request.IsAuthenticated);
if (tmpReader1.Read())
{

MemoryStream imgMemoryStream = new MemoryStream();
byte[] img = (byte[])tmpReader1["BINARY_BATA"];


OATIBASE.ImageProcess tmpImgProcess = new OATIBASE.ImageProcess(
(int)Utility.GetSystemVariables(Utility.IMAGE_MAX_HEIGHT, Utility.ReturnType.INT),
(int)Utility.GetSystemVariables(Utility.IMAGE_MAX_WIDTH, Utility.ReturnType.INT),
(int)Utility.GetSystemVariables(Utility.THUMB_SIZE, Utility.ReturnType.INT));

System.Drawing.Image __img = System.Drawing.Image.FromStream(new MemoryStream(img));
tmpImgProcess.DoCropping(__img, _x, _y, Tmpwidth, TmpHeight).Save(imgMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);

_croppedImage.Visible = true;

//tmpImgProcess.DoCropping(imgMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imgByteArray = imgMemoryStream.ToArray();


Session["ImageBinaryArray"] = imgByteArray;
_croppedImage.ImageUrl = "ReturnImage.aspx";

System.Drawing.Image croppedimg = System.Drawing.Image.FromStream(new MemoryStream(imgByteArray));

// byte[] arr = tmpImgProcess.ConvertImage(__img, ImageFormat.Jpeg);
byte[] arr = tmpImgProcess.ConvertImage(croppedimg, ImageFormat.Jpeg);
byte[] thumb = tmpImgProcess.GetThumbNail();
string mimeType = tmpReader1["MIMEType"].ToString();
string fileName = tmpReader1["FileName"].ToString();
DateTime approvaldt = Convert.ToDateTime(tmpReader1["ApprovalDT"]);
int tabId = Convert.ToInt32(tmpReader1["BinaryIdentificationID"]);


// tmpDB2.SubmitImage("POR", "TabID", "GalleryPhoto", mimeType, fileName, img, thumb, Utility.GetUserID(), tabId, System.DateTime.UtcNow,approvaldt, new System.DateTime(3000, 1, 1),binaryID);
//tmpReader2 = tmpDB2.GetBinaryData(BinaryID, Utility.GetUserID(), false, Request.IsAuthenticated);

tmpDB2.SubmitImage("POR", "TabID", "GalleryPhoto", mimeType,
fileName, img, thumb,
Utility.GetUserID(), tabId, approvaldt, new System.DateTime(3000, 1, 1), null, binaryID);

tmpDB1.CloseConnection();
tmpDB2.CloseConnection();
Response.Write("<script language='javascript'>window.opener.location=window.opener.location;</script>");



Author: gaurav tyagi    29 Jul 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

api


api.rar
Author: gaurav tyagi    07 Sep 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Movable
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public partial class WebForm1 : System.Web.UI.Page
{

protected void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{

}
#endregion

protected void _btnCrop_Click(object sender, System.EventArgs e)
{

this._lblResults.Text = "X: "+ this._txtX.Value +", Y: "+ this._txtY.Value +
"<br>Width: "+ this._txtWidth.Value +", Height: "+ this._txtHeight.Value;


int Tmpwidth = Convert.ToInt32(this._txtWidth.Value);
int TmpHeight = Convert.ToInt32(this._txtHeight.Value);

int _x = Convert.ToInt32(this._txtX.Value);
int _y = Convert.ToInt32(this._txtY.Value);

System.Drawing.Image __img = System.Drawing.Image.FromFile(Server.MapPath(this.Image_To_Crop.ImageUrl));



System.Drawing.Image newBitMap = new Bitmap(Tmpwidth,TmpHeight);
Graphics tmpGphs = Graphics.FromImage(newBitMap);
Rectangle tmpRect = new Rectangle(0,0,Tmpwidth,TmpHeight);
tmpGphs.DrawImage(__img,tmpRect,_x,_y,Tmpwidth,TmpHeight,GraphicsUnit.Pixel);
tmpGphs.Dispose();
newBitMap.Save(Server.MapPath("TmpPics\\"+ _x.ToString() + _y.ToString() + Tmpwidth.ToString() + TmpHeight.ToString() +".jpg"), System.Drawing.Imaging.ImageFormat.Jpeg);
this._croppedImage.ImageUrl = "TmpPics\\"+ _x.ToString() + _y.ToString() + Tmpwidth.ToString() + TmpHeight.ToString() +".jpg";
this._croppedImage.Visible = true;
}

protected void _btnNewPic_Click(object sender, System.EventArgs e)
{
try
{
System.Drawing.Image __img = System.Drawing.Image.FromStream(this._flNewPic.PostedFile.InputStream);

string strFileName = this._flNewPic.PostedFile.FileName;
strFileName = strFileName.Substring(strFileName.LastIndexOf("\\") + 1);

__img.Save(Server.MapPath("TmpPics\\"+ strFileName));
this.Image_To_Crop.ImageUrl = "TmpPics\\"+ strFileName;
this._croppedImage.Visible = false;
this._txtHeight.Value = "50";
this._txtWidth.Value = "50";
this._txtX.Value = "0";
this._txtY.Value = "0";
}
catch(Exception ex)
{
Trace.Warn(ex.ToString());
}
}
}
}



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Last 10 pages visited in asp dotnet
Previous : Export data from xl to sqlserver 2000 using vb.net
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use