|
My pleasure
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hello Miss soniya Badnam don't .if don't want answer why u post qustion.
Piyush Vardhan Singh
|
|
|
|
|
Hello Friends,
How use javascript function in code behind file aspx.cs
My function Event: onbeforedeactivate();
|
|
|
|
|
Button1.Attributes.Add("OnClick", "javascript:return FunctionName();")
|
|
|
|
|
I want call this function Window close. not for button click.
|
|
|
|
|
|
Current Window Means Open default.aspx. when close the button then call fuction.
|
|
|
|
|
What exactly u want to do, I mean why u want to call javascript function on window close as u can give it in body tag also, somewhat like this:
<body onunload="CloseWindow();">
<script language="javascript" type="text/javascript">
function CloseWindow()
{
alert("1");
}
</script>
|
|
|
|
|
My default.aspx page under content place holder. you know that content place holder under use javascript but can not use html. where the fuction call. so my question ? how function call in code behind file event (closing window).
|
|
|
|
|
The only way to let your code behind know that the window was closed, is an AJAX call.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
My according does not use ajax. if without ajax it is possible please help me urgently
|
|
|
|
|
i gave same reply to Sonia also put this script in the content placeholder of that page i thing it should work now
<br />
<asp:Content ID="Content2" ContentPlaceHolderID="FormContentPlaceHolder" runat="server"><br />
<script type="text/javascript" src="JS/LandingPage.js" language="javascript"></script><br />
<script type="text/javascript" ><br />
window.onbeforeunload=callThisFunction<br />
<br />
function callThisFunction()<br />
{<br />
alert('hi');<br />
}<br />
<br />
<br />
<br />
</script><br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
No, it can't be done. As someone has shown already, you can call javascript on a page close. Only AJAX can call the server.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No dear thats not right question
do one thing Write your javascript in content placeholder only
and try to run the application and see does it call that function after proper event
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Not sure if the answers you have got will help - you can't call javascript in your code behind. You can emit javascript as part of the html you send to the client to force a method to run when the page is rendered. But, js only runs on the client.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i agree.
We Can Do Anything, If We Want It
|
|
|
|
|
How use javascript function in code behind file aspx.cs
|
|
|
|
|
How can you use javscript function in code behind only thing that you can do in code behind is you can register javascript for perticular control
i thing there is some misunderstanding .
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I percieve that English is not your first language, so I will be polite. You've been told the only possible answer, and belligerently asking over and over is not going to change the way every browser in the world works, or the nature of HTTP, to contrive to create the answer you're trying to find. AJAX is your only option.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I know that I can not call javascript in code behind file. but i use javascript in content place holder. just call in code behind file.
|
|
|
|
|
It is not a good practice to call the Javascript function in the codebehind file.
Just put the javascript in the content place holder and call it.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Vri SSK wrote: It is not a good practice to call the Javascript function in the codebehind file.
How is it even possible to call JS in the code behind ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How to use authentication in web.config without type all username and password within <credentails> tag?
I don't need this...
<br />
<br />
...<br />
< credentials ><br />
< user name="AAA" password="BBB" ><br />
...<br />
< /credentials ><br />
...<br />
<br />
Because of i have MySql database which stored username and password.
For LogIn.aspx code like this
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if (CheckAuthenticate(Login1.UserName, Login1.Password))
{
e.Authenticated = true;
Response.Redirect("index.aspx");
}
else
{
e.Authenticated = false;
}
}
...
public bool CheckAuthenticate(string user, string pass)
{
}
I've google it to find some tutorial but it's not help.
How to do this?
thank =)
-- modified at 4:37 Tuesday 16th October, 2007
|
|
|
|
|
I have following things in my web project
1. A web user control which contains a drop downlist.
2. A web-form that contains a drop-downlist and the web contol above mentioned.
3. Two tables - One is master and other is child.
I am populating the the dropdownlist which is lying in the web-user control with the master table data.
Now my question is , How can i populate the dropdownlist , which is lying in the web-form from the dropdownlist , which is lying the web-user control , on the selected index changed function of the drop-downlist lying in the web-user control.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
By subscribing to the selection changed event in the main form which contains the user control. Or by using a delegate to let the main form know that selection has changed in the control.
However, if they are tied together to that degree, odds are the control is poorly designed.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|