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 HussainRank #423 · 5.9K reputationPosted Jul 26, 2013, 11:19 PM EDT
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
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 26, 2013, 11:06 PM EDT
Can you please share your code?
Regards,
Iftikar
Sunny SharmaRank #223 · 11.1K reputationPosted Jul 26, 2013, 11:11 PM EDT
ashok kumar69 reputationPosted Jul 26, 2013, 11:12 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 26, 2013, 11:13 PM EDT
Regards,
Iftikar
ashok kumar69 reputationPosted Jul 26, 2013, 11:14 PM EDT
ashok kumar69 reputationPosted Jul 26, 2013, 11:36 PM EDT
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
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 26, 2013, 11:42 PM EDT
Regards,
Iftikar
ashok kumar69 reputationPosted Jul 27, 2013, 12:19 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 12:25 AM EDT
Regards,
Iftikar
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 12:28 AM EDT
Regards,
Iftikar
ashok kumar69 reputationPosted Jul 27, 2013, 12:41 AM EDT
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 HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 12:45 AM EDT
Regards,
Iftikar
ashok kumar69 reputationPosted Jul 27, 2013, 1:16 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts