Click here to Skip to main content
15,926,596 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionJava script in asp.net Pin
suryany7219-Aug-07 22:44
suryany7219-Aug-07 22:44 
AnswerRe: Java script in asp.net Pin
Imran Khan Pathan19-Aug-07 23:12
Imran Khan Pathan19-Aug-07 23:12 
AnswerRe: Java script in asp.net Pin
Michael Sync19-Aug-07 23:19
Michael Sync19-Aug-07 23:19 
AnswerRe: Java script in asp.net Pin
koolprasad200320-Aug-07 0:13
professionalkoolprasad200320-Aug-07 0:13 
Questioncodebehind and javascript file Pin
TheEagle19-Aug-07 21:38
TheEagle19-Aug-07 21:38 
AnswerRe: codebehind and javascript file Pin
Michael Sync19-Aug-07 23:05
Michael Sync19-Aug-07 23:05 
GeneralRe: codebehind and javascript file Pin
TheEagle20-Aug-07 5:34
TheEagle20-Aug-07 5:34 
GeneralRe: codebehind and javascript file Pin
Michael Sync20-Aug-07 6:28
Michael Sync20-Aug-07 6:28 
TheEagle wrote:
function donow()
{
var b=ss;//where ss value is set from code behind
}


I don't think it can be done directly.

But you can use server-side hidden field to commute between client-side and server-side.

<input id="Hidden1" type="hidden" runat="server"/>


In Form_load
<br />
protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        Hidden1.Value = "13";<br />
    }



You can set like that..

In Client-side ~

<script language="javascript" type="text/javascript"><br />
      function getvalue(){<br />
        var var1 = document.getElementById('Hidden1').value;<br />
        //do something.<br />
      }<br />
    </script><br />



So, Even thought you can't set like that "var b=ss;" directly. but you can set "hidden.value = ss;" and then, var b = hidden.value;

Hope it helps.

Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)

If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. Smile | :)

GeneralRe: codebehind and javascript file Pin
TheEagle20-Aug-07 13:22
TheEagle20-Aug-07 13:22 
Questiondisabling an item in combobox Pin
Prakash_Mishra19-Aug-07 21:24
Prakash_Mishra19-Aug-07 21:24 
AnswerRe: disabling an item in combobox Pin
Imran Khan Pathan19-Aug-07 21:35
Imran Khan Pathan19-Aug-07 21:35 
GeneralRe: disabling an item in combobox Pin
Prakash_Mishra19-Aug-07 21:41
Prakash_Mishra19-Aug-07 21:41 
GeneralRe: disabling an item in combobox Pin
Imran Khan Pathan19-Aug-07 21:43
Imran Khan Pathan19-Aug-07 21:43 
GeneralRe: disabling an item in combobox Pin
Prakash_Mishra19-Aug-07 21:59
Prakash_Mishra19-Aug-07 21:59 
GeneralRe: disabling an item in combobox Pin
Prakash_Mishra19-Aug-07 22:54
Prakash_Mishra19-Aug-07 22:54 
QuestionForm authentcation Pin
saravanan0519-Aug-07 21:16
saravanan0519-Aug-07 21:16 
AnswerRe: Form authentcation Pin
neerubee20-Aug-07 2:11
neerubee20-Aug-07 2:11 
Questiondatagrid Pin
jai 12319-Aug-07 20:44
jai 12319-Aug-07 20:44 
AnswerRe: datagrid Pin
Imran Khan Pathan19-Aug-07 20:57
Imran Khan Pathan19-Aug-07 20:57 
GeneralRe: datagrid Pin
neerubee20-Aug-07 2:13
neerubee20-Aug-07 2:13 
QuestionHow to Bind the Data to DropDownListBox In GridViewControl Pin
mrgaddam19-Aug-07 20:36
mrgaddam19-Aug-07 20:36 
AnswerRe: How to Bind the Data to DropDownListBox In GridViewControl Pin
Imran Khan Pathan19-Aug-07 20:44
Imran Khan Pathan19-Aug-07 20:44 
Questionhello everyone Pin
ballameharmurali19-Aug-07 20:28
ballameharmurali19-Aug-07 20:28 
AnswerRe: hello everyone Pin
codingrocks19-Aug-07 23:23
codingrocks19-Aug-07 23:23 
QuestionWant IE6 and IE7 in single OS? Pin
chand1019-Aug-07 20:24
chand1019-Aug-07 20:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.