Need to click twice to fire an Event

  • Thread starter Thread starter Goldenrate
  • Start date Start date
G

Goldenrate

Hi,

I'm developing a application using DNN platform. I created a simple NAV
based on LinkButton and populated the NavigateUrl property programmatically.
The problem is that I have to click twice on each link before the event is
fired.

Does anyone has any ideas?

Here is the ASP code:

/********************************************/
<tr>
<td><asp:LinkButton ID="LinkButton1" runat="server"
onclick="LinkButton1_Click">My Inbox</asp:LinkButton></td>
<td><asp:LinkButton ID="LinkButton3" runat="server"
onclick="LinkButton3_Click">My
Notifications</asp:LinkButton></td>
</tr>
/****************************/
Here is the C# code:

/************************************************/
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(57,"","aspm=inbox"));
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(57, "",
"aspm=notifications"));
}
/*******************/

Thanks,
 
Hello,

I have a quick test in my side using an ASP.NET project, not in DNN. The
link button's click event works fine for the first time.

If you debug the application and set a breakpoint at the linkbutton event
handle, when clicking the linkbutton for the first time, does the debugger
stops at your breakpoint? Sometimes maybe the codes execute, but what we
see is different from what we thought it should be. So the debugger may be
a better thing we can trust.

I also see some discussion of a very similar case,
http://forums.asp.net/p/1074469/1575069.aspx
It happens because of not initialing the PostBackUrl in the page load event
handle. But I think if we use Response.Redirect() method showed in your
codes, we should not suffer from the problem. However, please have a check
if this is your issue.

If you need future assistance on this, is it possible to send me a
reproduciable project so that I can investigate in my side and try to find
out the root cause.


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hello,

I have a quick test in my side using an ASP.NET project, not in DNN. The
link button's click event works fine for the first time.

If you debug the application and set a breakpoint at the linkbutton event
handle, when clicking the linkbutton for the first time, does the debugger
stops at your breakpoint? Sometimes maybe the codes execute, but what we
see is different from what we thought it should be. So the debugger may be
a better thing we can trust.

I also see some discussion of a very similar case,
http://forums.asp.net/p/1074469/1575069.aspx
It happens because of not initialing the PostBackUrl in the page load event
handle. But I think if we use Response.Redirect() method showed in your
codes, we should not suffer from the problem. However, please have a check
if this is your issue.

If you need future assistance on this, is it possible to send me a
reproduciable project so that I can investigate in my side and try to find
out the root cause.


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hi,

Thanks for your prompt reply.

No the debugger doesn't stop on the breaking point. In fact the debugger
doesn't stop at all (not even on Page_load). Do you know any way to go
around it?
I can set you an ftp access to where the code is, I need a private way to
send it to you, may I use your personal email?

All Best,
David
 
Hi,

Thanks for your prompt reply.

No the debugger doesn't stop on the breaking point. In fact the debugger
doesn't stop at all (not even on Page_load). Do you know any way to go
around it?
I can set you an ftp access to where the code is, I need a private way to
send it to you, may I use your personal email?

All Best,
David
 
Hi David,

You can contact me via my personal email, (e-mail address removed) :-)

Have a nice weekend!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hi David,

You can contact me via my personal email, (e-mail address removed) :-)

Have a nice weekend!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hello David,

I haven't received any emails from you. Is there any follow up on this
thread? Any future help needed, please feel free contact me at
(e-mail address removed)

Have a nice day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hello David,

I haven't received any emails from you. Is there any follow up on this
thread? Any future help needed, please feel free contact me at
(e-mail address removed)

Have a nice day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Back
Top