Rectangle 27 1

ASP.NET generates server-control's ClientIDs according to the control's NamingContainer. So you need to pass the ClientID to your javascript function. Try this:

var org = document.getElementById('<%=hidOrg.ClientID%>').value;

Pass the hiddenfield's value to the javascript function as well. You need to put the hiddenfield directly behind the DropDownList/Select and use nextSibling to get a reference to it.

onchange="doRetrieveData(this.value,this.nextSibling.value)

Set the Hidden-Field's ClientIdMode to Static (if using .NET 4.0)

doRetrieveData
BtnRetrieveData.Attributes.Add("onclick,"doRetrieveData("+ hidOrg.ClientID +")");

<select id="selDmaHierarchySelect" onchange="doRetrieveData(this.value)"> <option></option> <option value="1">Hierarchy</option> <option value="2">DMA</option> <option value="3">State</option>It is called from a dropdown list. like this:

Then try my codebehind approach. Or put your hiddenfield next to the DropDownList and call doRetrieveData(this.nextSibling.value) to pass the hiddenfield-value directly from the DropDownList's clientside onchange event. w3schools.com/dom/prop_node_nextsibling.asp

asp.net - populating hidden field from codebehind, then, passing it ba...

javascript asp.net code-behind
Rectangle 27 4

If you want to use your JavaScript function to trigger the postback, you need to replace the OnClick with OnClientClick. Modify the button definition like this (I'm already assuming that it's nested inside an UpdatePanel):

<asp:Button ID="btnNew" 
    runat="server" 
    CausesValidation="False" 
    CommandName="New" 
    OnClientClick="DoPostBack();" 
    Text="Create" />
Page_Load
Request["__EVENTTARGET"]
Request["__EVENTARGUMENT"]
protected void Page_Load(object sender, EventArgs e)
{
    if (Page.IsPostBack)
    {
        if (Request["__EVENTTARGET"] == "btnNew" && 
            Request["__EVENTARGUMENT"] == "MyArgument")
        {
            //do something
        }
    }
}

If you don't necessarily want to use JavaScript

<asp:Button ID="btnNew"
    runat="server"
    CausesValidation="False"
    CommandName="New"
    OnClick="DoPostback"
    CommandArgument="MyArgument"
    Text="Create" />

Then, add the following method in the code behind:

protected void DoPostback(object sender, EventArgs e)
{
    var target = ((Button)(sender)).ClientID; //"btnNew"
    var argument = ((Button)(sender)).CommandArgument; //"MyArgument"
    if (target == "btnNew" &&
        argument == "MyArgument")
    {
        //do something
    }
}

c# - how to use __doPostBack function in asp.net - Stack Overflow

c# javascript asp.net postback
Rectangle 27 4

The very first step is to separate out the JavaScript from the code-behind and interpolation of values. Instead of dynamically building JavaScript the approach is then to have a JavaScript function that is given arguments.

After the first phase we end up with something like (forgive the partial translation, it was hurting my head) the following. Note the use of a closure-builder pattern; in real code I would further have this as a separate module.

function makeValidator(champId, opts) {
    return function (sender, args) {
        // Now this is when it gets harry..
        //
        // Use $get (and $find) inside ASP.NET, especially when
        // dealing with ASP.NET AJAX integration to find a control by ID.
        //
        // HOWEVER, the code uses what appears to be some DevExpress
        // controls and thus must be accessed.. differently, mainly either by
        //   1. `window[clientId]` or
        //   2. `ASPxClientControl.GetControlCollection().GetByName(id);`
        // This is just one of those icky things to deal with; I've shown usage
        // of the former and it may need to be applied to the other controls as well.
        //
        var reasonControl = window[opts.reasonId];        // DX control
        var dynamicControl = $get(opts.dynamicControlId); // normal ASP.NET/DOM
        var errorImage = window[opts.errorImageId];       // DX control
        if(reasonControl.GetText() != '' || dynamicControl.style.display == "none") {
            dynamicControl.className='';
            errorImage.SetClientVisible(false);
            args.IsValid = true;
        }
        // etc.
    }
}

It should be clear that the JavaScript code is separate from any string interpolation. It is a normal function, that when called with certain arguments (defined by an API), has a certain behavior. While there are different approaches to "load/inject" this JavaScript (which does matter when UpdatePanels and nested/complex hierarchies come into play), let's pretend that it is currently placed inside a <script> in the markup of the page.

Now, let's wire up the validator to the control - this is entirely fictitious, but it shows the usage of data-binding and actually creating the JavaScript "invocation" in the code-behind, we'll see why in a second. (Using data-binding correctly is actually important as it delays calling the CreateValidator function until the ClientIDs of the controls have been assigned.)

<!-- Use of the DataBind Container/Eval may be useful, but ignoring that.. --!>
<control:BlahBlah Id="ImaControl"
                  OnClientValidate="<%# CreateValidator(ImaControl) %>"/>
protected string CreateValidator(Control c) {
    var champId = c.ClientID; // example, not necessarily true

    // Then setup other values to supply to the function. While JSON is not
    // *exactly* like a JS object literal it is close enough so we Just Don't Care.
    // I prefer Json.NET from Newtonsoft, but the standard support is just fine.
    // (The champId could also be serialized here, but I chose to show passing
    //  two arguments, one NOT escaped; we assume champId doesn't contain \s or 's.)
    var opts = new JavaScriptSerializer().Serialize(new {
        reasonId = reasonControl.ClientID,
        dynamicControlId = dynamicControl.ClientID,
        errorImageId = Error9.ClientId
    });

    // The use of parenthesis and actual JavaScript returned depends on if the
    // client-side validation property takes JavaScript to execute (common) or if
    // it takes a function to execute later, as found in DevExpress/some libraries.
    // (Remember from above that makeValidator returns a new function.)

    // For DX/DevExpress:
    return string.Format("makeValidator('{0}', {1})", champId, opts);

    // Normal ASP.NET might look like this:
    return string.Format("return makeValidator('{0}', {1}).apply(this, arguments)",
                    champId, opts);
}

And that's the gist of it, bugs included. However, there are number of variations of this approach (including the ASP.NET AJAX ScriptControl magic) and subtle factors to consider; the big point to remember and to strive for is:

@brz Because the JavaScript and the Markup/HTML and the C#/code-behind are all separate concerns except for the small area in which values are passed between. In my own applications I use an extension of this approach where the JavaScript lives in it's own file as a nicely packaged module (which is loaded dynamically as needed); this makes it even more isolated from the Markup/HTML. The point is to not use string interpolation, of any sort (except for the very small bridging code) to build the JavaScript - otherwise the result is code that is hard to edit and reason about.

@brz Moving the code to entirely Markup and then data-binding values (e.g. ..; var reasonControl = window['<%# reason.ClientId %>']; ..) is one way to help minimize this coupling, but it still requires a first-step isolation as shown to be a clean and maintainable solution. That is, the data-binding should still only be used to inject values into otherwise valid code and should not be used to generate the code itself. This entire separation is similar to what SQL should use placeholders - it is a separation of values from code that underpins a clean design.

@user2864740 This is a interesting solution. I'm trying to integrate this in my code. I'm trying to add a OnSelectedIndexChanged="<%# CreateValidator(ImaControl) %>" but it doesn't call the codebehind function witch is CreateValidator.

@Dave.Lebr1 DataBind needs to be called. See stackoverflow.com/questions/1603398/ , msdn.microsoft.com/en-us/library/ - for controls (using DataBinding syntax) that do not have a declarative DataSourceID set, ensure they have DataBind() called in the PreRender Event.

c# - How to avoid writing messy JavaScript in an ASP.NET code-behind? ...

c# javascript asp.net webforms code-behind
Rectangle 27 2

You can bind the javascript function call from Repeater Repeater.ItemDataBound event.

void R1_ItemDataBound(Object Sender, RepeaterItemEventArgs e) 
 {
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 
      {            
          TextBox txt21 = (TextBox)e.Item.FindControl("txt21");
          RequiredFieldValidator rfv21 = (RequiredFieldValidator)e.Item.FindControl("rfv21");
          txt21.Attributes.Add("onclick", "txt21_onChange('" + txt21.ClientID + "','" + rfv21.ClientID + "'" )            
      }
 }
function txt21_onChange(txt21ID, rfv21ID) 
{
    txt21ID = document.getElementById(txt21ID);
    rfv21ID = document.getElementById(rfv21ID);
    //The above are TextBox and RequiredFieldValidator objects of row of TextBox that triggered change event.
    //You can use these object  
}

This also a good and acceptable answer, but i choose the another one because it will be more cleaner and easier to do that client side

c# - In ASP.NET Web Forms I want to get control inside child Repeater ...

javascript c# asp.net webforms asp.net-controls
Rectangle 27 6

I am not sure if i understand your problem but you want to achieve postback only if certain condition is met. you can hook up a javascript function on both dropdown onchange="return onchange();" Set Autopostback = true;

function Onchange() {
        var ddl1 = document.getElementById('<%= ddl1.ClientID %>');
        var ddl2 = document.getElementById('<%= ddl2.ClientID %>');
        var txtbox = document.getElementById('<%= txtbox.ClientID %>');
        if (ddl1.selectedIndex == 2 && ddl2.selectedIndex > 2) {
            txtbox.style.display = "inline";
            __doPostBack(ddl1, '');
        }
        else {
            txtbox.style.display = "none";
            return false;
        }
    }
<asp:DropDownList runat="server" AutoPostBack="true" ID="ddl1" onchange="return Onchange();"
            OnSelectedIndexChanged="ddl1_SelectedIndexChanged">
            <asp:ListItem Text="text1" />
            <asp:ListItem Text="text2" />
            <asp:ListItem Text="text3" />
            <asp:ListItem Text="text4" />
        </asp:DropDownList>
        <asp:DropDownList runat="server" AutoPostBack="true" ID="ddl2" onchange="return Onchange();"
            OnSelectedIndexChanged="ddl1_SelectedIndexChanged">
            <asp:ListItem Text="text1" />
            <asp:ListItem Text="text2" />
            <asp:ListItem Text="text3" />
            <asp:ListItem Text="text4" />
        </asp:DropDownList>
        <asp:TextBox runat="server" ID="txtbox" />

ASP.NET - Control dropdownlist postback programmatically - Stack Overf...

asp.net postback
Rectangle 27 1

You need a JavaScript function to make sure no postback happens when the user selects the "Category" entry. This can look like this:

function onCategoryChange() {
  var value = $("#<%= ddCategory.ClientID %> option:selected").val(); // use the ClientID from the ddCategory dropdown
  if (value == "0") // this is the value for the "Category" entry
    return false; 
  else {
    __doPostBack('<%= ddCategory.ClientID %>', value);
  }
}

You also have to adopt your DropDownList so that the JavaScript function gets called. Therefore you add a onchange attribute like this:

<asp:DropDownList ID="ddCategory"
                  CssClass="form-control"
                  AutoPostBack="true"
                  OnSelectedIndexChanged="ddCategory_SelectedIndexChanged"
                  runat="server"
                  DataTextField="Name"
                  DataValueField="ID"
                  onchange="return onCategoryChange();">
</asp:DropDownList>

P.S.: Note that I used jQuery to select the selected option in the category dropdown field. If you don't have jQuery available, you have to adopt the selected option selection to use plain JavaScript.

Thanks JS approach works. Not sure if why required field validator is not working may be it works when associated with Submit Button. Anyways thanks i will use JavaScript approach as i cant spend any more time on this.

c# - Prevent Postback for DropDown for first value in asp.net webform ...

c# asp.net webforms
Rectangle 27 3

usually you can have one function and have it perform it's work on the whole page or you can change it to take a parameter ( a reference to the usercontrol you're interested in )

That way you don't need to have multiple copies of the same javascript function.

function CLIENTID_javascriptFunction{
}

You'd have on function at the global level :

function javascriptFunction(id){

}

and call it with the id of the dom object you're interested in. (use ClientID to get the DOM id of the control)

yes u r right but sometimes I had to go the (CLIENTID_javascriptFunction) instead of passing a large number of parameters to a global declared function

c# - ASP.NET Scope of user control for javascript functions - Stack Ov...

c# javascript asp.net user-controls
Rectangle 27 1

I was having a very similar problem with the whitespace between the tab headers. The tab headers are <span> tags, so most browsers render the whitespace as a text node in the DOM. To remove the ignorable whitespace nodes, call a JavaScript function when the page loads, like this:

function fixTabContainer() {
    var tabContainerHeader = $get('<%#TabContainer1.ClientID%>' + '_header');
    var children = tabContainerHeader.childNodes;
    for (var i = 0; i < children.length; i++) {
        if (is_all_ws(children[i])) {
            tabContainerHeader.removeChild(children[i]);
            i--;
        }
    }
}

/**
 * Determine whether a node's text content is entirely whitespace.
 * (From https://developer.mozilla.org/en/whitespace_in_the_dom)
 * @param nod  A node implementing the |CharacterData| interface (i.e.,
 *             a |Text|, |Comment|, or |CDATASection| node
 * @return     True if all of the text content of |nod| is whitespace,
 *             otherwise false.
 */
 function is_all_ws(nod) {
     // Use ECMA-262 Edition 3 String and RegExp features
     return !(/[^\t\n\r ]/.test(nod.data));
 }

The script finds the <div> that holds the tab headers and loops through those header <span> elements. It removes all nodes that contain only ignorable whitespace (which it determines with the second function).

Note: The IE8 DOM unfortunately doesn't include text nodes (it's a known bug).

asp.net - How do you remove the space inserted automatically in Ajax c...

asp.net ajax asp.net-ajax ajaxcontroltoolkit
Rectangle 27 1

The reason it isn't working is because the ID of the button changes when it's rendered to the page. To access the control in JavaScript, you need to use the ClientID property:

$("#<%= btnCancel.ClientID %>").click(function(e){
    //open the dialog
});

I tried many variations on this and couldn't ever get it to work. I must have something else wrong. I'm going to put an alert in there as matpol suggested to see if my javascript is even running.

javascript - jQuery UI modal confirmation dialog with ASP.NET not firi...

javascript jquery asp.net jquery-ui jquery-ui-dialog
Rectangle 27 6

function DoPostBack()
{
   __doPostBack("txt_sssn_dt", "TextChanged");
}
function texboxchange() {
        var txtBox = document.getElementById('<%= TextBox4.ClientID %>');
        var count = txtBox.value.length;
        if (count == 2) 
        {
           document.getElementById('<%= TextBox12.ClientID %>').focus();
           return true; // this will call textbox changed event.
        }
    }

asp.net - Force server TextChanged event from javascript - Stack Overf...

javascript asp.net events
Rectangle 27 1

Instead of implementing the whole thing, you can use the Asp.Net UpdatePanel to handle partial page rendering for you.

in order to have the content of your UpdatePanel updated every second as you requested, you need to use javascript to call the auto-rendered Asp.Net postback function with the update panel's id as an argument.

here is a full example of a serverside clock:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" OnLoad="UpdatePanel1_Load">
    <ContentTemplate>
        <label id="Label_For_Server_Time" runat="server"></label>
    </ContentTemplate>
</asp:UpdatePanel>

here you can see a label that runs at server so we could access it from code behind;

<script type="text/javascript">
    $(function () {
        setInterval("__doPostBack('<%=UpdatePanel1.ClientID%>', '');", 1000);
    });
</script>

this is the piece of code responsible for updating the updatepanel every second, or rather 1000 milliseconds. the function __doPostBack() is an asp.net generated function and by calling setInterval we are making the updatepanel post back every second. the $(function (){}); wrapper here only meant to keep the code from executing before DOM fully loads. you tagged your question with jQuery, so i assume its fine with you.

in your code behind, you need to add the updatepanel's load handler, which runs when the panel posts back:

protected void UpdatePanel1_Load(object sender, EventArgs e)
{
    Label_For_Server_Time.InnerText = DateTime.Now.ToString();
}

note that in your case, instead of calling a response.write you can dynamically clear your update panel and add HtmlGenericControl in it per 'train', or add them only once and update their styling every postback

<ContentTemplate>
Response.Write
HtmlGenericControl myDiv1 = new HtmlGenericControl("div")
UpdatePanel1.Controls.Add()
myDiv1.Style["margin-left"]=t.XTrainLocation-8

you can clean your panel every time by calling UpdatePanel1.Controls.Clear();

c# - pass list of string to javascript that is sent by asp code behind...

c# javascript jquery asp.net
Rectangle 27 4

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function pageLoad() {
            var combo = $find("<%= RadComboBox1.ClientID %>");
            alert(combo);
        }
     </script>
</telerik:RadCodeBlock>

c# - telerik RadComboBox find Returns null - why? - Stack Overflow

c# asp.net telerik find radcombobox
Rectangle 27 4

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function pageLoad() {
            var combo = $find("<%= RadComboBox1.ClientID %>");
            alert(combo);
        }
     </script>
</telerik:RadCodeBlock>

c# - telerik RadComboBox find Returns null - why? - Stack Overflow

c# asp.net telerik find radcombobox
Rectangle 27 3

<style type="text/css">
    .hiddenColumn
    {
        display: none;
    }

    .rowGrid
    {
        cursor: pointer;
    }
</style>

<asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="true" >
            <RowStyle CssClass="rowGrid" />
            <Columns>
                <asp:CommandField ButtonType="Button" ShowSelectButton="true" HeaderStyle-CssClass="hiddenColumn"
                    ItemStyle-CssClass="hiddenColumn" FooterStyle-CssClass="hiddenColumn" />
            </Columns>
        </asp:GridView>

<script type="text/javascript">
        $(function () {
            $("#<%= GridView1.ClientID %> tr.rowGrid")
            .live("click", function (event) {
                $(this).find("input[type='button'][value='Select']").click();
            });

            $("#<%= GridView1.ClientID %> input[type='button'][value='Select']")
                .live("click", function (event) {
                    event.stopPropagation();
                });

        });
    </script>

c# - How to implement full row selecting in GridView without select bu...

c# asp.net gridview selectedindexchanged
Rectangle 27 3

<style type="text/css">
    .hiddenColumn
    {
        display: none;
    }

    .rowGrid
    {
        cursor: pointer;
    }
</style>

<asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="true" >
            <RowStyle CssClass="rowGrid" />
            <Columns>
                <asp:CommandField ButtonType="Button" ShowSelectButton="true" HeaderStyle-CssClass="hiddenColumn"
                    ItemStyle-CssClass="hiddenColumn" FooterStyle-CssClass="hiddenColumn" />
            </Columns>
        </asp:GridView>

<script type="text/javascript">
        $(function () {
            $("#<%= GridView1.ClientID %> tr.rowGrid")
            .live("click", function (event) {
                $(this).find("input[type='button'][value='Select']").click();
            });

            $("#<%= GridView1.ClientID %> input[type='button'][value='Select']")
                .live("click", function (event) {
                    event.stopPropagation();
                });

        });
    </script>

c# - How to implement full row selecting in GridView without select bu...

c# asp.net gridview selectedindexchanged
Rectangle 27 1

<script type="text/javascript">
 $(function() {
        $("#<%= txtFrom.ClientID %>").datepicker({
            showmonth:true,
            autoSize: true,
            showAnim: 'slideDown',
            duration: 'fast'
        });

        $("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
    });
</script>
<asp:TextBox ID="txtFrom" MaxLength="10" runat="server" ToolTip="Enter From Date">
</asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/clock_add.gif" />
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          return false;
        });
$("#<%= ImageButton1.ClientID %>").click(function(event) {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          event.preventDefault();
        });
$("#txtStartDate").datepicker({
  showOn: "both",       
  onSelect: function(dateText, inst){
     $("#txtEndDate").datepicker("option","minDate",
     $("#txtStartDate").datepicker("getDate"));
  }
});

Thank you very much Shekhar, but the issue is as soon as i click on the image button the datepicker appears and suddenly disppears without even letting the date to be selected.

return false

You are welcome. And don't forgot to mark it if it helped you.

I have marked it and i again need to consult you what if i need two image buttons and two textboxes and in the first textbox the starting date goes and in the second textbox only the date after the date in textbox1 goes?

jquery - Datepicker ASP.NET - Stack Overflow

jquery asp.net
Rectangle 27 1

