Java script?
-
Hi friends, I want to pass the data to javascript function when click on the button. I write the code like this. Text="Button" /> In java script function function del(txt) { document.Write(txt); } But the answer came as NULL Can anyone correct it?
-
Hi friends, I want to pass the data to javascript function when click on the button. I write the code like this. Text="Button" /> In java script function function del(txt) { document.Write(txt); } But the answer came as NULL Can anyone correct it?
<asp:button id="Button1" runat="server" onmousedown="del(document.getElementById('<%=TextBox1.ClientID%>'))"> The issue is that TextBox1, is not called TextBox1 on the client.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
<asp:button id="Button1" runat="server" onmousedown="del(document.getElementById('<%=TextBox1.ClientID%>'))"> The issue is that TextBox1, is not called TextBox1 on the client.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
Ok. I solve it. Is it possible to pass session variable inside the function?
-
Ok. I solve it. Is it possible to pass session variable inside the function?
The session variable is on the server, you'd have to pass it to javascript by writing some script that defines a client side variable and sets it to the server side value. Don't forget to put it in quotes if it is a string.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
Ok. I solve it. Is it possible to pass session variable inside the function?
Karthick_gc wrote:
Is it possible to pass session variable inside the function?
if it is already in session, then what is the use of pass it?
cheers, Abhijit CodeProject MVP
-
<asp:button id="Button1" runat="server" onmousedown="del(document.getElementById('<%=TextBox1.ClientID%>'))"> The issue is that TextBox1, is not called TextBox1 on the client.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
Erm, I think you have to pass the TextBox1's value, surely, and not the whole control? I might be wrong, but that's what i gathered from the del(txt)function.
var question = (_2b || !(_2b));
-
Karthick_gc wrote:
Is it possible to pass session variable inside the function?
if it is already in session, then what is the use of pass it?
cheers, Abhijit CodeProject MVP
I want to check the session variable when the form is unload. I write the code like this. function del() { alert(Session["nam"]); } But the unload event is not trigerring. Whats the fault in this code?
-
The session variable is on the server, you'd have to pass it to javascript by writing some script that defines a client side variable and sets it to the server side value. Don't forget to put it in quotes if it is a string.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
Can u give the syntax for converion please?
-
Hi friends, I want to pass the data to javascript function when click on the button. I write the code like this. Text="Button" /> In java script function function del(txt) { document.Write(txt); } But the answer came as NULL Can anyone correct it?
onmousedown="del(this.text)"
-
onmousedown="del(this.text)"
That would work, if the button he was clicking, was also the textbox he entered text into.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
Can u give the syntax for converion please?
var myClientsideString = '<=Session["key"]>'; inside a script block, obviously.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )