How can I check whether the file exists?
For all the File manipulation function the namespace System.IO; has to be included. The existence of a file can be checked by the following syntax , File.Exists(path); where path is the path of the file name. The code can be as. if(File.Exists(‘C:\\dict.txt’)) { Response.Write(‘File Exists’); } else { Response.Write(‘File Not Found’); }
How can I include file through the ASPX?
The files can be included by the following syntax <!–include file=’filename’–> <table> <tr> <td> <!–#include file=’sample.html’–> </td> </tr> </table> Now the sample.htm will be displayed in the aspx page.
How can ASPX pages been refreshed perdiodically?
The meta tag has to be include which automatically refresh the page every n second. <meta http-equiv=’Refresh’ content=’nn’>
How can a ClientSideEvent can be attached to a Custom control?
We can add any ClientSideEvent like Onclick,OnBlur in the Render Method as, protected override void Render(HtmlTextWriter writer) { _button.Attributes.Add(‘OnClick’,’JavascriptClickFunction’); }
How can the output cache can be enabled?
Output Cache can be enabled by the following line <%@ OutputCache Duration=’60’%> This will make the page to be cached for 60 seconds.