mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
DotNET

C# 字符串 前面 美元符号

内插字符串以美元符号$开头,后面跟一个""包含的字符串,字符串中大括号包含的内容会由编译器计算成一个字符串,如果是对象的话就会调用对象的ToString方法,然后拼接产生结果。 如果要在内插字符串中包含大括号,就需要连续两个大括号{{ }}这样的。单大括号里的内容不仅仅可以是一个值,表达式也可以 string name = "microsoft"; int age = 23; Console.WriteLine("{0} is {1} years old.", name, age); //使用内插字符串 Console.WriteLine($"{name.ToUpper()} is {age * 2} years old.");

2018-02-19 0comments 159hotness 0likes mikebai Read all
DotNET

sharepoint popup窗体间传值和子画面表格数据排序

-----父窗体------ <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="MySharePoint" Namespace="SharePointProject2" Assembly="$SharePoint.Project.AssemblyFullName$" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CaseAdd.ascx.cs" Inherits="SharePointProject2.CONTROLTEMPLATES.CaseAdd" %> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <style type="text/css">     td {         min-height: 40px;     } </style> <script>     function openDialogAndReceiveData(tUrl, tTitle)     {         var options = {             url: tUrl,             title: tTitle,             dialogReturnValueCallback: onPopUpCloseCallBackWithData         };         SP.UI.ModalDialog.showModalDialog(options);     }     function onPopUpCloseCallBackWithData(result, returnValue)     {         if (result == SP.UI.DialogResult.OK)         {             SP.UI.Status.removeAllStatus(true);             var sId = SP.UI.Status.addStatus("Data successfully populated to text boxes from Pop-up");             SP.UI.Status.setStatusPriColor(sId, 'green');             document.getElementById('<%= txtid.ClientID %>').value = returnValue[0];             document.getElementById('<%= txtLawyerName.ClientID %>').value = returnValue[1];             document.getElementById('<%= txtCountry.ClientID %>').value = returnValue[2];             document.getElementById('<%= txtCity.ClientID %>').value = returnValue[3];         }         else if (result == SP.UI.DialogResult.cancel)         {            …

2017-12-25 0comments 140hotness 0likes mikebai Read all
DotNET

SPS中弹窗传值

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="MySharePoint" Namespace="SharePointProject2" Assembly="$SharePoint.Project.AssemblyFullName$" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CaseAdd.ascx.cs" Inherits="SharePointProject2.CONTROLTEMPLATES.CaseAdd" %> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <style type="text/css">     td {         min-height: 40px;     } </style> <script>     function openDialogAndReceiveData(tUrl, tTitle)     {         var options = {             url: tUrl,             title: tTitle,             dialogReturnValueCallback: onPopUpCloseCallBackWithData         };         SP.UI.ModalDialog.showModalDialog(options);     }     function onPopUpCloseCallBackWithData(result, returnValue)     {         if (result == SP.UI.DialogResult.OK)         {             SP.UI.Status.removeAllStatus(true);             var sId = SP.UI.Status.addStatus("Data successfully populated to text boxes from Pop-up");             SP.UI.Status.setStatusPriColor(sId, 'green');             document.getElementById('<%= txtLawyerName1.ClientID %>').value = returnValue[0];             document.getElementById('<%= txtCountry1.ClientID %>').value = returnValue[1];             document.getElementById('<%= txtCity1.ClientID %>').value = returnValue[2];         } else if (result == SP.UI.DialogResult.cancel)         {             SP.UI.Status.removeAllStatus(true);             var sId = SP.UI.Status.addStatus("You have cancelled the Operation !!!");…

2017-12-23 0comments 133hotness 0likes mikebai Read all
DotNET

SPS log 路径

%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\16\LOGS\

2017-12-19 0comments 137hotness 0likes mikebai Read all
DotNET

jquery popup数据传递

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.WebForm2" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title></title>     <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />     <script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>     <script src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>     <script>         function popupWin()         {             var url = "/WebForm1.aspx";             var newWin = window.showModelDialog(url, window, '');             newWin.open();         }         function popUp()         {             var url = "/WebForm1.aspx";             objSubWin = window.open(url, "Popup", "toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=0,width=600,height=500");             objSubWin.focus();         }         function popUp2()         {             var url = "/WebForm1.aspx";             opendialog(url);         }         //$("#somediv").click(function ()         //{         //});         //https://api.jqueryui.com/dialog/#option-buttons         function opendialog(page)         {             var $dialog = $('#somediv')                 .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')                 .dialog({                     title: "Page",                     autoOpen: false,        …

2017-12-15 0comments 162hotness 0likes mikebai Read all
dev

DbHelper

