|
w209 wrote: can any one let me how can i send mail through asp.net
You've asked the same question 3 times already in the forums.
What part of 'learn how to use Google' don't you understand?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I wrote this[^] article, just for people like you.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
C# and VB.NET are the same, just the syntax is different. There are online converters to help you, too.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Many thank for the lead. I will give this a try.
|
|
|
|
|
Yes this works fine - many thanks.
|
|
|
|
|
I've added Image control to ASP.NET web application project in C#. While clicking on some button I want the picture from hdd file to be displayed in it. Providing Image.ImageUrl = @"full hdd path\picture.jpg" doesnt seem to work at all. I do not want to copy the images to project folder either.
Also Image control provides only stretch mode. How to make it fit say 100x100 sized control so it keeps its aspect ratio?
chesnokov
|
|
|
|
|
Chesnokov Yuriy wrote: Image.ImageUrl = @"full hdd path\picture.jpg"
This won't work as it requires virtual path like (/images/someimage.jpg). Also it should be in the virtual directory where project is running.
Chesnokov Yuriy wrote: How to make it fit say 100x100 sized control so it keeps its aspect ratio?
It won't resize using aspect ratio. You need to create a Bitmap object with required width and height and draw the image to bitmap. Now send this to response, also set content type to image/jpg. I suggest using HTTPHandler for this.
|
|
|
|
|
How's that?
You can load bitmap from the hdd? can't you. For a dummy in ASP.NET how to show that Bitmap then with Image control or any other control on a page at specified location.
chesnokov
|
|
|
|
|
If you are going to use handler, just make the ImageUrl.Url = "imagehandler.ashx?url=the_image_path",
then in the handler :
load the bitmap as usual, and then use the context object as context.output.write(image as byte).
Otherwise you can simply use the Server class, I believe it has a method like PhysicalPath or something.
|
|
|
|
|
No I need some simple.
There is a button on the page. You click it and say 10 first images are displayed in row, column like matrix say 2x5 from some hdd place. Then you click it again and the next 10 images are displayed and so on. Do I need to put 2x5 Image controls and how to provide that handlers?
I would rather load image from a file resize it to thumbnail and put it to 2x5 grid and how to use the handlers then?
chesnokov
|
|
|
|
|
Chesnokov Yuriy wrote: You can load bitmap from the hdd? can't you.
Yes. But in ASP.NET, images resides in a location where ASP.NET has access can only be loaded. You need to use Server.MapPath(VirtualPath) . But it can't access images/files that resides out of the website space.
Chesnokov Yuriy wrote: For a dummy in ASP.NET how to show that Bitmap then with Image control or any other control on a page at specified location.
You can't set an image/bitmap directly to the image control. You are going to set the handler path, something like /ShowImage.img?name=yourimagename as image URL. You need to register img extension with IIS ISAPI mapping, write a HTTPHandler which can handle this extension. Inside handler, load file to a bitmap and do resizing. Then use your imageobject.Save(HttpContext.Response.OutputStream,imagetype). You need to set the ContentType too.
Hope it helps
|
|
|
|
|
System.Drawing.Image image = System.Drawing.Image.FromFile(@"full path\image.jpg");
Response.ContentType = "image/jpeg";
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
This seems to work. But say when I click the button with that code, all controls are gone from the page and only image is displayed at the top of page.
How to display them like in photo browser, in rows and columns. Do I need to put some panel control. How to do it like thumbnail photo browser articles at codeproj.
chesnokov
|
|
|
|
|
Chesnokov Yuriy wrote: System.Drawing.Image image = System.Drawing.Image.FromFile(@"full path\image.jpg");
Response.ContentType = "image/jpeg";
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Make sure you are writing this code in the handler and not in page.
Chesnokov Yuriy wrote: How to display them like in photo browser, in rows and columns
Panel won't be a good choice. Use DataList, it has a RepeatDirection[^] property, set that to the columns count you would like to display. And put image tag inside item template. Image URL will be /yourimagepath.img (hope img extension is handled by handler). So you will get something like photo browser. If you are on ASP.NET 3.5, check ListView[^] control too.
|
|
|
|
|
Hi Code project Team,
In page load default I’m showing "start time" dropdown,” End time" dropdown.
I'm giving one checkbox option to user, if user checks I’m enabling the button.
On that button click, I want to create client side dynamic controls for adding on start time, end time.
Start Time with 3 dropdown Hours, Mint, Unit (AM, PM).
End Time with 3 dropdown Hours, Mint, Unit (AM, PM).
This scenario is for measuring "SAMPLE “multiple start time, end time.
I want to calculate the duration of start, end time & show to user.
Can any one give me the idea or give me the good example to handle this issue.
Plz send the solution as soon as possible.
Thanks & regards
Shaik Mujeebuddin.
Analyst I
|
|
|
|
|
mujeeb_4m wrote: Hi Code project Team,
This is a common misunderstanding. The CP team creates the site, ordinary, unpaid people provide the answers.
Your dynamic controls need to be created before page load in order for viewstate to be restored to them. There's tons of info on google about this.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
My company used Oracle Application Express for develop application. Now we see that it isn't sufficient for us, so we have to choose between ASP and JSF. Can somebody give me one or more example where we'll see conection to oracle, implementing security access to database, work with data, controls design and another thinks to demonstrate that ASP is necessary for us. Thank You!
(Sory for my English, I study it now )
|
|
|
|
|
Nope. It's up to you to try out the different technologys to find out which works best for you. It's your company, and your applications so it's up to you to try and work out which works best for you. BTW - please use a more meaningful title than ASP.NET - this is obviously a question about ASP.NET - take a look at the name of this forum.
|
|
|
|
|
hi all,
Can anyone tell me how to pass data from code behing to data layer,
I am using asp.net with c# as code behind
Any suggestions would be welcome
Thanks
sri
|
|
|
|
|
mukkanti007 wrote: data from code behing to data layer,
Well, that depends on how your datalayer is. Simple way is pass through parameters. Assume you have a method to get products in the data layer, then it would be like
public string GetProductName(string id)
{
} here you can pass product id as string through the method parameter.
|
|
|
|
|
Thanks for looking
I have a sqlDatasource bound to a gridview's selectedValue
If i set the visible property of row 0 to false in the gridview, the sqldatasource is still ponting to row 0 (even when the row is not visible)
I would like the sqlDatasource to point to the first visible row
I cant filter the rows in the DB because i set visible to true or false depending on conditions that i apply in my VB code
Is there any way to accomplish this without many code?
Im doing it getting the rows into a dataview, applying conditions and binding the result to the gridview, it works but i was wondering if there is another way to do this
Perhaps another property that i can set to the grisviewrow since visible is not working
Thanks in advance
Alexei Rodriguez
|
|
|
|
|
I'm trying to request a variable from the url to pass into a stored procedure that will query the database and return the desired information but when I typed:
Dim Request As Integer = Request.Querystring("ID")
it returns the error 'querystring' not a memeber of string.
has anyone attempted something similiar and if so can they advise me on what i should do? Any help is most appreciated.
|
|
|
|
|
Request.Querystring returns a string, your Request variable is an Integer, you need convert the string to an integer before assigning it.
|
|
|
|
|
No, I think VB will accept this and do the conversion itself. I think the problem is that he's named his string 'Request'.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You define Request as string, then try to access the Request object. You're confusing the compiler, it's trying to find the QueryString method on a string called Request. Call it something sensible.
Because you're using VB, I suspect you will get an integer without casting, but just because VB is crap, doesn't mean your code has to be. Use int.TryParse to work out if the value returned is a number or not, and set a default if it's not.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|