- 博客(93)
- 收藏
- 关注
原创 mvc custom validation(check box)
c# code [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] public class IsTrueAttribute : ValidationAttribute, IClientValidatable { public override bool IsValid(objec
2015-11-04 19:45:37 460
原创 Action Result
public ViewResult Index() { return View("Homepage"); }type method return the typeViewResult return View();PartialViewResultreturn PartialView();Redire
2014-01-01 19:24:04 508
原创 Get Data from context objects
Request.QueryString Request.Form Request.Cookies Request.HttpMethod Request.Headers Request.Url Request.UserHostAddresRouteData.Route RouteData.Values HttpContext.ApplicatioHttpCon
2013-12-31 18:03:11 601
转载 read csv file. TextFieldParser
TextFieldParser reads in CSV files. With it, we specify a delimiter string, and then can read in the fields of every line in a loop. We can use the TextFieldParser instead of string.Split. We de
2013-08-14 22:49:34 1874
原创 get current project path
string path = AppDomain.CurrentDomain.BaseDirectory/*This is the best option all round. It will give you the base directory for class libraries, including those in ASP.NET applications.*/string s
2013-08-14 22:42:54 768
原创 get current url in current page
string url = HttpContext.Current.Request.Url.AbsoluteUri;// http://localhost:1302/TESTERS/Default6.aspxstring path = HttpContext.Current.Request.Url.AbsolutePath;// /TESTERS/Default6.aspxstring
2013-08-14 22:31:40 591
原创 fill dropdownlist jquery
for (var i = 0; i < dataList.length; i++) { var option = $('') .attr("value", dataList[i].data) .html(templateList[i].na
2013-08-13 22:28:37 415
原创 set iframe content and size
$("#framePreview").contents().find('html').empty();$("#framePreview").contents().find('html').html("your html text");var contentHeight = $("#framePreview").contents().find('html').height();$("#f
2013-08-13 22:18:57 836
原创 jquery refresh table data
function RefreshTbody(action, searchVal) { $.get('ajax.php', { action: action, value: searchVal }, function (data) { var json = jQuery.parseJSON(data); $(function ()
2013-07-02 18:35:56 1847
原创 datasource with some sql parameters in ()
backend code:protected void Name_ApplyFilter(object sender, HRASP.Web.Data.SqlFilterEventArgs e) { if (!String.IsNullOrWhiteSpace(txtName.Text.Trim())) { if (e.Filter
2013-06-11 19:54:12 485
原创 rad grid, drag and drop
--%> <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" Skin="Metro" EnableRoundedCorners="false"> Loading... --%>
2013-06-06 21:51:54 1204
转载 asp ajax , reorder list
Control Toolkit .DragHandleClass { width: 12px; height: 12px; background-color: red; cursor:move; } " ProviderName="System.Data.SqlClient"
2013-06-06 21:49:46 715
原创 nettier setup, in web.config
if using nettier datasource, need finish the transaction, so need set up in web.config
2013-05-29 00:44:17 467
转载 Validating Checkboxlist using CustomValidator
1) Using ClientValidationFunctionfunction ValidateModuleList(source, args){var chkListModules= document.getElementById (‘’);var chkListinputs = chkListModules.getElementsByTagName(“input”);for
2013-05-28 19:36:46 530
原创 nettier datasource 1
<data:TaxationAuthorityInfoDataSource runat="server" ID="SummaryDS" SelectMethod="GetPaged">
2013-04-03 17:33:56 505
原创 mvc4 membership table
1. use nuget package install microsoft.aspnet.providers.core2. in web.config
2013-02-06 20:48:26 422
原创 mvc validation
// model class[Bind(Exclude = "AlbumId")] public class Album { [ScaffoldColumn(false)] public int AlbumId { get; set; } [DisplayName("Genre666")] public int G
2013-02-06 00:51:10 399
原创 Code first, DB update
1, change code in model, add/delete new field to table, update db.using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data.Entity;using System.Compon
2013-02-04 23:52:50 348
原创 grid view template field bound
<data:EntityGridView runat="server" ID="gvw_tickets" SkinID="Admin" DataSourceID="TicketDS" DefaultSortColumnName="ticket_no desc" DataKeyNames="TicketId" OnRowDeleting="gvw_t
2013-01-17 17:48:01 374
原创 generate radom word
public abstract class RandomWordHelper { public static string GetRandomWord(int length, WordType wordType) { string alphabet = null; switch (wordType)
2013-01-15 17:45:34 278
原创 nettier datasouce
--%> ' />--%> ' />--%> --%> back end code for the event OnApplyFilter="Dra
2013-01-15 17:41:57 384
原创 sqldatasource bind gridview (date between)
sql datasource:" CancelSelectOnNullParameter="False" SelectCommand="SELECT [id], [customer_email], [customer_number], [date] FROM [tbl_submit_reco
2013-01-10 20:26:35 734
原创 mysql function with cursor
-- ---------------------------------------------------------------------------------- Routine DDL-- Note: comments before and after the routine body will not be stored by the server-- -------------
2012-12-12 22:58:49 1143
原创 update a table by selected value from other table.
UPDATE TableSET Table.col1 = other_table.col1, Table.col2 = other_table.col2FROM TableINNER JOIN other_tableON Table.id = other_table.idexample: update [Pharmapod].[
2012-11-03 00:36:51 468
原创 login control - keep me login until I logout
in the login control event loggedInprotected void LoginControl_OnLoggedIn(object sender, EventArgs e) { CheckBox cb = LoginControl.FindControl("RememberMe") as CheckBox;
2012-11-02 19:14:27 1117
原创 check smpt server mail queue
C:\inetpub\mailroot\Queueeach file is a mail, if the mail is sent, the file for that mail is gone.
2012-10-22 22:48:42 347
原创 calculate all controls size and position in the form when the form resize
// class with calculate size and position of control.class UIElement { // those properties get the Control current size, font, position public Control Control { get; set; } publi
2012-09-25 18:30:22 375
原创 android permission
when install the android app, a list of permission will display: DEVELOPMENT TOOLSENABLE APP DEBUGGINGAllows the app to turn on debugging for another app. Malicious apps may use this to ki
2012-07-16 19:04:55 294
原创 android error
When you debug or run (android 4.0.0 or upper) by AVD(emulator), the error (device not found) may show, this is not error, the appjust not start auto, you can start in the running AVD. ----------
2012-07-16 18:56:06 445
原创 Custom data binding, window form
// custom ObjectPublic Class Customer{ // class to get set a string to format of (key=value;key=value;...;...;) private NVParser parser = new NVParser(); public Customer() { parser.
2012-05-01 00:44:12 372
原创 nettier deepload
CustomerService service = new CustomerService(); var customer = service.GetByCustomerId(customerId); if (customer != null) { // 1
2012-04-23 17:16:29 494
原创 SVN Merge
Create branchright click the project -> svn -> branch tag. Fill in the URL. you can specify a new folder on the url, svn will create that folder for you automatically.you can swich working cop
2012-04-19 16:55:32 1376
原创 make phone call, browse web, send email
// make phone calltry { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:1850363744")); startActivity(callIntent);
2012-04-10 18:24:16 421
原创 dynamic create layout
LinearLayout containerLayout = (LinearLayout)findViewById(R.id.scrollviewlayout); containerScrollView = new ScrollView(this); //set scrollview layout containerScrollView.setLayoutParams(n
2012-04-10 17:54:53 433
原创 splash screen
public class Splashscreen extends Activity{ private Thread splashThread; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layou
2012-04-10 17:25:22 327
原创 create custom OnTouchListener
public class MyImageListener implements OnTouchListener { public boolean onTouch(View v, MotionEvent event) { float width = v.getWidth(); float height = v.getHeight(); /* Log.i("he
2012-04-05 23:52:24 350
原创 spinner (drop down list)
// set spinner spinner = (Spinner) findViewById(R.id.spinner_meterPointType); ArrayAdapter adapter = ArrayAdapter.createFromResource( this, R.array.meterType_array, a
2012-04-05 23:24:25 1030
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人