473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Detect the files exist or not

My asp.net web page will allow user to d/l the invoice and PO .
there are two buttons. (invoice and PO) in the datagrid ( i use repeater)
however, not every invoice got the PO , so I need to detect whether the PO
(pdf exists or not ), if the files doesn't exit, I need to make the button
's visible =.F.
How can I do that in aspx.vb

Thanks a lot
Oct 16 '06 #1
2 1213
System.IO.File.Exists method will tell you if the file exists.

You need to handle ItemDataBound event for the repeater. In the event set
the button visibility depending on the System.IO.File.Exists method result.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Agnes" <ag***@dynamictech.com.hkwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
My asp.net web page will allow user to d/l the invoice and PO .
there are two buttons. (invoice and PO) in the datagrid ( i use repeater)
however, not every invoice got the PO , so I need to detect whether the PO
(pdf exists or not ), if the files doesn't exit, I need to make the button
's visible =.F.
How can I do that in aspx.vb

Thanks a lot

Oct 16 '06 #2
Use the File.Exists method in the System.IO namespace.

Here's more info:
http://msdn2.microsoft.com/en-us/lib...le.exists.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
"Agnes" <ag***@dynamictech.com.hkwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
My asp.net web page will allow user to d/l the invoice and PO .
there are two buttons. (invoice and PO) in the datagrid ( i use repeater)
however, not every invoice got the PO , so I need to detect whether the PO
(pdf exists or not ), if the files doesn't exit, I need to make the button
's visible =.F.
How can I do that in aspx.vb

Thanks a lot

Oct 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Glen | last post by:
I'm writing a console utility to download specific files from web sites based on the command line options. In most cases, I can trap the 404 error when the file isn't available because the...
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
3
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect...
1
by: Mike Kim | last post by:
Hello folks, I need your help!! I want to write an application, probably windows service, to detect if anyone using the client pc have visited other url other than home page that was set, and...
5
by: phillip.s.powell | last post by:
$sql = "SELECT IF((SHOW TABLES LIKE '$subselectTableName'), count(*), NULL) AS numRows FROM $subselectTableName"; I am trying to write a SQL statement that will tell me if a table exists or not,...
32
by: Olivier | last post by:
Dear all, I thought the code ----------------------------- pt_fichier_probleme = fopen(nom_fichier, "w"); if(pt_fichier_probleme == NULL){ message_warning_s ("Erreur l'ouverture du...
1
by: jamesmcdonagh | last post by:
Hi newbie using nAnt for .net 2.0. I would be happy of any help that you may be able to provide. The weird thing is that VS.net builds without a problem. And the intellisense within the object...
4
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is...
5
by: Edgard Guilherme | last post by:
Hello all, b4 anything, i am using iis smtp to send the emails.. is there anyway to detect if the "To" email is a valid one ? Like for eg. To = sadjwqewe@askjqw.com (so this email of course...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.