|
I tried using the text property but that property doesn't exist for a HttpServerControl.
|
|
|
|
|
this should be simple...i'm trying to set the text part of a file input with some javascript. only it won't do it. the alert below always comes up blank. what am i missing??
here's the html i have:
<input type="file" name="fileImage" value="something1">
and here's the javascript i have:
function image(theForm)
{
var test;
test = "something2";
theForm.fileImage.value = test;
alert(test);
}
thanks!
b
|
|
|
|
|
I hope someone has the answer to this
I have a site in regular old asp 3.0 on IIS 5 -windows 2000.
The site is basically a fancy FTP GUI so users can view files/folders and then download them. What I am trying to do is use the filesystemobject (vbscript) to get a list of the folders/files on a remote data share. I setup the IIS anonymous account to use a domain account instead of IUSER_ComputerName because this domain account has read/write/change permissions on both the IIS box and the data share. Now my problem is that when I run the code below, I am getting an error (not sure what the exact error is)
<br />
'//the UNC path is being pased with URL encoding<br />
ReportPath = Request.QueryString("UNC")<br />
<br />
Set fso = CreateObject("Scripting.FileSystemObject")<br />
'
If fso.FolderExists(ReportPath) Then<br />
Set aFolder = fso.GetFolder(ReportPath)<br />
<br />
For Each aFolder In aFolder.subfolders<br />
.....<br />
Next<br />
Else<br />
errMsg = "Folder/File does not exist or access is denied"<br />
End If<br />
why am I getting this? is it because I am not using a literal for the folder path or because I am not getting authenticated to the remote server?
When I tried this on my local box using VB, it worked fine as long as I didn't use a variable to refer to the UNC path. It may also have worked becuase I have a drive mapped to the UNC path.
I did find one or two articles on MSDN, but it is still unclear to me. This article seemed to have the most information...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnauth/html/dnauth_security.asp
any ideas? I'm so freakin' confused.
|
|
|
|
|
|
it would be helpful to let me know how to return the error instead of yelling at me.
but thanks anyway.
|
|
|
|
|
Sorry, don't get me wrong: I was not yelling at you, I was instructing you on:
1. Put a "On Error Resume Next" just before the line where the error occur.
2. Put a Response.Write("Error: " & Err) just after the line where the error occur.
3. Give me the error number so I can help you further...
My latest articles:
XOR tricks for RAID data protection
Win32 process suspend/resume tool
|
|
|
|
|
no worries.
using err.number - nothing is returned (i get a big fat zero).
here's the revised code
<br />
Set fso = CreateObject("Scripting.FileSystemObject")<br />
on error resume next<br />
If fso.FolderExists(DataShare) Then<br />
Set aFolder = fso.GetFolder(DataShare)<br />
For Each aFolder In aFolder.subfolders<br />
....<br />
Next<br />
Else<br />
sysErr = "Error Number " & err.number & " Error Description: " & err.Description <br />
errMsg = "Folder/File does not exist or access is denied"<br />
End If<br />
<br />
and just in case it matters the variable "DataShare" is equal to "\\servername\sharename\crp\Daily Reports\"
|
|
|
|
|
What is the error?
Also do you have Norton Antivirus with Script Blocking? I had problems with FileSystemObject also untill turned off Script Blocking in AV
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
I know that you should be able to do this...
I place my Connection control on the form and set it's properties..
I add a Command control on the form and set the SQL statement I want
I add my DropDowList control, set the dataSource property, set the properties to bind the text in the list and the values behind the text for my selection...
but when I run the form I get a blank dropDownList.
I can do the binding in code but I really don't think that I should have to.. This should work.
Any takers on this one. I am stumped.
|
|
|
|
|
I don't have much experience with using vstudio for webforms, so I don't know how much code it is generating, however, unlike windows forms, webforms cotnrols require an explicit DataBind() call.
If vstudio isn't generating that call, then you will need to write it.
|
|
|
|
|
Ray Cassick wrote:
but when I run the form I get a blank dropDownList.
As Andy said for WebForms you need to specificaly call the bind method when you want it, generally on Page_Load .
So in the Page_Load event put DataBind() bit.
|
|
|
|
|
Ok, I placed a Page.DataBind() in my Page_Load event and now I am getting the following error:
An invalid data source is being used for DropDownList1. A valid data source must implement either IListSource or IEnumerable.
Line 11:
Line 12:
Line 13: <asp:dropdownlist id="DropDownList1" style="Z-INDEX: 101; LEFT: 88px; POSITION: absolute; TOP: 88px" runat="server" width="184px" height="24px" datasource="<%# DataBinder.Eval(OleDbDataAdapter1, "SelectCommand") %>" autopostback="True" datamember="Products" datatextfield="ProductName" datavaluefield="ProductID">
Line 14:
Line 15:
When I attempt to bind the DropDownList, what do I set the data bindings to? I get a dlalog box that has alot of options in it, and I select the OleDbDataAdapter1.
|
|
|
|
|
You will need to set the datasource to a arraylist or dataset or datatable, etc
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Hi all !
I get this error when doing a POST to an processing page (no UI). How can I get rid of this? I dont want to use ViewState (and just want to catch the exception). Page.EnableViewState = false does not fix this. It seems the page wants it all the time!
More info:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The View State is invalid for this page and might be corrupted.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The View State is invalid for this page and might be corrupted.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.288; ASP.NET Version:1.0.3705.288
Thanx for helping
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Sorry, can't help , was wondering however, can we have a sneak preview at the site you are doing all this stuff on? Would love to see it.
Dave Goodman on funny error messages:
It is a definite no-no to run BITMAP as a user command. Your nose will grow, your lawn will die, your hair will fall out, and your first-born will marry an aardvark. Shame on you!
|
|
|
|
|
Megan Forbes wrote:
was wondering however, can we have a sneak preview at the site you are doing all this stuff on? Would love to see it.
Sure, when it is working a bit more like it should! At the moment it works OK, but I'm having problems with getting my "data" displayed correctly (need to take 2d data, then transform to 3d data, do a sort and then back to 2d data, so everything is displayed like it should, oo how I hate recursion!)
But I will let you all know as soon as its "viewable" and "semi-functional"! Hopefully by the end of the weekend!
PS. I did solve the problem!
protected override object LoadPageStateFromPersistenceMedium()
{
return null;
}
As I dont need it!
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Cool - looking forward to it
Dave Goodman on funny error messages:
It is a definite no-no to run BITMAP as a user command. Your nose will grow, your lawn will die, your hair will fall out, and your first-born will marry an aardvark. Shame on you!
|
|
|
|
|
I have noticed that some sites include an icon in IE address bar and when a favourite is made, it also has an icon.
How do they do this?
Thank you!
|
|
|
|
|
|
Hmmm... you typed your msg 4 minutes quicker than me... Chris must be feeling happy to have his articles advertised so many times
Dave Goodman on funny error messages:
It is a definite no-no to run BITMAP as a user command. Your nose will grow, your lawn will die, your hair will fall out, and your first-born will marry an aardvark. Shame on you!
|
|
|
|
|
Megan Forbes wrote:
Chris must be feeling happy to have his articles advertised so many times
As should he....
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
It's a file called favicon.ico - you make a little bmp and place it in the root of your webproject. Only problem is - half the time it doesn't work. Chris kindly did an article on it http://www.codeproject.com/html/favicon.asp[^]. Codeproject has Bob sitting there - if you can't see it on your browser it just means your browser is not behaving (have yet to find a way to fix this - mine's had no pocket money and is currently grounded for this), not that the CodeProject site is broken.
HTH
Dave Goodman on funny error messages:
It is a definite no-no to run BITMAP as a user command. Your nose will grow, your lawn will die, your hair will fall out, and your first-born will marry an aardvark. Shame on you!
|
|
|
|
|
Hi all, my DQOTD
OK ok I post a form with a textarea back to the server, now how do I read that? I got to
if (Request.HttpMethod == "POST")
{
Request.ContentLength;
Request.ContentType;
Request.Form["TextBox1"];
}
Someone mite find this handy
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
leppie wrote:
now how do I read that? I got to
Wow that is quite a complex way of getting at the elements value.
You can just use var strDescription = Request.Form["TextBox1"]; btw, no need for the rest.
And I see you are using JScript on the server side and not VBScript, enjoying it? David Wulff would be proud.
|
|
|
|
|
Paul Watson wrote:
You can just use var strDescription = Request.Form["TextBox1"]; btw, no need for the rest.
Thanx Paul, as I was writing the post I was trying to give as much as possible info, then I realised that line was the answer
Paul Watson wrote:
And I see you are using JScript on the server side and not VBScript, enjoying it? David Wulff would be proud.
I use C# server-side! And JavaScript client-side. How did you get to that conclusion?
Cheers
PS: I hate being offline halve the day!!!
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|