Click here to Skip to main content
15,915,600 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionımagebutton focus problem Pin
enginakkoca118-Sep-08 4:50
enginakkoca118-Sep-08 4:50 
Questionautomatically select tree node Pin
NikoTanghe18-Sep-08 4:07
NikoTanghe18-Sep-08 4:07 
AnswerRe: automatically select tree node Pin
eyeseetee18-Sep-08 4:32
eyeseetee18-Sep-08 4:32 
GeneralRe: automatically select tree node Pin
NikoTanghe19-Sep-08 1:05
NikoTanghe19-Sep-08 1:05 
QuestionCalling server side method through java script Pin
alok_2k318-Sep-08 3:13
alok_2k318-Sep-08 3:13 
AnswerRe: Calling server side method through java script Pin
eyeseetee18-Sep-08 3:50
eyeseetee18-Sep-08 3:50 
AnswerRe: Calling server side method through java script Pin
NikoTanghe18-Sep-08 4:20
NikoTanghe18-Sep-08 4:20 
QuestionTrying convert Gridview As Image. Error : System.ArgumentException Pin
K V Sekhar18-Sep-08 2:59
K V Sekhar18-Sep-08 2:59 
Hi all,

I am trying convert Gridview into Image. I am getting ArgumentException(Parameter is invalid) when i pass that memorystream object to Image.FromStream().

Please help me how to fix this error.

Here is my code

btn_GenImageOfGridview()
{
//Bind Gridview
gview.DataSource = mydatasource;
gview.DataBind();

//variable declaration
Response.Clear();
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);

gview.RenderControl(htmlWrite);

string s = stringWrite.ToString();
byte[] arrByte = new byte[s.ToCharArray().Length];
int i = 0;
foreach (char ch in s.ToCharArray())
{
arrByte[i] = (byte)ch;
i++;
}

System.IO.MemoryStream ms = new System.IO.MemoryStream(arrByte);
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms, false,true); //Here i am Getting above Exception.returnImage.Save(@"D:\image.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

}

Please help me how to fix that error.

Thanks in advance.

Cheers,
sekhar
AnswerRe: Trying convert Gridview As Image. Error : System.ArgumentException Pin
J4amieC18-Sep-08 3:34
J4amieC18-Sep-08 3:34 
GeneralRe: Trying convert Gridview As Image. Error : System.ArgumentException Pin
K V Sekhar18-Sep-08 3:37
K V Sekhar18-Sep-08 3:37 
GeneralRe: Trying convert Gridview As Image. Error : System.ArgumentException Pin
eyeseetee18-Sep-08 3:47
eyeseetee18-Sep-08 3:47 
GeneralRe: Trying convert Gridview As Image. Error : System.ArgumentException Pin
K V Sekhar18-Sep-08 4:04
K V Sekhar18-Sep-08 4:04 
GeneralRe: Trying convert Gridview As Image. Error : System.ArgumentException Pin
J4amieC18-Sep-08 4:14
J4amieC18-Sep-08 4:14 
Questionasp net onfocus and onblur problem in ie6! Pin
Nyssa_2018-Sep-08 2:47
Nyssa_2018-Sep-08 2:47 
AnswerRe: asp net onfocus and onblur problem in ie6! Pin
t7bros18-Sep-08 4:44
t7bros18-Sep-08 4:44 
GeneralRe: asp net onfocus and onblur problem in ie6! Pin
Nyssa_2018-Sep-08 5:03
Nyssa_2018-Sep-08 5:03 
Questionvalidating Drop down list Pin
meghamaharshi18-Sep-08 2:29
meghamaharshi18-Sep-08 2:29 
AnswerRe: validating Drop down list Pin
Paddy Boyd18-Sep-08 2:46
Paddy Boyd18-Sep-08 2:46 
AnswerRe: validating Drop down list Pin
eyeseetee18-Sep-08 2:47
eyeseetee18-Sep-08 2:47 
AnswerRe: validating Drop down list Pin
J4amieC18-Sep-08 2:52
J4amieC18-Sep-08 2:52 
GeneralProgrammatically Make Bound Column Invisible Pin
Brady Kelly18-Sep-08 2:24
Brady Kelly18-Sep-08 2:24 
GeneralRe: Programmatically Make Bound Column Invisible Pin
meghamaharshi18-Sep-08 2:38
meghamaharshi18-Sep-08 2:38 
GeneralRe: Programmatically Make Bound Column Invisible Pin
Brady Kelly18-Sep-08 3:05
Brady Kelly18-Sep-08 3:05 
GeneralRe: Programmatically Make Bound Column Invisible Pin
J4amieC18-Sep-08 3:28
J4amieC18-Sep-08 3:28 
GeneralRe: Programmatically Make Bound Column Invisible Pin
Brady Kelly18-Sep-08 3:34
Brady Kelly18-Sep-08 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.