Posts

How to get jQuery version

use Console or write a jquery to get version: 1- jQuery.fn.jquery 2- $.fn.jquery; 3- jQuery().jquery; 4- $().jquery

colorbox lightbox style with Close and title in top.

Image
To change style to bellow style: download code from here :            https://github.com/msm2020/colorbox/tree/master/example5

get submit button id in Page_Load

The sender argument to the handler contains a reference to the control which raised the event. private void MyClickEventHandler(object sender, EventArgs e) { Button theButton = (Button)sender; ... } Edit: Wait, in the Load event? That's a little tricker. One thing I can think of is this: The Request's Form collection will contain a key/value for the submitting button, but not for the others. So you can do something like: protected void Page_Load(object sender, EventArgs e) { Button theButton = null; if (Request.Form.AllKeys.Contains("button1")) theButton = button1; else if (Request.Form.AllKeys.Contains("button2")) theButton = button2; ... } Not very elegant, but you get the idea..

Escape an Underscore Like cause

if you search about Underscore this query will not get a true value Where Username Like '%_d' so you need to use : Where Username LIKE '%[_]d'

string contains in Jquery

Like this: if (str.indexOf("Yes") >= 0) Note that this is case-sensitive. If you want a case-insensitive search, you can write if (str.toLowerCase().indexOf("yes") >= 0) Or, if (/yes/i.test(str))

Operation must use an updateable query

One quite likely reason is that the user running the program doesn't have read-write access to the database file, especially if it is located in program files folder,make sure excel not mark as "Read Only" So check the directory and file permissions and moodify them if needed. You can also consider changing the location of the database file to another, more asily accessible folder.

Gridview RowDataBound - extract data from a field

Use DataItem of the GridViewRow instead of DataBinder.Eval to get the underlying datasource: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState == DataControlRowState.Edit)) { DataRow row = ((DataRowView)e.Row.DataItem).Row; String name = row.Field ("Name"); // OR name = row[1]; // String is a reference type, so you just need to compare with null if(name != null){/* do something */} } }