Click here to Skip to main content
15,897,226 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to disable link button ? Pin
kathyani7-Jul-08 0:00
kathyani7-Jul-08 0:00 
GeneralRe: how to disable link button ? Pin
Christian Graus7-Jul-08 3:39
protectorChristian Graus7-Jul-08 3:39 
Questionhaving problem with html.ActionLink Pin
mynameissuraj6-Jul-08 23:29
mynameissuraj6-Jul-08 23:29 
AnswerRe: having problem with html.ActionLink Pin
Arindam Tewary6-Jul-08 23:40
professionalArindam Tewary6-Jul-08 23:40 
AnswerRe: having problem with html.ActionLink Pin
mynameissuraj6-Jul-08 23:47
mynameissuraj6-Jul-08 23:47 
Questionsolution plz Pin
Kissy166-Jul-08 23:28
Kissy166-Jul-08 23:28 
AnswerRe: solution plz Pin
eyeseetee6-Jul-08 23:39
eyeseetee6-Jul-08 23:39 
QuestionLinkButton not calling a javascript function in IE Pin
RevPeter3rd6-Jul-08 23:26
RevPeter3rd6-Jul-08 23:26 
Hi Guys,

I have a linkbutton which calls a .net function which when clicked either displays or hides a DIV and changes an image. I also need this linkbutton to change the property of a javascript boolean variable.

The javascript in place currently produces a popup notifying users that they have not completed their registration if they try to navigate away from the page without having submitted the form. All I need the linkbutton to do is to submit the following "needToConfirm = false;". By doing so, when the user clicks the linkbutton and the DIV is displayed/hidden (this refreshes the page) the javascript knows not to display the popup box as the user is staying on the page. This works fine in Firefox but not IE.

I have added this to buttons, which work fine across both browsers, so it only the Linkbutton in IE that I am struggling.

Below is my code:

Client Side

<asp:linkbutton id="lbViewAllProfessions" runat="server" onclick="lbViewAllProfessions_OnClick" xmlns:asp="#unknown">
<asp:image id="imgIcon" runat="server" imageurl="images/general/icon-plus.gif" /> view all job types
</asp:linkbutton>


Server Side
Note: I have included the code for my working buttons below too.

//This is in my Page_Load
btnCandidateRegister.Attributes.Add("onClick", "needToConfirm = false;");
btnFindAddress.Attributes.Add("onClick", "needToConfirm = false;");
btnOKAddress.Attributes.Add("onClick", "needToConfirm = false;");
btnCancelAddress.Attributes.Add("onClick", "needToConfirm = false;");
lbViewAllProfessions.Attributes.Add("onClick", "needToConfirm = false;");
//.Net function called by LinkButton
protected void lbViewAllProfessions_OnClick(object sender, EventArgs e)
{
if (imgIcon.ImageUrl == "images/general/icon-plus.gif")
{
divSkillsBox.Visible = true;
imgIcon.ImageUrl = "images/general/icon-minus.gif";
}
else
{
divSkillsBox.Visible = false;
imgIcon.ImageUrl = "images/general/icon-plus.gif";
}

}


Javascript
<script language="JavaScript" type="text/javascript">
var needToConfirm = true;

window.onbeforeunload = confirmExit;
function confirmExit()
{
if (needToConfirm)
{
needToConfirm = false;
return "Your have not completed your registration process.";
}else{
needToConfirm = true;
return;
}
}
</script>


I hope this is clear enough. Please let me know if you need anymore info.

Thanks in advance,
Martin
AnswerRe: LinkButton not calling a javascript function in IE Pin
Arindam Tewary6-Jul-08 23:36
professionalArindam Tewary6-Jul-08 23:36 
GeneralRe: LinkButton not calling a javascript function in IE Pin
RevPeter3rd6-Jul-08 23:52
RevPeter3rd6-Jul-08 23:52 
GeneralRe: LinkButton not calling a javascript function in IE Pin
Arindam Tewary7-Jul-08 0:08
professionalArindam Tewary7-Jul-08 0:08 
Question.NET dll to be visible in .NEt tab of Add Reference dialog Pin
Arindam Tewary6-Jul-08 23:20
professionalArindam Tewary6-Jul-08 23:20 
AnswerRe: .NET dll to be visible in .NEt tab of Add Reference dialog Pin
N a v a n e e t h7-Jul-08 0:29
N a v a n e e t h7-Jul-08 0:29 
GeneralRe: .NET dll to be visible in .NEt tab of Add Reference dialog Pin
Arindam Tewary7-Jul-08 0:40
professionalArindam Tewary7-Jul-08 0:40 
GeneralRe: .NET dll to be visible in .NEt tab of Add Reference dialog Pin
N a v a n e e t h7-Jul-08 0:46
N a v a n e e t h7-Jul-08 0:46 
GeneralRe: .NET dll to be visible in .NEt tab of Add Reference dialog Pin
Arindam Tewary7-Jul-08 0:54
professionalArindam Tewary7-Jul-08 0:54 
Questionhave to handle 2 operation in gridview selection index change............... Pin
Member 38798816-Jul-08 23:03
Member 38798816-Jul-08 23:03 
AnswerRe: have to handle 2 operation in gridview selection index change............... Pin
Member 38798816-Jul-08 23:07
Member 38798816-Jul-08 23:07 
GeneralRe: have to handle 2 operation in gridview selection index change............... Pin
eyeseetee6-Jul-08 23:21
eyeseetee6-Jul-08 23:21 
Questionajax problem while using in asp.net Pin
Miss Maheshwari6-Jul-08 22:58
Miss Maheshwari6-Jul-08 22:58 
AnswerRe: ajax problem while using in asp.net Pin
eyeseetee6-Jul-08 23:03
eyeseetee6-Jul-08 23:03 
QuestionRe: ajax problem while using in asp.net Pin
Miss Maheshwari7-Jul-08 0:35
Miss Maheshwari7-Jul-08 0:35 
AnswerRe: ajax problem while using in asp.net Pin
eyeseetee7-Jul-08 0:55
eyeseetee7-Jul-08 0:55 
GeneralRe: ajax problem while using in asp.net Pin
Miss Maheshwari7-Jul-08 1:04
Miss Maheshwari7-Jul-08 1:04 
GeneralRe: ajax problem while using in asp.net Pin
Arindam Tewary7-Jul-08 1:06
professionalArindam Tewary7-Jul-08 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.