<script type="text/javascript">
 $(function() {
        $("#<%= txtFrom.ClientID %>").datepicker({
            showmonth:true,
            autoSize: true,
            showAnim: 'slideDown',
            duration: 'fast'
        });

        $("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
    });
</script>
<asp:TextBox ID="txtFrom" MaxLength="10" runat="server" ToolTip="Enter From Date">
</asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/clock_add.gif" />
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          return false;
        });
$("#<%= ImageButton1.ClientID %>").click(function(event) {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          event.preventDefault();
        });
$("#txtStartDate").datepicker({
  showOn: "both",       
  onSelect: function(dateText, inst){
     $("#txtEndDate").datepicker("option","minDate",
     $("#txtStartDate").datepicker("getDate"));
  }
});

Thank you very much Shekhar, but the issue is as soon as i click on the image button the datepicker appears and suddenly disppears without even letting the date to be selected.

return false

You are welcome. And don't forgot to mark it if it helped you.

I have marked it and i again need to consult you what if i need two image buttons and two textboxes and in the first textbox the starting date goes and in the second textbox only the date after the date in textbox1 goes?

jquery - Datepicker ASP.NET - Stack Overflow

jquery asp.net
Rectangle 27 3

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" DestroyOnClose="true" Width="750px" Height="500px" OnClientClose="onClientClose">
    <windows>
<telerik:RadWindow ID="RadWindow1" runat="server">
</telerik:RadWindow>
    </windows>
</telerik:RadWindowManager>
<%-- RadAjaxManager --%>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
    <ajaxsettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
    <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" />
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
    </UpdatedControls>
</telerik:AjaxSetting>       
    </ajaxsettings>
</telerik:RadAjaxManager>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

    <script type="text/javascript">

// Insert in RadWindow
function showForm(url) {
    window.radopen(url, "RadWindow1");
    return false;
}


function onClientClose(oWnd, args) {
    // get the transferred arguments
    var arg = args.get_argument();
    if (arg == '' || arg == null) {
// No need to refresh RadGrid
    }
    else {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(arg);
    }
}


    </script>

</telerik:RadCodeBlock>
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    var result = Int32.Parse(e.Argument); // return argument from child
}
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<script type="text/javascript">

    //mandatory for the RadWindow dialogs functionality
    function getRadWindow() {
    if (window.radWindow) {
        return window.radWindow;
    }
    if (window.frameElement && window.frameElement.radWindow) {
        return window.frameElement.radWindow;
    }
    return null;
    }

    // Fires when the changes are saved
    function onClientClose(arg) {
        // Pass the arguments from the dialog to the callback function on the main page.    
        getRadWindow().close(arg);
    }
    </script>

</telerik:RadCodeBlock>
protected void ChildSave_Click(object sender, EventArgs e)
{

    ClientScriptManager cs = Page.ClientScript;

    cs.RegisterStartupScript(typeof(Page), "CloseScript_" + UniqueID,
      "onClientClose('1');", true); // Return value 1 to parent

}

asp.net - how to close radwindow without refreshing parent - Stack Ove...

asp.net telerik radwindow
Rectangle 27 0

I figured it out. I added following code to the javascript function:

function DisplayElementDetails(obj)
            {
                var name = obj.id.substring(0,(obj.name.length)-7) + "lblElementDetails"
                var obj = document.getElementById(name);
                obj.style.display = 'none';
                return false;
            }
<asp:Label ID="lblElementDetails" Text='<%# Eval("ElementDetails")%>' runat="server" style="display:block" />

asp.net - How to pass clientId of a control in Repeater to JavaScript ...

javascript asp.net
Rectangle 27 0

function masterClick(clicked, controlID) {
    var dynCtrl = clicked.id.substring(0, clicked.id.lastIndexOf("_") + 1);
    var tBox = document.getElementById(dynCtrl + controlID);
    tBox.value = "";
    tBox.focus();
}
masterClick(this,'txt_rol');

change tBox.value and focus to whatever action you like, but should have access to the control in JavaScript now. You can add in a check like " if (tBox) " to ensure you have an object. The downside is the static reference to the control within the inline javascript, and you have to adjust when the calling control is in a different container, grid, panel, etc.

this isn't exactly what i was looking for, but it helped.

asp.net - Passing ClientId of a textbox to use it in a javascript func...

javascript asp.net visual-studio-2010