What is wrong in the Javascript
-
I want to show a popup window on while clicking a link button .i want to pass the url of the popup window and also the id of each record while Databinding.the code which i used as follows. Javascript as follows function openWindow(url) { window.open(url,'Calendar', 'width=500,height=400,left=200,top=250'); } Link Button Postbackurl Code as follows PostBackUrl="javascript:openWindow('<%# Concatcolumns("UserDetails.aspx?id=",DataBinder.Eval(Container.DataItem,"ID"))%>');">LinkButton Concatcolumns Function as follows public static string Concatcolumns(object obj1, object obj2) { return Convert.ToString(obj1) + Convert.ToString(obj2); } My Javascript code and Concatcolumns functions are correct only problem in my Postbackurl code.what is wrong in that.while page loading i want to bind each record id along with the popup window javascript.
-
I want to show a popup window on while clicking a link button .i want to pass the url of the popup window and also the id of each record while Databinding.the code which i used as follows. Javascript as follows function openWindow(url) { window.open(url,'Calendar', 'width=500,height=400,left=200,top=250'); } Link Button Postbackurl Code as follows PostBackUrl="javascript:openWindow('<%# Concatcolumns("UserDetails.aspx?id=",DataBinder.Eval(Container.DataItem,"ID"))%>');">LinkButton Concatcolumns Function as follows public static string Concatcolumns(object obj1, object obj2) { return Convert.ToString(obj1) + Convert.ToString(obj2); } My Javascript code and Concatcolumns functions are correct only problem in my Postbackurl code.what is wrong in that.while page loading i want to bind each record id along with the popup window javascript.
Every thing seems ok. May be the PostBackUrl property makes the problem. Try an 'a' tag instead of LinkButton.
Thomas
-
I want to show a popup window on while clicking a link button .i want to pass the url of the popup window and also the id of each record while Databinding.the code which i used as follows. Javascript as follows function openWindow(url) { window.open(url,'Calendar', 'width=500,height=400,left=200,top=250'); } Link Button Postbackurl Code as follows PostBackUrl="javascript:openWindow('<%# Concatcolumns("UserDetails.aspx?id=",DataBinder.Eval(Container.DataItem,"ID"))%>');">LinkButton Concatcolumns Function as follows public static string Concatcolumns(object obj1, object obj2) { return Convert.ToString(obj1) + Convert.ToString(obj2); } My Javascript code and Concatcolumns functions are correct only problem in my Postbackurl code.what is wrong in that.while page loading i want to bind each record id along with the popup window javascript.
What does the generated code look like? Why do you concat the url using server code, when you can just as well put it in the markup code:
PostBackUrl="javascript:openWindow('UserDetails.aspx?id=<%# DataBinder.Eval(Container.DataItem,"ID") %>');"
--- single minded; short sighted; long gone;