|
I have given begindcode
while(dr10.Read())
{
Response.Write("<img src=~\"uploads\" width=\"39\" border=\"1\" height=\"40\">");
}
HTML CODE
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lbl4" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"picture") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Its not retrieving
krishna
|
|
|
|
|
|
Have a look at this One[^], Two[^].
What exactly is the problem?
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Please understand, i hope u people will help me thats y iam keep sending dont mistake me r to get angry...
The producer wht u had send all storing link to the db, but i have stored a image file name as (9.jpg) no image was there, image was in separate folder having this image file 9.jpg.
In out put its receiving like 9.jpg( no image ), so how to link with that folder to retrieve the image.
Advance Thanx,
krishna
|
|
|
|
|
Hi,
as you have just store image name in your database and your inmage is in another folder of your application.
So, first you have to get image name from database and then you have to concat the string of folder path of that image with file name, then you will get image.
see this below code.
your page is in forms directory and yr image is in images directory.
So now on page.
String path = Server.MapPath("../Images/" + filenameFromDatabase);
So you will get ......../Images/image1.jpg path. Now open the file.
Thanks,
Sun Rays
Rate this post if you like answer.
My Articles
|
|
|
|
|
Which one is this ' filenameFromDatabase' means ?
krishna
|
|
|
|
|
|
ok, all that I understand up till this moment is that you store the File Name in the Database and the Corressponding Images are stored in the folder in the server, right? can you show only the code that you use to set src property of Img?
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Response.Write("");
krishna
|
|
|
|
|
krishnavaradharajan wrote: Response.Write("");
sorry, I really don't understand what you are trying to do with the above code.
Here is the tip to solve you problem. If I have to display a Image which lies in a virtual folder in my application then I would write the code as below.
HTML
<-img id="ImgFile" runat="server">
Code-Behind
string FileName = "Pic101.gif"; <br />
ImgFile.Src = "./Images/" + FileName;
Same code will work for you with the ImageName picked from the Database and provided the corressponding Image folder should be available in the given virtual path and Corressponding Image should also availble in the folder.
Try it out.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
|
Its working fine iam retrieving images, but ....
For example : customer may upload 2 - 3 product details with image so we have 10 options to image upload.
So the condition is given like if i click button in new page by checking for karnataka state than all the product pictures should be displayed. because the condition iam checking for karnataka(like that i have to create 26 stats)
here iam receiving all the images as same.(it should be come different images according to that respective products.
krishna
|
|
|
|
|
krishnavaradharajan wrote: Please understand, i hope u people will help me thats y iam keep sending dont mistake me r to get angry...
Have you tried the suggestion given by me ? What happened when you tried it. I don't think posting continuously won't help you. Try the suggestion and let me know. You code looks completely stupid to me.
|
|
|
|
|
hi friends
I hosted the asp.net2.0.but it showed the error..but asp.net1.1 working properly..any difference betwen asp.net1.1 and asp.2.0 hosting.
regards
saravanan
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
There are some differences.. If your host supports both ASP.NET 1.1 and 2.0 then there should be one option to select which version you wanna use..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
hi i have one doubt , i have one dropdownlist and i populating 10 state_names from database, and i m using this code
string strStateId = ddlStateID.SelectedItem.ToString();
now i m selecting fifth item in dropdownlist and send it to databas e 4 update.but i m using this code if i selected fifth item but it is taking as first item only.. plz..tell me how can i do this..
thanks 2 all..
|
|
|
|
|
Rajeshwar Developer wrote: if i selected fifth item but it is taking as first item only
Check your page_load event code and make sure you are binding the dropdown by checking IsPostBack .
|
|
|
|
|
hey hi brother ..thanks..
thanks 2 all..
|
|
|
|
|
but brother if i put IsPostback , but after Click submit button it ll not go 2 pageload know... i was used !ISpostBack in pageload 2 populate state_nmaes in dropdownlist..
thanks 2 all..
|
|
|
|
|
Rajeshwar Developer wrote: string strStateId = ddlStateID.SelectedItem.ToString();
string strStateId = ddlStateID.SelectedItem.Text;
or
string strStateId = ddlStateID.SelectedItem.value;
Rajeshwar Developer wrote: if i selected fifth item but it is taking as first item only.. plz..tell me how can i do this..
May be possible your dropdownlist will be bind again when you are trying to get selected value.
Check It
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi
Write That One in
if(!IsPostBack)
{
/* Put Your Code Here */
}
Here wat happanes if u don't write your code in this block,
Your Page Get Refreshed and It Takes it's Bydefault Value Which Is First.
Just Do IT™ [Information Technology]™ :->
Don't Forget To Give Ratings
|
|
|
|
|
if(!ispostback) is it write in pageload or submit button..
thanks 2 all..
|
|
|
|
|
Rajeshwar Developer wrote: if(!ispostback) is it write in pageload or submit button..
put that in both places and check what's happening. Then remove from one of the place and check what's happening. try all the possibilities. at the end you will know what is IsPostBack and How to bind the DropDownList .
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
see my code once..wht i m using here..
in submit button..
if(!IsPostBack )
{
MrkBC stateId=new MrkBC();
intStateId=stateId.States_id(ddlStateID.SelectedItem.ToString());
}
but its is not entering into if condition..its going out of if condition..
thanks 2 all..
|
|
|
|
|
Rajeshwar Developer wrote: see my code once..wht i m using here..
in submit button..
if(!IsPostBack )
{
MrkBC stateId=new MrkBC();
intStateId=stateId.States_id(ddlStateID.SelectedItem.ToString());
}
but its is not entering into if condition..its going out of if condition..
Fine, It works correctly. Did you get that? ok Now try some other possibility. put the condition in page load and check.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|