Source : http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/

<!–

var viewportwidth;
var viewportheight;

// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

if (typeof window.innerWidth != 'undefined')
{
viewportwidth = window.innerWidth,
viewportheight = window.innerHeight
}

// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0)
{
viewportwidth = document.documentElement.clientWidth,
viewportheight = document.documentElement.clientHeight
}

// older versions of IE

else
{
viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
viewportheight = document.getElementsByTagName('body')[0].clientHeight
}
document.write('

Your viewport width is ‘+viewportwidth+’x'+viewportheight+’

‘);
//–>

var pattern = @”unquie\[(.+?)\]“;
var query = “unquie[2]unquie[3]“;

var matches = Regex.Matches(strTest, pattern);
foreach (Match m in matches) {
Response.Write(m.Groups[1]);
}

[WebMethod]
public static string FolderNameExist(string name, string id) {
DbFunctions db = new DbFunctions();
SqlCommand cmd = new SqlCommand(“SELECT * FROM Table”);

string result = db.ExecuteScalar(cmd);
return result == “0″ ? “OK!” : “*Folder name exist.”;

}

$.ajax({
type: “POST”,
url: “/FolderMgt.aspx/FolderNameExist”,
data: “{ \”name\” : \”" + $textbox.val() + “\”, \”id\” : \”" + $(“#hidId”).val() + “\” }”,
contentType: “application/json; charset=utf-8″,
dataType: “json”,
success: function(response) {
$span.html(response.d);
},
error: function(result) { alert(result.status + ‘ ‘ + result.statusText); }
});

var regWordonly = /[^a-zA-Z0-9_\-]/g;
text = text.replace(regWordonly, “”);

Orignal Post: http://www.sql-server-performance.com/articles/per/operations_no_cursors_p2.aspx

But i have modfiy the sql as below:

DECLARE @iNextRowId int,
@iCurrentRowId int,
@iLoopControl int,
@rowValue nvarchar(255)

– Initialize variables
SELECT @iLoopControl = 1
SELECT @iNextRowId = MIN(id) FROM #table

– Make sure the table has data.
IF ISNULL(@iNextRowId,0) != 0
BEGIN

– start the main processing loop.
PRINT ‘START’
WHILE @iLoopControl = 1
BEGIN
— This is where you perform your detailed row-by-row
— processing.
— Reset looping variables.

SELECT @iCurrentRowId = id, @rowValue = value FROM #table WHERE id = @iNextRowId
PRINT @rowValue + ‘ (ID: ‘ + CAST(@iCurrentRowId as varchar(1000)) +’, Next Row ID: ‘+ CAST(@iNextRowId as varchar(1000)) +’)’

–SELECT @iNextRowId = NULL
– Get the next iRowId
SELECT @iNextRowId = MIN(id) FROM #table WHERE id > @iCurrentRowId

IF ISNULL(@iNextRowId,0) = 0
BREAK;

END –END WHILE LOOP
END –END Check table has data

Response.Cache.SetCacheability(HttpCacheability.NoCache);

先了解一下Brower「上一頁」的原理,
Browser「上一頁」是一種Cache機制,將WebPage暫存在Browser端,以省下loading的時間。
若只是瀏覽Web,「上一頁」機制是很讚的。可處理敏感性資料就頭痛了。

解法就是把該Cache關掉就行了。

http://rely1020.blog.ithome.com.tw/post/1606/60106

http://www.geekzilla.co.uk/View86FE27C3-E286-4EC7-8275-6E0D8BB58C42.htm

private string replaceString = “”;
public string Parse(string content)
{
const string regTagName = @”<.[^>]*>”;

Regex reg = new Regex(@”(” + regTagName + “)|(geekzilla)”,
RegexOptions.IgnoreCase | RegexOptions.Multiline);

// this is what I’d like to replace the match with
replaceString = “$1“;

// do the replace
content = reg.Replace(content, new MatchEvaluator(MatchEval));

return content;
}

protected string MatchEval(Match match)
{
if (match.Groups[1].Success)
{
// the tag
return match.ToString();
}
if (match.Groups[2].Success)
{
// the text we’re interested in
return Regex.Replace(match.ToString(), “(.+)”, replaceString);
}
// everything else
return match.ToString();
}

var reg = /[^a-zA-Z0-9_\-]/g;
$(this).val($(this).val().replace(reg, “”));

http://stackoverflow.com/questions/901115/get-querystring-with-jquery

function getParameterByName( name )
{
name = name.replace(/[\[]/,”\\\[").replace(/[\]]/,”\\\]”);
var regexS = “[\\?&]“+name+”=([^&#]*)”;
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return “”;
else
return decodeURIComponent(results[1].replace(/\+/g, ” “));
}

http://www.dotblogs.com.tw/phoenix7765/archive/2008/11/14/5987.aspx

 

January 2012
S M T W T F S
« Mar    
1234567
891011121314
15161718192021
22232425262728
293031  

Pages

Top Clicks

  • None
Follow

Get every new post delivered to your Inbox.