2008 is far away from us, and 2009 has arrived for almost two months. 2009 of the work pressure will grow bigger and bigger in the future, and we hope our technology can go further.
1. Get GUID ()
ProgramMedium: guid. newguid (). tostring (). Replace ("-", ""). toupper ();
SQL: Replace (newid (),'-','')
2. Ajax pop-up window
Scriptmanager. registerclientscriptblock (button1, button1.gettype (), "onclick", "alert ('added successfully'); window. location. href = 'default. aspx '; ", true); [available in vs2008]
3. how to Prevent Users From clicking
protected void page_load (Object sender, eventargs e)
{< br> If (! Ispostback)
This. button1.attributes. add ("onclick", "this. disabled = 'false'; "+ this. getpostbackeventreference (button1);
}< br>
protected void button1_click1 (Object sender, eventargs e)
{< br> If (! Page. isvalid) return;
for (INT I = 0; I <20000; I ++)
{< br> Kong + = "AA" + I. tostring ();
}< br> ....
}
4. How to Prevent JS files from being referenced after a file references a master page?
Method 1: Add a reference to the CS file on the master page.
This. Page. clientscript. registerclientscriptinclude ("testinclude", this. Context. response. applyapppathmodifier ("~ /Cminclude/fslbasecsript. js "));
Method 2: add reference to the page file on the master page
<LINK rel = "stylesheet" href = "<% = page. resolveclienturl ("~ /CSS/web_css.css ") %>" type = "text/CSS">
<Script language = "JavaScript" src = "<% = page. resolveclienturl ("~ /Mmweb/JavaScript/common. js ") %>"> </SCRIPT>
5. Obtain the path
Request. url. Host get the Host Header of this instance;
Request. url. absoluteuri get the absolute URL;
Request. url. absolutepath get absolute path