asp.net - Get client id of the control -



asp.net - Get client id of the control -

i got client id of dropdown value as

ctl00_timecardcontentplaceholder_uc_0_1_drpdwncompany

i have value above string value 1 client id.

any methods substring() there value string.

solution getclientidfromconrol(control control) { string strid=control.clientid; string strclientsid = strid.substring(38, 1); homecoming convert.toint32(strclientsid); }

if want 1.

you can utilize split function job.

string dropdown="ctl00_timecardcontentplaceholder_uc_0_1_drpdwncompany"; string[] split=dropdown.split('_');//split underscore character; string result=split[4].tostring(); // here 1 result

hope helps.

asp.net .net string

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -