RadConfirm doesnt work with html text in LinkButton

2 posts, 0 answers
  1. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 18 May 2009 Link to this post

    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.
  2. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 18 May 2009 Link to this post

    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



  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top