pass javascript variable to asp.net function
-
Dear All, I am looking for a way where I want to pass javascript variable to asp.net function bellow is what I am doing right now
function openWindowWithArg()
{
var myParam = window.dialogArguments;
var param = document.getElementById('TextBox1');
param.value = myParam.param;
<%bindAdvancedFilterData("1,2"); %>; //this works fine
<%bindAdvancedFilterData(param.value); %>; //this doesnt work, I want to do it this way
}any ideas how i can pass param.value to the asp.net method bindAdvancedFilterData()?, I can do this using query string and session but May be it should be possible to do it like this?
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
-
Dear All, I am looking for a way where I want to pass javascript variable to asp.net function bellow is what I am doing right now
function openWindowWithArg()
{
var myParam = window.dialogArguments;
var param = document.getElementById('TextBox1');
param.value = myParam.param;
<%bindAdvancedFilterData("1,2"); %>; //this works fine
<%bindAdvancedFilterData(param.value); %>; //this doesnt work, I want to do it this way
}any ideas how i can pass param.value to the asp.net method bindAdvancedFilterData()?, I can do this using query string and session but May be it should be possible to do it like this?
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
-
Why dont u use hidden field..? are u trying to call a method? what is bindAdvancedFilterData()? in here..!
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
well, I am calling openWindowWithArg function in onload of body as bellow
<body onload="openWindowWithArg();">
and the function
<%bindAdvancedFilterData("1,2"); %>;
is asp.net function which I am calling it from javascript. How to pass javascript variables to asp.net method? which I want to do it as bellow
function openWindowWithArg()
{
var myParam = window.dialogArguments;
var param = document.getElementById('TextBox1');
param.value = myParam.param;
//<%bindAdvancedFilterData("1,2"); %>;
<%bindAdvancedFilterData(param.value); %>;
}Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
-
well, I am calling openWindowWithArg function in onload of body as bellow
<body onload="openWindowWithArg();">
and the function
<%bindAdvancedFilterData("1,2"); %>;
is asp.net function which I am calling it from javascript. How to pass javascript variables to asp.net method? which I want to do it as bellow
function openWindowWithArg()
{
var myParam = window.dialogArguments;
var param = document.getElementById('TextBox1');
param.value = myParam.param;
//<%bindAdvancedFilterData("1,2"); %>;
<%bindAdvancedFilterData(param.value); %>;
}Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
To My knowledge use hidden control for that .I mostly uses that. Its Only a suggestion . http://www.dotnetcurry.com/ShowArticle.aspx?ID=203[^] If this the way you dont want please ignore..!
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
-
To My knowledge use hidden control for that .I mostly uses that. Its Only a suggestion . http://www.dotnetcurry.com/ShowArticle.aspx?ID=203[^] If this the way you dont want please ignore..!
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
thanks for reply, well I am not doing postback, If you I call that function in body load. If I do post back then Its possible to do it but since I am looking to do it only in body load.
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
-
Dear All, I am looking for a way where I want to pass javascript variable to asp.net function bellow is what I am doing right now
function openWindowWithArg()
{
var myParam = window.dialogArguments;
var param = document.getElementById('TextBox1');
param.value = myParam.param;
<%bindAdvancedFilterData("1,2"); %>; //this works fine
<%bindAdvancedFilterData(param.value); %>; //this doesnt work, I want to do it this way
}any ideas how i can pass param.value to the asp.net method bindAdvancedFilterData()?, I can do this using query string and session but May be it should be possible to do it like this?
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
Developers in Afghanistan strange
-
Dear All, I am looking for a way where I want to pass javascript variable to asp.net function bellow is what I am doing right now
function openWindowWithArg()
{
var myParam = window.dialogArguments;
var param = document.getElementById('TextBox1');
param.value = myParam.param;
<%bindAdvancedFilterData("1,2"); %>; //this works fine
<%bindAdvancedFilterData(param.value); %>; //this doesnt work, I want to do it this way
}any ideas how i can pass param.value to the asp.net method bindAdvancedFilterData()?, I can do this using query string and session but May be it should be possible to do it like this?
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
Use Ajax
-
thanks for reply, well I am not doing postback, If you I call that function in body load. If I do post back then Its possible to do it but since I am looking to do it only in body load.
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
-
Developers in Afghanistan strange
thanks for your strange, I think It shouldn't be strange. using Ajax is the simplest way which I am not willing to use.there are other solutions like using QueryString and Sesstion which I can use. but I thought of using javascript which I think this could be impossible.
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
-
thanks for your strange, I think It shouldn't be strange. using Ajax is the simplest way which I am not willing to use.there are other solutions like using QueryString and Sesstion which I can use. but I thought of using javascript which I think this could be impossible.
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan
pagemethods in asp.net ajax , help u to call any function from aspx page in code page just google pagemethods
-
Why dont u use hidden field..? are u trying to call a method? what is bindAdvancedFilterData()? in here..!
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
Because you don't always need to use a hidden field.
I know the language. I've read a book. - _Madmatt
-
pagemethods in asp.net ajax , help u to call any function from aspx page in code page just google pagemethods
thanks for reply, You are asking me to use asp.net ajax and I am saying, I am in an envoirnment where no ajax should be used. every thing should be done through javascript and c#.
Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan