Can I access any Server control in Javascript function in .Net
-
1. I want to access a Server control in .net within a Javascript function. I used this method. alert(alter(document.getElementById('tbCmpName').id); still its not working. Can any body help me in accessing server side control from client side scripting? 2. How can I declare string variables in Javascript? 3. And one more question, how can I get the length of a string? Please reply me for these queries.
S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.
-
1. I want to access a Server control in .net within a Javascript function. I used this method. alert(alter(document.getElementById('tbCmpName').id); still its not working. Can any body help me in accessing server side control from client side scripting? 2. How can I declare string variables in Javascript? 3. And one more question, how can I get the length of a string? Please reply me for these queries.
S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.
indian143 wrote:
I want to access a Server control in .net within a Javascript function. I used this method. alert(alter(document.getElementById('tbCmpName').id); still its not working.
Like this you can access server control in javascript: document.getElementById('tbCmpName')
indian143 wrote:
2. How can I declare string variables in Javascript? 3. And one more question, how can I get the length of a string?
This[^] with help you in that regard.
Best Regards, Apurva Kaushal
-
indian143 wrote:
I want to access a Server control in .net within a Javascript function. I used this method. alert(alter(document.getElementById('tbCmpName').id); still its not working.
Like this you can access server control in javascript: document.getElementById('tbCmpName')
indian143 wrote:
2. How can I declare string variables in Javascript? 3. And one more question, how can I get the length of a string?
This[^] with help you in that regard.
Best Regards, Apurva Kaushal
No my dear, its not working, otherwise I would have triend on my own. I am stratly asking you that, I want to access the "Text" property of a server control. And I want to calculate its length and is its length is less than or = to "0" then I want to devalidate to page submission. How can I do it.
S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.
-
No my dear, its not working, otherwise I would have triend on my own. I am stratly asking you that, I want to access the "Text" property of a server control. And I want to calculate its length and is its length is less than or = to "0" then I want to devalidate to page submission. How can I do it.
S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.
-
1. I want to access a Server control in .net within a Javascript function. I used this method. alert(alter(document.getElementById('tbCmpName').id); still its not working. Can any body help me in accessing server side control from client side scripting? 2. How can I declare string variables in Javascript? 3. And one more question, how can I get the length of a string? Please reply me for these queries.
S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.
1-.net id generator usually change your components id when it is rendering your component to client. it concats some prefix to the component original id. it is usually "ctl00_ContentPlaceHolder1_". so your component id in client mode will be converted to "ctl00_ContentPlaceHolder1_tbCmpName". so your code should be this: alter(document.getElementById('ctl00_ContentPlaceHolder1_tbCmpName').id); 2-string variable and its length: var b = 'Hello World'; window.alert(b.length); Thanks Rastgar
-
indian143 wrote:
I want to access a Server control in .net within a Javascript function. I used this method. alert(alter(document.getElementById('tbCmpName').id); still its not working.
Like this you can access server control in javascript: document.getElementById('tbCmpName')
indian143 wrote:
2. How can I declare string variables in Javascript? 3. And one more question, how can I get the length of a string?
This[^] with help you in that regard.
Best Regards, Apurva Kaushal
How can I add elements in to a .Net Drop down list server control using Javascript function. Like I have 3 dropdown list server controls. I want change the date field whenever month or year changed. If possible please give some code snippet.
S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.