call a c# funcation in html code
-
angle, can u show me the code, so that i can get a clear view how to use it. Thanks Saurabh
-
Saurab, I didn't get your scenario properly what exactly you're trying to do. What I'm assuming is that you've a search panel which is displayed where ever you navigate to but it shows controls according to the page you're on. Is this your scenario?
yes ,dear...............
-
yes ,dear...............
-
then why are you calling particular function on menu click, instead of that why don't you set search panel controls from page's load event?
i have used,iframe and my page is divided into two parts..left and right. left i have fixed,where i display the search panel and in the right panel, the page loads(in iframe). thus keeping the main page stable and loading the page and search panel in side that main page. the main page contains all the attributes of search panel. can u help me,with using asplinkbutton instead of html link. as i told u before, when i used it....1st page on click works fine along with search panel and after which the collapsiable proerty stop,until the main page is refreshed. so, if i can use the asplinkbutton......all the problems will be sloved in the collpsiable menu. thanks in advance dear......
-
i have used,iframe and my page is divided into two parts..left and right. left i have fixed,where i display the search panel and in the right panel, the page loads(in iframe). thus keeping the main page stable and loading the page and search panel in side that main page. the main page contains all the attributes of search panel. can u help me,with using asplinkbutton instead of html link. as i told u before, when i used it....1st page on click works fine along with search panel and after which the collapsiable proerty stop,until the main page is refreshed. so, if i can use the asplinkbutton......all the problems will be sloved in the collpsiable menu. thanks in advance dear......
-
my menu is placed on the left panel of main page. left panel is divided into two parts upper: have search panel lower : has menu.
-
my menu is placed on the left panel of main page. left panel is divided into two parts upper: have search panel lower : has menu.
-
Gamzun, i have tried this out, but there was no event on which i can call the function.If you can help me with restoring the property of the menubar after i have used asplinkbutton.
-
Gamzun, i have tried this out, but there was no event on which i can call the function.If you can help me with restoring the property of the menubar after i have used asplinkbutton.
-
I don't prefer using asp menubar, however, can you workaround with the help of querystring?
Gamzun, no its not an asp menu bar.........but i used it before(asp link button) where i had 'onclick' and 'onclientclick' events, from which i called the page from one and corresponding search panel with another one. now in case of html menu,i just have 'onclick' event. i call the page using js,where as my search panel is called from c# code. i m unable to manage both on one click event... :(
-
Gamzun, no its not an asp menu bar.........but i used it before(asp link button) where i had 'onclick' and 'onclientclick' events, from which i called the page from one and corresponding search panel with another one. now in case of html menu,i just have 'onclick' event. i call the page using js,where as my search panel is called from c# code. i m unable to manage both on one click event... :(
okie picture is clear now, try calling this on html links onclick='__doPostBack('method name to be called on postback','in arguments you can send id of page or something by which you can get which link is click! ' In your main page's code-behind, the method which is defined in __doPostback, set your search panel accordingly and open the page as per argument send by request.form['__EVENTARGUMENT'] (i might be wrong about this request.form's parameter just google how to get the value from it) and you're good to go :) let me know if you need further help
Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif
-
okie picture is clear now, try calling this on html links onclick='__doPostBack('method name to be called on postback','in arguments you can send id of page or something by which you can get which link is click! ' In your main page's code-behind, the method which is defined in __doPostback, set your search panel accordingly and open the page as per argument send by request.form['__EVENTARGUMENT'] (i might be wrong about this request.form's parameter just google how to get the value from it) and you're good to go :) let me know if you need further help
Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif
lol.......Kashif, sure i will.......... :) let me try once
-
how do i call a c# funcation in html code, on link's onclick? i have already called a function onclick, i need to call another function. kindly help me out....
Hi, You can try this: (1) JS: PageMethods. backmethod (latlng,myCallBack); (2) C# [System.Web.Services.WebMethod]//you must write this; public static String backmethod (Object xingcan)//must be static { …… //your logic } (3) function myCallBack(result) { var di = document.getElementById("Label1"); //for example di.innerText=result; } The order is (1)-(2)-(3)。
April Comm100 - Leading Live Chat Software Provider