using System; using System.Configuration; using System.Data; using System.Data.Common; using System.Collections; using System.Text.RegularExpressions; using System.Data.SqlClient; using System.Collections.Generic; namespace WebApplication1 {     public abstract class DbHelper     {         public static void SetTimeoutDefault()         {             Timeout = 30;         }         public static int Timeout = 30;         public static string CONN_STR = "";         public static SqlConnection Conn = null;         private static void PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, CommandType cmdType, string cmdText, List<SqlParameter> sqlParas)         {             if (conn.State != ConnectionState.Open)                 conn.Open();             cmd.Connection = conn;             cmd.CommandText = cmdText;             if (trans != null)             {                 cmd.Transaction = trans;             }             cmd.CommandType = cmdType;             cmd.CommandTimeout = Timeout;             if (sqlParas != null)             {                 foreach (SqlParameter parm in sqlParas)                     if (parm != null)                         cmd.Parameters.Add(parm);        …

2017-12-15 0comments 139hotness 0likes mikebai Read all
DotNET

SharePoint custom SaveButton

    public class MySaveButton : SaveButton     {         protected override void OnInit(EventArgs e)         {             base.OnInit(e);             this.Text = "XXX添加XXX";         }         protected override bool SaveItem()         {             //custom code             ItemContext.ListItem.Fields["SaveStatus"].ValidateParseAndSetValue(SPContext.Current.ListItem, "save");             //ASP._controltemplates_15_productadd_ascx             TextBox txtGetValueFromSavaButtonClass =(TextBox)this.TemplateControl.FindControl("txtGetValueFromSavaButtonClass");             bool result = base.SaveItem();             return result;         }         //C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\TEMPLATE\CONTROLTEMPLATES         protected override string DefaultTemplateName         {             get             {                 return "MySaveButton";                 //検索条件  "RenderingTemplate ID=\"SaveButton"                 //C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\TEMPLATE\CONTROLTEMPLATES\DefaultTemplates.ascx(1874, 13)                 //[UTF - 8]: < SharePoint:RenderingTemplate ID = "SaveButton" runat = "server" >             }         }         //protected override bool OnBubbleEvent(object source, EventArgs e)         //{         //    ItemContext.ListItem.Fields["Product Description"].ValidationMessage = "asd";         //    return base.OnBubbleEvent(source, e);         //}    …

2017-12-14 0comments 137hotness 0likes mikebai Read all
杂七杂八

SharePoint ListFieldIterator

    public class MyListFieldIterator : ListFieldIterator     {         protected override void OnInit(EventArgs e)         {             base.OnInit(e);             //SPContext.Current.FormContext.OnSaveHandler += new EventHandler(CustomOnSave);         }         protected void CustomOnSave(object sender, EventArgs e)         {         }         protected override bool IsFieldExcluded(Microsoft.SharePoint.SPField field)         {             bool result = base.IsFieldExcluded(field);             if (!result)             {                 //bool result2 = BaseIsFieldExcluded(field);                 //If field matches the name of exclude it                 if (field.InternalName == "MemoWithHistory"|| field.InternalName == "MemoWithHistory2")                 {                     return true;                 }             }             return result;         }     } } <MySharePoint:MyListFieldIterator runat="server"  /> <%--<SharePoint:ListFieldIterator runat="server" />--%>

2017-12-14 0comments 168hotness 0likes mikebai Read all
DotNET

asp:Repeater 例子

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <%@ Import Namespace="System.Data" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title></title>     <style>         .table {             border: 1px double #A3D1AD;             margin-top: 5px;             margin-bottom: 5px;             background: #FFFFFF;             font-size: 12px;         }         /*选中时式样*/         .TR_BG {             background-color: #E4FCCB;             font-size: 12px;         }         /*非选中时式样*/         .TR_BG_list {             background-color: #F4FFE8;             font-size: 12px;         }         .sys_topBg {             color: #47974B;             font-size: 14px;             text-decoration: none;             font-weight: bold;         }     </style>     <script>         function SelectAll(f, mode)         {             if (mode == true)             {                 for (i = 0; i < f.length; i++)                 {                    …

2017-12-13 0comments 146hotness 0likes mikebai Read all
DotNET

Use SharePoint people pickers on Project Server or Online PDPs

https://gallery.technet.microsoft.com/projectserver/Use-SharePoint-people-cc8289de Project Server PDPs (Project Detail Pages) have the facility to host Project level enterprise custom fields for users to edit.   Out-of-the-box Project Server supports Cost, Date, Duration, Flag, Number and Text - but not fields of type Person. With the supplied Javascript, you can transform any 'Single Line Of Text' field into a SharePoint people picker.

2017-12-09 0comments 130hotness 0likes mikebai Read all
1…1819202122…62

Recent Posts

  • c# winform适配高dpi
  • com.microsoft.sqlserver.jdbc.SQLServerException “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server建立安全连接
  • java -cp 用法介绍
  • HTML 容器元素
  • MVC的cshtml的介绍

Recent Comments

No comments to show.

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang