i am working on asp.net c#. I want to send a string value from c# to ascx page . I am using following code to do that ,
string one = @"\'" + names[0, 0] + "\'" + "," + @"\'" + names[1, 0] + "\'";
string[] splitted = one.Split('\'');
string onces = splitted[1] + "," + splitted[3] ;
inpHide.Value =onces;
In ascx page i should pass this values to javascript , i did like this ,
$(document).ready(function () {
var hiddenControl = '<%= inpHide.ClientID %>';
var values = document.getElementById(hiddenControl).value;
alert(values);
var tweetUsers = [values];
});
<input id="inpHide" type="hidden" runat="server" />
when i debug javascript using firebug values coming like [""twitter","microsoft""] but " quotes are being added automatically into javascript . but i should get like this ["twitter","microsoft"] because of this string javascript is not working. how can i solve this problem ? please help me to solve this problem . thank you in advance.