To add controls to the Visual Studio IDE from an assembly, just drag this assembly or DLL from Windows Explorer to
VS IDE toolbox and you will get all the controls showing on the Toolbox.
To call a Web service using basic authentication us the following;
using System.Net;
localhost.MyWebService myService = new localhost.MyWebService();
System.Net.CredentialCache myCredentials = new System.Net.CredentialCache();
NetworkCredential netCred = new NetworkCredential("UserName", "Password");
myCredentials.Add(new Uri(myService.Url), "Basic", netCred);
myService.Credentials = myCredentials;
Request Validation - Preventing Script Attacks You can turn off the protection for a single page by
inserting this directive at the top:
<%@ Page="" validateRequest="false" %>
Or you can turn it off for the entire website in the web.config file:
<configuration>
<system.web>
<pages validateRequest="false" />
</system.web>
</configuration>
When adding key/value items to a hashtable the rows will be sorted in a way follows the items are
effective in the order of the hashed that are generated by the keys.
http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/d771e4bb-721c-4c68-bffd-6142e0f7e0c7/.
Thefore its better either to create a collection object or use the System.Collection.Specialised.ListDirectory
which sorts the records in the order was entered.
Gridview.DataKeys[e.Row.RowIndex].Value can be used to get the key of a specific row in a GridView.
If the row was selected then .DataKeys[gridview.SelectedIndex].Value.
SELECT TOP 1
@transactionID = req_transactionID
FROM
master..syslockinfo l
INNER JOIN
master..sysprocesses p ON l.req_spid = p.spid AND l.rsc_dbid = p.dbid AND p.spid = @@spid
WHERE
l.rsc_dbid = db_id() AND p.open_tran != 0 AND req_transactionID > 0
ORDER BY
req_transactionID
To get a Web page file name use the following:
System.IO.Path.GetFileName(System.Web.HttpContext. Current.Request.Url.AbsolutePath)
To submit parameters from one page to another that can be in many ways:
a)Query Strings
b)Previous Page
c)Session in the base form
d)ViewState in the page (please test)
When applying a print.css to a master page, if the content page has the theme referencing an existing them,
then it does not show an image. The way to do it is to use this statement in the Css file;
@media print
{
…Print Css tags
}
@media screen
{
….Normal Css tags
}
A javascript link can be used to call a javascript function as below:
<a href="javascript:;" onclick="openWindow('../../Pages/Help/PopupForms/SelectDisplayType.aspx')">
<img src="../../images/icons/question_sm.gif" border="0" tabindex="-1" />
</a>