需要抓到產品的products id後再來新增圖片所對應的 products id
在資料庫中必需要設一個識別規格(identity)
insert into abc ( ProductsName ) VALUES (ProductsName ) ;SELECT @@IDENTITY;
insert into abc ( ProductsName ) VALUES (ProductsName ) ;SELECT @@IDENTITY;
<!-- 最大上傳檔案大小100MB(100*1024) TimeOut時間300秒 -->
<httpRuntime maxRequestLength="102400" executionTimeout="300"/>
</system.web>
string Path = Server.MapPath("txt/abcd.txt");//檔案路徑
using (StreamReader sr = File.OpenText(Path))
{
String input;
while ((input = sr.ReadLine()) != null)
{
//input如果不是null的話就會是一行文字
//做處理
}
}
h3 class='post-title下一行加上
<script>
document.write('<iframe src="http://www.facebook.com/plugins/like.php?href=<data:post.url/>&layout=standard&show_faces=true&width=450&action=like&font=verdana&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; verflow:hidden; width:450px; height:20px"></iframe>');
</script>
<b:includable id='comments' var='post'>下面加上
<div id='fb-root'/><script src='http://connect.facebook.net/zh_TW/all.js#appId=appid&xfbml=1'/><fb:comments expr:href='data:post.url' num_posts='2' width='500'/>
$(function () {
tb_init('a.thickbox, area.thickbox, input.thickbox');
imgLoader = new Image(); // preload image
imgLoader.src = tb_pathToImage;
});
改成
function pageLoad(sender, args) {
tb_init('a.thickbox, area.thickbox, input.thickbox');
imgLoader = new Image(); // preload image
imgLoader.src = tb_pathToImage;
}
參考http://www.cnblogs.com/lion/archive/2010/10/08/1845732.html
function tb_init(domChunk){
$(domChunk).click(function(){
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
tb_show(t,a,g);
this.blur();
return false;
});
}
改成
function tb_init(domChunk) {
$(domChunk).click(function() {
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
self.parent.tb_show(t, a, g);
this.blur();
return false;
});
}
忘記在那找到的方法了
function search(word){
$('#myiframe').attr('src', 'ProductsS.aspx?q=' + word + '');
}
<input id="abcd" maxlength="20" name="" size="20" type="text" value="" />
<input onclick="search(getElementById('abcd').value)" type="button" value="查詢" />
<asp:literal id="Literal1" runat="server"></asp:literal>.cs
string mUrl = Request.Url.AbsoluteUri;// 取得目前網址
Literal1.Text = string.Format("<img alt="簡單使用" src="https://chart.googleapis.com/chart?chs=120x120&cht=qr&chl={0}&choe=UTF-8&chld=M|2">", mUrl);
參數說明 其中:
chs: QR code 圖片大小 cht: 圖片類型,google charts用這個參數產生各種圖片,這裡當然就填qr chl: 要藏在QR code裡的文字,必須編成punycode(urlencode)。 choe: 編碼。請注意只支援iso-8859-1, sjis, utf8。詳見API說明網頁。 chld: 其他參數。M是錯誤修正層次,有L, M, Q, H等四級;後面的數字是QR code周圍白邊的寬度。參考網站:http://www.dotblogs.com.tw/shadow/archive/2011/02/24/21557.aspx
<script type="text/javascript">
function wopen(word) {
window.open('http://www.google.com/#hl=zh-TW&source=hp&q=' + word, 'Google');
}
</script>
<input class="submit" onclick="wopen(this.form.text.value);return true;" type="submit" value="Google搜尋">
<input id="text" name="keyword" type="text">
CKEDITOR.editorConfig = function(config) {
config.font_names = 'Arial;Arial Black;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana;新細明體;細明體;標楷體;微軟正黑體';
}
自訂義ToolBar ,網路上有許多ToolBar的說可自行找找
CKEDITOR.editorConfig = function(config) {
config.toolbar = 'MyToolbar';
config.toolbar_MyToolbar =
[
['Source', 'Preview', '-'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Link', 'Unlink', 'Anchor'],
['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'],
['Styles', 'Format', 'Font', 'FontSize'],
['TextColor', 'BGColor'],
['Maximize', 'ShowBlocks']
];
}
ScriptManager.RegisterStartupScript(this, this.GetType(), "提示訊息", "alert('完成');parent.tb_remove()", true);
關閉跳出來的ThickBox並重新整理
ScriptManager.RegisterStartupScript(this, this.GetType(), "提示訊息", "alert('完成');parent.tb_remove();var win = top.window; try{ if(win){ win.location.reload(); } }catch(ex){} ;", true);
關閉跳出來的ThickBox並重新整理iframe(myiframe)
ScriptManager.RegisterStartupScript(this, this.GetType(), "提示訊息", "alert('完成');parent.tb_remove();parent.myiframe.location.reload();", true);
關閉後點選母視窗的查詢按紐重整 s為判斷重整(看個人使用) b為button的id
ScriptManager.RegisterStartupScript(this, this.GetType(), "提示訊息", "alert('完成');parent.tb_remove();parent.document.getElementById('" + Request.QueryString["s"].ToString() + "').value=1;parent.document.getElementById('" + Request.QueryString["b"].ToString() + "').click(); ", true);
關閉後到指定的網頁
ScriptManager.RegisterStartupScript(this, this.GetType(), "提示訊息", "alert('完成');parent.tb_remove();var win = top.window; try{ if(win){ win.location.href='code.aspx'; } }catch(ex){};", true);
不關閉重整父頁面(b為父頁面的查詢 s為父頁面的一個隱藏欄位用來判段是查詢還是重整用的)
<input type="button" value="Detail" style="text-align: center;" onclick="tb_show('Detail','_Statement.aspx?type=modify&id=<%# Eval("ID_Statement") %>&b=<%# this.Button2.ClientID %>&s=<%# this.HiddenFieldStatus.ClientID %>&KeepThis=true&TB_iframe=true&height=550&width=750',null);" />
ScriptManager.RegisterStartupScript(this, this.GetType(), "提示訊息", "alert('完成');parent.document.getElementById('" + Request.QueryString["s"].ToString() + "').value=1;parent.document.getElementById('" + Request.QueryString["b"].ToString() + "').click(); ", true);
/// <summary>
/// 去除Html標籤
/// </summary>
///<param name="Html">
傳入一整個Ckeidtor文字。
public static string ReplaceHtmlTag(string Html)
{
Html = Regex.Replace(Html, "<[^>]*>", "");
return Html;
}