|
You're looking at the properties of the GridView ; you need to be looking at the properties of the ImageField .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Homer: Thanks for your post. Per your advice, I went through again step-by-step, and got the problem solved.
|
|
|
|
|
Hey Friends,
Thnx For the help last time, It was great on your part and the error gor solved. But again have stuck up at a point, where i have to upload the images and store it in the questions database.!the question must be in image format and the answers could also be in image format, and i have to save all this in the question database.!
Please Help me out friends.!
|
|
|
|
|
|
Code To upload Your Image to folder
YourFunctionToUploadImage()
{
if (ImageFileUploadControll.HasFile)
{
string fileExtention = System.IO.Path.GetExtension(ImageFileUploadControll.FileName);
if (fileExtention.ToLower() != ".jpg" && fileExtention.ToLower() != ".jpeg" && fileExtention.ToLower() != ".png")
{
lblUploadstatus.Text = "Invalid File Choose .jpg/.jpeg/.png/.gif";
}
else
{
if (File.Exists(Server.MapPath("~/Folder_Name/" + ImageFileUploadControll.FileName)))
{
lblUploadstatus.Text = "File Already Exists. Rename filename";
}
else
{
ImageFileUploadControll.SaveAs(Server.MapPath("~/Folder_Name/" + ImageFileUploadControll.FileName));
lblUploadstatus.Text = "Upload Status : File Uploaded Successfully";
}
}
}
else
{
lblUploadstatus.Text = "Please Select File";
}
}
Code To Retrive All Images form Folder and display in image_control you can use
PageLoadEvent()
{
DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/Folder_Name/"));
FileInfo[] fi = dir.GetFiles();
foreach(FileInfo f in fi)
{
string imageUrl = f.ToString();
Image img = new Image();
img.ImageUrl = "~/Folder_Name/"+"imageUrl";
}
}
Hope This Help
Pratik Bhuva
---------------
The night is darkest just before the dawn. And I promise you, the dawn is coming
|
|
|
|
|
Can anyone share asp.net 4.0 interview questions.
Regards.
|
|
|
|
|
Your first question: Can you use Google[^]?
Veni, vidi, abiit domum
|
|
|
|
|
I have to say there is no real way to prepare for this: no matter what you study, they'll still manage to ask you something you don't know or have never heard of. You commit that new one to memory and then never get asked it again.
Or they ask you a question; you give the right answer and they tell you you're wrong. Doh!
Cynical? Jaded? Moi?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
Agree with Mark. This is not a right way to learn.
Here more than couple of ways to learn anything in Internet. Education Needed[^]
Interview questions, Dumps, copy-paste codings are bad for learning.
thatrajaNobody remains a virgin, Life screws everyone
|
|
|
|
|
I don't think those questions will help you if you have no hands on experience in ASP.Net.
|
|
|
|
|
Hey all,
I've got a gridview that is binding images with a 100% width.
The image stretch fine in IE10, Chrome and FF, bit in IE7 the image is its original size.
Is there any workaround for this issue?
|
|
|
|
|
Dear all,
I am currently an novice user in the asp.net environment and would like to request assistance on the following topic below:
I am using 'c.Cover' as field name from database table, which has three types (i.e. talk, cvr, trd). I would like to filter my query, so it prints out yesterday's data with only cvr and trd types only.
from the code below, I am unable to filter my data using the following link below. I still not getting the correct response output from the client side.
http://localhost:38853/api/test?type=CVR&TRD</a>[^]
public IEnumerable<database_WICs> GetPriceType(string type)
{
DateTime yesterday = DateTime.Today.AddDays(-2);
var data = from c in db.database_WICs
where c.UploadDate <= yesterday &&
c.Cover == type &&
c.Cover == type
select c;
return data.ToList();
}
Any help would be much appreciated.
Many thanks for your time and help.
|
|
|
|
|
There are a few issues. The ampersand "&" actually separates parameters from each other. Consequently, type has the value of CVR only, and there is a second parameter named TRD without extra information. You need a different separator, what about a pipe | or + or....
Next, you do not want to get elements where the Cover column has both values at the same time - that does not make sense. It is sufficient when one of them matches. In boolean operators, that is an OR .
Instead of
c.Cover == type &&
c.Cover == type
you'll need a
(c.Cover == type1 ||
c.Cover == type2)
Note that you have to split the type parameter into type1 and type2 .
|
|
|
|
|
First - your localhost can't help us!!!
Second - yesterday is today -1 not -2!!!
Third - you pass in type and do
c.Cover == type && c.Cover == type
what you mean is
c.Cover == "cvr" || c.Cover == "trd"
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
Hello,
thank you so much for your response.
I updated my code but now I am expericing the an application error:
A potentially dangerous Request.Path value was detected from the client
public IEnumerable<database_BWICs> GetDatePrice(string type, string trd)
{
DateTime yesterday = DateTime.Today.AddDays(-1);
var data = from c in db.database_BWICs
where c.UploadDate <= yesterday &&
c.Cover == type ||
c.Cover == trd
select c;
return data.ToList();
}
http://localhost:38853/api/daily/type=cvr&trd=talk[^]
I am working on putting the application onto the server. Please bear with me, I shall forward you an appropriate link in couple of minutes time.
Thank you for your time and help.
|
|
|
|
|
|
Thank you once again for your reply, I manage to update my code again, by adding spit function, but the api is still reading the first type. I removed the date parameter, so I can get the code to output only the types 'cvr' and 'talk' data types.
I am still struggling to get the correct output.
Any help would be very much appreciated.
[HttpGet]
public IEnumerable<database_WICs> GetPriceType(string type)
{
var trd = type.Split('&');
var data = from c in db.database_WICs
where trd.Contains(c.Cover)
select c;
return data.ToList();
}
|
|
|
|
|
The LINQ code is looks just right.
It is possible that type does not get the expected value?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
Rather than implementing the filtering yourself, you might want to look at OData[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Changing the language of the site to Hebrew sets the .net culture appropriately (culture="he-IL"). However, the text "File Name: 002.txt" in Hebrew isn't coming up correctly 002.txt
שם קובץ: 002.txt
|
|
|
|
|
Can you show how the name comes to be part of the page you display?
It's highly possible that you need something like
<body dir="rtl">
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
|
Hey all,
I have created a blog where all the posts are stored in MS SQL.
I have created user-friendly url for each of the post using ASP Routing.
My question is, how do I submit the dynamic pages urls to google? Do I have to dynamically add the post url to the Sitemap and submit it to google when there is a new post?
Thank you in advance
|
|
|
|
|
I tend to use a dynamic sitemap file generated by a generic handler (sitemap.ashx ). Google re-reads the file on a regular basis, so there's no need to re-submit it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for you response
So I only have so submit it once so that google knows about the handler, correct?
|
|
|
|