|
Im trying to display information from a datbase using datagrid on the website but I keep getting the following error:
'ASP.customers_aspx does not contain a definition for 'SqlDataSource1_Selecting'
anyone know why???/
-- modified at 17:11 Monday 22nd October, 2007
|
|
|
|
|
You have deleted probably a method asociated to that selecting event on this sqldatasource1. Go to markup view of this page, search sqldatasource1 declaration and delete event onSelecting...
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
hi Mr
You are Shure Define the DataSource in Your Connection String
Thaer Hamael
Thaer
|
|
|
|
|
just remove the event from ur HTML,thats it done
Cheers
Bino
www.codepal.co.nr
|
|
|
|
|
Hi, is there a component to make chart like it, and can zoom (exactly for that purpose)
www.geni.com
Best wishes
|
|
|
|
|
i need to know how we can save the files that is loaded using the file upload control
|
|
|
|
|
Use the SaveAs method exposed by the control.
Paul Marfleet
|
|
|
|
|
no i mean that i write a web page this page contain as upload control i need som ideas that enable me to save the uploaded file from the other peoples on the internet into the server hard disk
|
|
|
|
|
I'm afraid I don't understand your question. What do you mean by 'other peoples'?
If you have a page that includes the ASP.NET FileUpload control, the user has to select a file. When the page is posted back to the server, you can programmatically work with the contents of the posted file.
If your question relates to some other mechanism of file upload, please be more specific about what you want to do.
Paul Marfleet
|
|
|
|
|
sorry for my bad language, yes what i want is to programmatically work with the contents of the posted file .
i try to upload some files from my website but when i check the server i didnot find the uploaded file so i assume that the control didnot work
i read from the internet that i need to applay some code when the page is submited to make the file upload control work
many thanks
|
|
|
|
|
You should post the code you have written so far and identify the section you are experiencing difficulties with. The exact nature of your problem still isn't clear to me.
The FileUpload control provides a means of acquiring a file from a client machine and including its contents in a HTTP server request. What happens to the contents of that file when the server receives the request is entirely up to the discretion of the programmer. As I have already stated, if you want to save the contents of the posted file on the server-side you need to call the SaveAs method of the FileUpload control.
Paul Marfleet
|
|
|
|
|
What u can do is use the SaveAs method to save the file to ur db as byte[] or just the filepath+filename.
Cheers
Bino
www.codepal.co.nr
|
|
|
|
|
drag n drop html browse control on your page rght click on it and check the "Run as Server Control" option now drag and drop a button on your form. Lets say the name(ID) of your File control is File1 then on click event of your button write following code
string path=@"C:\Uploaded";//Path where you want to save the uploaded file
File1.PostedFile.SaveAs(path);
You need to give ASPNET account write permissions on that folder where you want to save the file.
Shujaat
|
|
|
|
|
Hi
How do i add a "Installer Class" to my Web Project in VS 2005? When i right click on the project --> Add new Item, there is no "Installer Class".
ONeil
|
|
|
|
|
Why you want add an installer class? You don't have to add an installer project?
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
for loop
{
ImageButton img = new ImageButton();
img.ImageUrl = "a.gif";
img.Attributes.Add("onmouseover", "this.src='" + imgMouseOverURL + "'");
}
Hello, I have an imagebutton instance dynamically generated. The code works fine except the mouse over effect
on the button becomes a big red X everytime my mouse hovers over the image. Does this have something to do with the dynamic generation of my imageButton? On the contrary, if I have an imagebutton available in markup with similar attribute, everything works fine.
Please help.
Thank you.
Gerri
|
|
|
|
|
try doing a "View source" on the generated page to see what is actually sent down to the browser, and how it differs from the markup code that works
I'm not quite sure about your for...loop ? However you're looping, you can't create more than one control with the same ID...
Fred
|
|
|
|
|
|
CandyMe wrote: ImageButton img = new ImageButton();
img.ImageUrl = "a.gif";
img.Attributes.Add("onmouseover", "this.src='" + imgMouseOverURL + "'");
ImageButton accepts 'ImageUrl' attribute rather than 'Src' attribute which is an attribute for HTML Image.
Try modifying your last line of code to---
img.Attributes.Add("onmouseover", "this.ImageUrl='" + imgMouseOverURL + "'");
Hope this works
|
|
|
|
|
No, that's not right. The Attribute that that line adds is to the control as it is rendered client-side, and therefore you must use the client-side properties. The original code is right, in that respect.
|
|
|
|
|
|
Hi,
I am trying to create a setup program to deploy a .net 2 web app. When I right-click on the setup project and then go Add -> Project Output, I only see "Content Files" in the Add Project Output Group dialog box. Why do I not see the other options like "Primary output", "Localized resources", "Debug Symbols", etc.?
Any help would be greatly appreciated. Thanks in advance.
Regards,
|
|
|
|
|
Hello, I'm working on an internal e-mail utility to send messages to different groups from a database. One feature i'm implementing is the ability to add e-mail attachments. I have every thing working the way it should but it seems if a user tries to attach an Exe file, the page breaks.
for instance, if you had the file "breakit.exe" and tried to attach it, it would give me a "page cannot be displayed error" after I hit the "upload" button. if you try this with a .jpg, .txt, or anything it works, but the page breaks even if I try to change the name of "breakit.exe" to "breakit.notanexe".
Does any one know how to detect this problem before the page breaks?
thanks,
-Ian.M
if ((File1.PostedFile != null) && (File1.PostedFile.ContentLength > 0))
{
string fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);
string SaveLocation = Server.MapPath("Data\\" + ParentSessionID.Value);
if (!System.IO.Directory.Exists(SaveLocation))
{
System.IO.Directory.CreateDirectory(SaveLocation);
}
try
{
File1.PostedFile.SaveAs(SaveLocation + "\\" + fn);
}
catch (Exception ex)
{
}
}
|
|
|
|
|
What do you mean by "the page breaks"? Where is the code sample you provided being run? Is this part of the code that handles the upload button?
If you don't want to allow executable files at all, you could probably use the System.IO.Path.GetExtension method to get the file extension. If the extension is ".exe", don't upload the file. Of course, this doesn't really prevent someone from uploading an executable, it just prevents them from using certain extensions.
|
|
|
|
|
Torin_DWC wrote: "page cannot be displayed error" after I hit the "upload" button
Have you tried setting a breakpoint and stepping threough to determine what the real error is? Its just that "Page cannot be displayed" is the generic error that is shown in the browser and provides no information for somebody trying to help you with this issue.
|
|
|
|