Click here to Skip to main content
15,907,905 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiona gridview problem [xmldatasource & xml/xapth][2] Pin
pidakar16-Sep-07 5:53
pidakar16-Sep-07 5:53 
Questiona gridview problem [xmldatasource & xml/xapth] Pin
pidakar16-Sep-07 5:41
pidakar16-Sep-07 5:41 
AnswerRe: a gridview problem [xmldatasource & xml/xapth] Pin
Sandeep Akhare16-Sep-07 20:31
Sandeep Akhare16-Sep-07 20:31 
Questiondatabinding with controls Pin
prachishah16-Sep-07 1:02
prachishah16-Sep-07 1:02 
Questionpost data from asp.net 2.0 page to PHP Page Pin
Ahmad Adnan15-Sep-07 23:09
Ahmad Adnan15-Sep-07 23:09 
AnswerRe: post data from asp.net 2.0 page to PHP Page Pin
Guffa16-Sep-07 2:04
Guffa16-Sep-07 2:04 
QuestionJavascript drag and drop problem Pin
Dot Net15-Sep-07 19:02
Dot Net15-Sep-07 19:02 
QuestionHow to use asp:ImageField in a GridView Pin
RoyRose7815-Sep-07 7:12
RoyRose7815-Sep-07 7:12 
Hi all,

I'm using GridView with an ImageField column and somehow it doesn't display the pictures in my db.

This is the code for adding new picture to the db (which I took from codeproject site)
<br />
if (!Page.IsValid)<br />
       return;<br />
if (!FileUpload1.HasFile)<br />
       return;<br />
try<br />
{<br />
      int len = FileUpload1.PostedFile.ContentLength;<br />
      byte[] pic = new byte[len];<br />
      FileUpload1.PostedFile.InputStream.Read(pic, 0, len);<br />
      int glrId = int.Parse(_GallaryDropDownList.SelectedValue);<br />
     _engine.AddPicture(gallrId, pic, _DescTextBox.Text);<br />
}<br />
catch<br />
{...<br />
}<br />

The GridView markup is the following:
<br />
<asp:GridView ID="GridView1" runat="server" ForeColor="Navy" Width="100%" AutoGenerateColumns="False"<br />
                                        DataKeyNames="picID" DataSourceID="_PicturesSqlDataSource" Font-Names="Arial"<br />
                                        Font-Size="11pt"><br />
         <Columns><br />
     <asp:BoundField DataField="picID" HeaderText="picID" InsertVisible="False" ReadOnly="True"<br />
                                                SortExpression="picID" Visible="False" /><br />
                                            <asp:BoundField DataField="picGlrID" HeaderText="picGlrID" SortExpression="picGlrID"<br />
                                                Visible="False" /><br />
                                            <asp:ImageField DataAlternateTextField="picDEscription" DataImageUrlField="picData"<br />
                                                HeaderText="picture"><br />
                                            </asp:ImageField><br />
                                            <asp:BoundField DataField="picDEscription" HeaderText="description" SortExpression="picDEscription" /><br />
                                            <asp:TemplateField><br />
                                                <ItemTemplate><br />
                                                    <asp:CheckBox ID="_SelForDelCheckBox" runat="server" /><br />
                                                </ItemTemplate><br />
                                            </asp:TemplateField><br />
                                        </Columns><br />
                                    </asp:GridView><br />


When I go to that page, I can see the rows but I cannot see the images, I can see the alt text instead..

Can you help me with that? What am I doing wrong?

Thank you,
Roy.
Questionbreaking out into server code while rendering javascript Pin
Guy Harwood15-Sep-07 5:50
Guy Harwood15-Sep-07 5:50 
AnswerRe: breaking out into server code while rendering javascript Pin
MoustafaS15-Sep-07 10:15
MoustafaS15-Sep-07 10:15 
AnswerRe: breaking out into server code while rendering javascript Pin
MoustafaS15-Sep-07 10:15
MoustafaS15-Sep-07 10:15 
GeneralRe: breaking out into server code while rendering javascript Pin
Guy Harwood16-Sep-07 3:33
Guy Harwood16-Sep-07 3:33 
QuestionSelecting a role when registering a user Pin
DarynRoberts15-Sep-07 3:18
DarynRoberts15-Sep-07 3:18 
QuestionAssembly in asp.net Pin
Rinki Mukheraji15-Sep-07 1:54
Rinki Mukheraji15-Sep-07 1:54 
AnswerRe: Assembly in asp.net Pin
ademsandeepreddy15-Sep-07 20:12
ademsandeepreddy15-Sep-07 20:12 
AnswerRe: Assembly in asp.net Pin
Paras Kaneriya16-Sep-07 19:29
Paras Kaneriya16-Sep-07 19:29 
Question[Urgent] Can someone tell me how to put an Html file into a pdf? Pin
Big Ralph14-Sep-07 23:26
Big Ralph14-Sep-07 23:26 
Questiondisplay image in GridView using image URL string "C:\images\abc.jpg" Pin
mavii14-Sep-07 23:21
mavii14-Sep-07 23:21 
AnswerRe: display image in GridView using image URL string "C:\images\abc.jpg" Pin
Saksida Bojan15-Sep-07 7:23
Saksida Bojan15-Sep-07 7:23 
AnswerRe: display image in GridView using image URL string "C:\images\abc.jpg" Pin
Paras Kaneriya16-Sep-07 19:31
Paras Kaneriya16-Sep-07 19:31 
Questioncan any one tell me how to use the Trim() function in C# for any column in a table Pin
mavii14-Sep-07 23:00
mavii14-Sep-07 23:00 
AnswerRe: can any one tell me how to use the Trim() function in C# for any column in a table Pin
Sonia Gupta14-Sep-07 23:02
Sonia Gupta14-Sep-07 23:02 
GeneralRe: can any one tell me how to use the Trim() function in C# for any column in a table Pin
mavii14-Sep-07 23:10
mavii14-Sep-07 23:10 
AnswerRe: can any one tell me how to use the Trim() function in C# for any column in a table Pin
Guffa15-Sep-07 0:37
Guffa15-Sep-07 0:37 
AnswerRe: can any one tell me how to use the Trim() function in C# for any column in a table Pin
saini arun15-Sep-07 1:10
saini arun15-Sep-07 1:10 

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.