41. What classes are needed to send e-mail from an ASP.NET
application?
The classes MailMessage and SmtpMail have
to be used to send email from an ASP.NET application. MailMessage and SmtpMail
are classes defined in the .NET Framework Class Library's System.Web.Mail
namespace.
42. Why do some web service classes derive from System.Web.WebServices
while others do not?
Those Web Service classes which employ
objects like Application, Session, Context, Server, and User have to derive
from System.Web.WebServices. If it does not use these objects, it is not
necessary to be derived from it.
43. What are VSDISCO files?
VSDISCO files are DISCO files that enable
dynamic discovery of Web Services. ASP.NET links the VSDISCO to a HTTP handler
that scans the host directory and subdirectories for ASMX and DISCO files and
returns a dynamically generated DISCO document. A client who requests a VSDISCO
file gets back what appears to be a static DISCO document.
44. How can files be uploaded to Web pages in ASP.NET?
This can be done by using the
HtmlInputFile class to declare an instance of an <input
type="file" runat="server"/> tag. Then, a byte[] can be
declared to read in the data from the input file. This can then be sent to the
server.
45. How do I create an ASPX page that periodically refreshes
itself?
The following META tag can be used as a
trigger to automatically refresh the page every n seconds:
<meta http-equiv="Refresh"
content="nn">
46. How do I initialize a TextBox whose TextMode is
"password", with a password?
The TextBox’s Text property cannot be used
to assign a value to a password field. Instead, its Value field can be used for
that purpose.
<asp:TextBox Value="imbatman"
TextMode="Password" ID="Password"
Runat="server" />
47. Why does the control's PostedFile property always show null
when using HtmlInputFile control to upload files to a Web server?
This occurs when an
enctype="multipart/form-data" attribute is missing in the
<form> tag.
48. How can the focus be set to a specific control when a Web form
loads?
1. This can be achieved by using
client-side script: document.forms[0].TextBox1.focus ()
2. The above code will set the focus to a
TextBox named TextBox1 when the page loads.
49. How does System.Web.UI.Page's IsPostBack property work?
IsPostBack checks to see whether the HTTP
request is accompanied by postback data containing a __VIEWSTATE or
__EVENTTARGET parameter. If there are none, then it is not a postback.
50. What is WSDL?
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos
0 comments
Post a Comment