|
Well this is the code I have!
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Server.MapPath("/test/"))
Set fc = f.Files
For Each f1 in fc
if right(lcase(f1.name),4) = ".gif" then Response.Write("
")
Next
%>
And in this code I need to read in the text file so the image is ahown and then the text. How do I do that with the code you give me?
|
|
|
|
|
are you using asp.net or asp 3? cause the code i have given you will only work in asp.net. if you wanted to do this in asp 3 you would have to have do something like:
<br />
'get the file path -<br />
Set txtFilePath = Replace(f1.name, right(lcase(f1.name),4), ".txt")<br />
<br />
'then read the file using fso<br />
dim txtStream<br />
Set txtStream = fso.OpenTextFile(txtFilePath, fsoForReading)<br />
<br />
'the write the string out<br />
Response.Write txtStream.ReadAll<br />
txtStream.Close<br />
im a bit rusty in this area but this should give you more or less an idea!
|
|
|
|
|
Hi,
I have a textarea that is used for a description. After I add it to the database and display it to the user, then it doesn't add the spaces (new line) between each paragraph, instead it adds all the text to one piece of text. How do I cater for this?? I am using C# 2.0.
How do I limited the number of characters entered into a textarea to 200? There is a property that I set, but I could still insert text way over 200.
Regards,
ma se
|
|
|
|
|
Use a multilines textbox
keep Learning and you never will be out of date...
|
|
|
|
|
Hi,
I am Ravindra,Currently doing a project in ASP.net.
My problem is:
I want to get back the focus on submit button ,when Validation summary control displays " The required fields are to be entered".
If anybody know please help.
thanks in advance............Ravindra
|
|
|
|
|
Hi,
Popup is not open in my web application,My application has Login page,Is any relation between sessions and popup
I used windows.open(...
Whats the cause?
Thanks
Srilakshmi
|
|
|
|
|
Hi,
Do you get any error messages in the status bar? If yes kindly send the error description.
Regards
sarathy
Know is Drop, Unknown is Ocean
|
|
|
|
|
Hello,Iam not getting any error in status bar
|
|
|
|
|
Also check whether popup is blocked in the browser.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
Popup is not blocked in my browser
|
|
|
|
|
What code exactly are you using?
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,ThankU
In Page Load
lnksendMail.Attributes.Add("Click", "openpopup()")
i called javascript function,when clicking on the asp link button
function openpopup()
{
window.open ("template.htm","mywindow","location=1,status=1,scrollbars=1,width=100,height=100");
example=window.moveTo(100,100);
return;
}
|
|
|
|
|
Man you have done a small mistake.
srilu nagalla wrote: lnksendMail.Attributes.Add("Click", "openpopup()")
It will be:
lnksendMail.Attributes.Add("onClick", "openpopup();")
This will work perfectly fine.
Best Regards,
Apurva Kaushal
|
|
|
|
|
|
Always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
I had a problem with insert command,It is working perfecly for some times and giving syntax error for the some times.In which cases this will be possible,Any specific reasons,i have placed it in try catch block .I have 50 columns to insert into database and checked all the datatypes and punctuations correctly.
|
|
|
|
|
|
|
It sounds like you are not encoding your strings correctly. If a string value can contain characters that break the syntax, it has to be encoded.
What database are you using?
---
b { font-weight: normal; }
|
|
|
|
|
I am using sqlserver,and i have given each column in a seperate line,bcz of this problem.but still it is giveing like syntax error at line1.
why any solution,i ckecked all the syntax and datatypes.
How to encode in asp.net for character display or insertion.
I have more than 25 columns with nvarchar datatype
-- modified at 5:48 Friday 29th September, 2006
|
|
|
|
|
|
The error message is referring to the line in the SQL query, not in the ASP.NET code, as the syntax error is in the query, not in the ASP.NET code.
If you are creating the query by concatenating strings rather than using Parameter objects, you have to encode the string values that you put in the query.
For MS SQL Server you have to encode the apostrophe character, as that is used to surround the string values. An apostrophe inside a string is written as two apostrophes, so you have to replace any apostrophes in string values with two apostrophes:
... ,'" + aValue.Replace("'", "''") + "', ...
---
b { font-weight: normal; }
|
|
|
|
|
I don't understand your solution.
I have a similar problem with Multiview + UpdatePanel + Validator
explication :
This problem I’m having with validators on an update panel is not the one where there is an invalid postback, but it may be related. This problem is occuring when I have a validator on a view inside of a multiview inside of an update panel.
Here’s my setup.
1. ScriptManager with Partial Rendering enabled.
2. Update panel with Mode set to always.
3. Multiview inside of update panel.
4. 2 views inside of multiview.
5. View #1 has textbox and required field validator
6. View #2 just has a textbox.
7. Previous and Next buttons.
When page loads I enter a value in textbox on view #1, thus satisfying the validator. I click next to go to view #2. All is good. I click previous to return to view #1. Error occurs (javascript). VS breaks into the function ValidatorGetValue(id). Specifically, it breaks on the line reading “if (typeof(control.value) . . . .”. When I hover over the control variable it is reading “null”. The error reads: ‘null’ is null or not an object. The id being passed in is the ClientID of the textbox on view #1. But I’m guessing that view has not yet been rendered to the browser.
// Code Break
function ValidatorGetValue(id) {
var control;
control = document.getElementById(id);
if (typeof(control.value) == "string") {
return control.value;
}
return ValidatorGetValueRecursive(control);
}
The lower left corner of IE indicates a javascript error:
Line: 104
Char: 5
Error: 'null' is null or not an object
Code: 0
URL: <the page="" url="">I can put "CausesValidation = false" for my 2 button (Next and previous) and I would not have any problem, but I don't want to do it !
Is there an other solution ? or not ? i change their sequence but problem exist
|
|
|
|
|
If i don't want to use javascript to perform comfirmation message box function, so i want to display a pop up message box display yes/no for user. so, when i using messagebox.show , it not run.So , for displaying messagebox for client pc, how should i do? any idea ?
thanks.
p/s: for addition information, this button run as delegate event handler, actually i also not sure what is "delegate event handler". I only know that code for this button is not coding inside the btn_click events, is write inside another function, so i want adding the comfirmation message box inside that function instead of btn_click event.
-- modified at 4:15 Friday 29th September, 2006
Best regards,
Chee ken
|
|
|
|
|
try to use
System.Windows.Forms.MessageBox.Show("Hello");
|
|
|
|