iam using an jquery function which needs to be called in the codebehind,on buttonclick it should be invoked which should set the open the tooltip for the dropdown,
the problem is the dropdown is inside the updatepanel, so iam not able to call the jquery code.break point is reaching the validation function but the jqueryfunction is not invoked.when i remove the dropdown carsegment from update panel its working fine,pls help me out.
aspx:
function ddlcar() {
var controlNames = "<%= ddlCarSegment.ClientID%>";
$('#' + controlNames).tooltip("open");
}
protected void book_click(object sender, EventArgs e)
{
// ClientScript.RegisterClientScriptBlock(this.GetType(), "blah", "ddlcar();", true);
if (!Validation())
{
return;
}}
protected Boolean Validation()
{
if (ddlCarSegment.SelectedIndex == 0)
{
ScriptManager.RegisterStartupScript(this, GetType(), "modalscript",
" ddlcar();", true);
return false;
}
}
}
Iftikar HussainPosted Jul 27, 2013, 3:19 AM
in you aspx:
declare one hidden field
in your code behind:
protected Boolean Validation()
{
if (ddlCarSegment.SelectedIndex == 0)
{
HdnIsToolTip.Value="Yes";
return false;
}
}
Regards,
Iftikar
ashok kumarPosted Jul 27, 2013, 5:16 AM
Iftikar HussainPosted Jul 27, 2013, 4:45 AM
Regards,
Iftikar
ashok kumarPosted Jul 27, 2013, 4:41 AM
now iam not getting the error ,the alert ('i enter1) is firing on index change but the alert i enter in not working ,breakpoint is also coming to the part if (ddlCarSegment.SelectedIndex == 0)
HdnIsToolTip.Value="Yes";
return false;
}
Iftikar HussainPosted Jul 27, 2013, 4:28 AM
Regards,
Iftikar
Iftikar HussainPosted Jul 27, 2013, 4:25 AM
Regards,
Iftikar
ashok kumarPosted Jul 27, 2013, 4:19 AM
Iftikar HussainPosted Jul 27, 2013, 3:42 AM
Regards,
Iftikar
ashok kumarPosted Jul 27, 2013, 3:36 AM
i tried as u had said its not working,i inserted alertboxes inside ddlcar() and also inside var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
var hdnIsToolTip = $("#<%= HdnIsToolTip.ClientID %>").val();
if (hdnIsToolTip == "Yes") {
ddlcar();
}
}); they are also not firing. in inspect element iam getting Uncaught ReferenceError: Sys is not defined
ashok kumarPosted Jul 27, 2013, 3:14 AM
Iftikar HussainPosted Jul 27, 2013, 3:13 AM
Regards,
Iftikar
ashok kumarPosted Jul 27, 2013, 3:12 AM
Sunny SharmaPosted Jul 27, 2013, 3:11 AM
Iftikar HussainPosted Jul 27, 2013, 3:06 AM
Can you please share your code?
Regards,
Iftikar