| Author: Anil Kumar Pandey 24 Apr 2009 | Member Level: Diamond | Rating:  Points: 2 |
hi,
u can use either b.value or b.Text
<script language="javascript" type="text/javascript"> function addtab(){
alert("begin"); var tabctrl1 = window.parent.igtab_getTabById("Tab2"); tabctrl1.Tabs[2].setEnabled(true); tabctrl1.Tabs[2].setVisible(true); var b = document.getElementById("LinkButton2"); alert(b.Text); or alert(b.value); alert("end");
} </script>
Thanks & Regards Anil Kumar Pandey
|
| Author: :) Bob (: 24 Apr 2009 | Member Level: Gold | Rating:  Points: 2 |
hai...
<asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="javascript:return addtab();" CausesValidation="false" CommandName="name" Text='<%# Eval("[ name]") %>' CommandArgument='<%# Eval("[Id]") %>'></asp:LinkButton>
Above is ur code. In that code you are calling a javascript on client click. Pass the text as argument to this function. the correct code is below
<asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="javascript:return addtab(this);" CausesValidation="false" CommandName="name" Text='<%# Eval("[ name]") %>' CommandArgument='<%# Eval("[Id]") %>'></asp:LinkButton>
function addtab(TXT) { alert(TXT) } another method is
function addtab(ID) { alert(ID.innerHTML) }
2nd one i am not sure, is it correct or not
Bobbin
|
| Author: Dotnet Galaxy 24 Apr 2009 | Member Level: Diamond | Rating:  Points: 2 |
Hi suze,
Do the following, 1. Create a following javascript function to get the linkbutton text.
function GetLinkButtonText() { var lnk=document.getElementById('LinkButton1'); alert(lnk.innerText); return false; }
2. Create a LinkButton control and call the javascript function like following,
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return GetLinkButtonText();">Sample Text</asp:LinkButton>
3. Thats it. It will return a linkbutton text.
Hope it helps. Happy Coding...
Thanks, DotNet Galaxy.
******************************************* Note - Please rate this response [Poor / Fine / Good / Great / Excellent] *******************************************
|
| Author: Elz 24 Apr 2009 | Member Level: Gold | Rating:  Points: 2 |
Thanku i vl check it
|
| Author: Techie 24 Apr 2009 | Member Level: Gold | Rating:  Points: 2 |
try this way,
function addtab() {
b = document.getElementById("<%=LinkButton2.ClientID%>"); alert(b.innerText);
}
|
| Author: Miss Meetu Choudhary 18 Jun 2009 | Member Level: Diamond | Rating:  Points: 2 |
duplicate post deleted
Thanks and Regards Miss Meetu Choudhary (Site Coordinator) Go Green Save Green http://www.jaipurmentor.com/ My Profile on Google
|