|
|
I tried that already but still doesn't work
hifiger2004
|
|
|
|
|
have you invoked the debugger? Put a breakpoint and a watch on your line and see what "FileUpload1.FileName" contains at the point of the PreRender event where you are trying to assign it to the text value. My guess is that you're trying to access the property at the wrong stage of the Page Event Lifecycle[^]
"I need build Skynet. Plz send code"
|
|
|
|
|
yep, I tried debugging thru breakpoints to all events in page and fileupload but still I can't find the problem. It will not stop to any of the breakpoints I marked after I choose a file thru the fileupload browse button.
hifiger2004
|
|
|
|
|
Really? It won't stop on your breakpoints? Try putting in something like:
int i;
i = 1+1;
in your page_load (and your PreRender) event and then try debugging it again. ...If it won't stop on your breakpoint, try cleaning your solution, make sure that your Configuration Manager is set to "Debug" and rebuild the solution. Then hit F5 and see if it hits your breakpoint...once you can get it to actually hit a breakpoint, try to put a watch on the relevant line and come back and tell me what FileUpload.FileName is storing.
...And btw, what exactly is happening when you try assigning this value to Textbox1.Text? Are you getting an Object Reference not set to an instance of an object exception? Does the text get assigned an empty string? A little bit more information as to what exactly is happening might help diagnose the issue.
"I need build Skynet. Plz send code"
|
|
|
|
|
At first when the page open it will stop at the breakpoint which I marked, but when after clicking the "Browse" button and select any file the breakpoint won't stop.
And my configuration in web.config and in my page were set to debu="true".
Do you think the upload control can trigger the page_load or prerender event?
Any idea?
hifiger2004
|
|
|
|
|
hifiger2004 wrote: Do you think the upload control can trigger the page_load or prerender event?
ASP page events such as Page_Load and the PreRender events can not be selectively fired. Any time a page refreshes or posts back, the ASP page event lifecycle determines your processing order.
...If the upload button that you have on your page to submit the file is actually executing, you should be fine.
You do realize that the FileUpload control can't be used by itself, correct? You have to have another server control on the page that posts your FileUpload control's file to the server. Did you read the msdn entry that I posted in here? ...Read the whole thing including the example and Remarks section at the bottom(as I intended you to do when I posted it in the first place). It should have all of the information you need. You're probably trying to access the FileName before it is actually posted to the control....and if your breakpoint isn't being hit in a Page_Load, you have some kind of a configuration issue(which can be as extremely minor as selecting the wrong deployment mode)
hifiger2004 wrote: And my configuration in web.config and in my page were set to debu="true".
...What IDE are you using? Visual Studio? ...you need to make sure that the configuration MANAGER (not the config file) is set to "Debug" mode(the drop down box next to your "play" button) ...if you try to build in Release mode, the information required for debugging will not be generated.
"I need build Skynet. Plz send code"
|
|
|
|
|
I am using Visual Web Developer 2005 Express Edition. And the configuration also of the configuration Manager here is set to debug. But still no luck.
I'm having hard time for two days already about this issue
hifiger2004
|
|
|
|
|
If that is ALL of the code in your class(the first time I read it, I thought it was a snippet), then part of the reason you can't assign anything to the text property of the textbox is that the FileUpload control has no FileName specified for it. I honestly don't see what you are trying to do with this. You might need to consult some beginner's programming literature.
btw, never leave your controls with names like "TextBox1" and "FileUpload1"; rename them to something meaningful, for example "txtFilenameInput" and "upHomework" or whatever names would be applicable to your specific business rules.
"I need build Skynet. Plz send code"
|
|
|
|
|
when I added a button and place the code here - textbox1.text = FileUpload1.Filename, when I click the button it will display the filename in the textbox1, fine there's no problem.
But what I am trying to do is to display only the filename and not the complete filepath (c:/temp/temp.xls) of the file. Because in FileUpload control once you select a certain file it will bring up the entire filepath. That's why I am trying to make a program that will pass the Upload1.filename into the textbox1 (Filename alone, ex. temp.xls, temp.doc, temp.exe, etc.)
I hope you understand what I mean
hifiger2004
|
|
|
|
|
Hai,
I have a grid in my application with the revenue values of a company in one coloumn. I need to validate the data entered in that field and need to change the background color of that perticular field if it contains negetive value.
Thanks in advance......
Chandu.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
Add an event to the control you are willing to validate for value.
eg: textbox1.Attribututes.add("onclick","javascript:checker1();");
in the page load and write your validation script in the javascript.
|
|
|
|
|
Hi,
I’m using Visual Studio 2005 and Access 2000 on Win XP. (I have Access 2007 also, but I’m concerned about backward compatibility.)
After working as a computer programmer for years, I changed careers and became a school teacher. I still love to program, but I have fallen behind on the learning curve. I have plenty of experience with VB6, Access, and SQL Server, but I have zero experience with web apps.
I now want to develop a very simple website that lets students log in and check their grades and missing assignments. Can you suggest a good tutorial/example for a VERY SIMPLE web app that includes MS Access 2000?
Thanks,
Joe
|
|
|
|
|
I typically refer to google, MSDN and here if I have any questions on how to use any controls, methods or designers.
Here^ are the basic tutorials from microsoft. More still on msdn and, of course, all over codeproject. Just search around for objectdatasource and datasets and you'll find some examples that you'll be able to use.
|
|
|
|
|
Thanks ... especially for the asp.net link! I will check out the tutorials.
Joe
|
|
|
|
|
Hi,
The Microsoft set of tutorials has been helpful. Early in the first one, it mentions Style.css. While I have a general understanding of this file's purpose, the author does not detail its contents.
Working through the tutorials (1-3 so far), I am concerned that my results don't resemble those in the tutorial screen-shots (specifically my title, content place holder, and menu are just arranged in separate rows, one after the other).
Should I try to "fix" this now or later? On the one hand, I don't want to get bogged down at this point. I just want a VERY BASIC website that provides basic student access to grades and missing assignments. On the other hand, I don't mind integrating a .css file. Unfortunately, I don't know what to put in Style.css to make my project resemble the one in the tutorial.
Thanks,
Joe
|
|
|
|
|
You may like to check out http://www.dotnetspider.com/projects/[^] for a few sample projects.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Thanks! The sample projects will be very helpful.
Joe
|
|
|
|
|
If you are thinking of talking to a SQL Server database and want to see how modern tools can really make your productivity skyrocket, have a look at the Diamond Binding link in my signature
|
|
|
|
|
Hi Mark,
Thanks for the tip. SQL Server will be the next step, after I get the Access version working.
Because Access is popular in the schools where I work, I am focusing on it for now. This project entails a big web (and to a lesser extent, VS) learning curve for me. My SQL Server is rusty, too (versions 6/7).
Somehow I have to find time to teach the kids, too ... one step at a time.
Thanks,
Joe
|
|
|
|
|
Am developing a web application wherein I have a label in master page which has to get value from the web pages. When I develop a web site, I used to put a method in App_Code.
How do I do it here? Any particular approach to be taken?
Thanks,
simi
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
I'm a bit of an ASP newbie, but I'd either use javascript embeded in the master page or use the findcontrol method to obtain the control I need to modify/retrieve data from.
In both cases, you'll need to know the ID of the control you're looking for.
Yet another option is to search through Page.Controls for the control.
Hope that helps!
|
|
|
|
|
So, I've been dabbling in web development lately and decided to put drop down boxes in a header of a gridview in asp. One problem: since the gridview has 13 columns, I need to keep the drop down fairly small. Firefox takes this rather well. It expands the options inside the select despite the set width of their parent. IE7, on the other hand, isn't smart enough to do this and renders the options with the same width as their parent.
That said there are several solutions out there that involve using divs and radials to emulate select box behavior, and from there one could easily emulate drop down behavior. I think I'll take this approach and make a web control that utilizes the technique.
But my solutions are overly laborious. I'd like to know what solutions the Code Project would take for these shortcomings of IE.
|
|
|
|
|
Hello all,
I was wondering how to change the opacity of an image tag in Firefox, Opera, and Safari with a javascript. I figured out how to do it in IE. I also know that the style for the opacity is opacity or -moz-opacity. It works with IE but not in the other browsers. I believe that it should work but I must be missing something. So if anyone could take a look at this and see if you could find what I am over looking.
Thanks
Chad Dolan
Here is the script I wrote.
var current;
var interval;
var newImage = new Image();
var browser = navigator.appName;
var b_version = navigator.appVersion;
var version = parseFloat(b_version);
function fade(id, new_src)
{
current = document.getElementById(id);
newImage.src = new_src;
if(browser == "Microsoft Internet Explorer")
{
interval = setInterval("makeFadeOutIE()", 10);
}
else
{
interval = setInterval("makeFadeOutOther()", 10);
}
}
function makeFadeOutIE()
{
if(current.filters.alpha.opacity > 0)
{
current.filters.alpha.opacity = current.filters.alpha.opacity - 5;
}
else
{
if(window.interval)
{
clearInterval(interval);
current.src = newImage.src;
interval = setInterval("makeFadeInIE()", 10);
}
}
}
function makeFadeInIE()
{
if(current.filters.alpha.opacity < 100)
{
current.filters.alpha.opacity = current.filters.alpha.opacity + 5;
}
else
{
if(window.interval)
{
clearInterval(interval);
}
}
}
function makeFadeOutOther()
{
if(current.style.opacity > 0)
{
current.style.opacity = current.style.opacity - .05;
}
else
{
if(window.interval)
{
clearInterval(interval);
current.src = newImage.src;
interval = setInterval("makeFadeInOther()", 10);
}
}
}
function makeFadeInOther()
{
if(current.style.opacity < 1)
{
current.style.opacity = current.style.opacity + .05;
}
else
{
if(window.interval)
{
clearInterval(interval);
}
}
}
|
|
|
|
|