This is a migrated thread and some comments may be shown as answers.

RadConfirm doesnt work with html text in LinkButton

1 Answer 111 Views
Window
This is a migrated thread and some comments may be shown as answers.
Barbaros Saglamtimur
Top achievements
Rank 1
Barbaros Saglamtimur asked on 18 May 2009, 03:50 PM
Hi,

I am trying to implement radconfirm (Confirm postback with radconfirm) as described on this link
http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx

when I put LinkButton and configure, it works fine, but when I change its text like <b>LinkButton</b>, window works fine (it opens), its cancel event works fine, but its ok button does not post back, and confirm window stays visible. I use <b> tag because I am using it for slidingdoors technique and css.
Here is generated html codes. First one works fine, second does not.
<onclick="return blockConfirm('Are you sure you want to delete this record?', event, 250, 100,'','Confirm Delete');" id="LinkButton1" href="javascript:__doPostBack('LinkButton1','')">LinkButton</a> 
 
<onclick="return blockConfirm('Are you sure you want to delete this record?', event, 250, 100,'','Confirm Delete');" id="LinkButton1" href="javascript:__doPostBack('MOB1','')"><b>LinkButton</b></a


Any thoughts?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Barbaros Saglamtimur
Top achievements
Rank 1
answered on 18 May 2009, 09:45 PM
OK, I figured it out. If you examine sample source code (link given in my first post) there is a code

var callerObj = ev.srcElement ? ev.srcElement : ev.target;

this captures which object fires click event. So if I use text like "<b>LinkButton</b>", and click on text from browser, object will be <b>. After that, it tries to capture its href property which contains "_doPostBack.........", and tries to fire this function after "OK" press. So <b> does not has href property, it fails. I changed my function to accept one more parameter like isChild, and add a control for the object

window.blockConfirm = function(text, mozEvent, oWidth, oHeight, callerObj, oTitle, isChild) {
.
.
.
var callerObj = ev.srcElement ? ev.srcElement : ev.target;
callerObj = isChild ? callerObj.parentNode : callerObj;

If I want to use LinkButton with text surrouned by <b></b> tag, I use this function with isChild=true, otherwise isChild=false.
Now everything works fine



Tags
Window
Asked by
Barbaros Saglamtimur
Top achievements
Rank 1
Answers by
Barbaros Saglamtimur
Top achievements
Rank 1
Share this question
or