Need to click twice to fire an Event

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,
 
C

Colbert Zhou [MSFT]

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).
 
C

Colbert Zhou [MSFT]

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).
 
G

Goldenrate

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
 
G

Goldenrate

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
 
C

Colbert Zhou [MSFT]

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).
 
C

Colbert Zhou [MSFT]

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).
 
C

Colbert Zhou [MSFT]

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).
 
C

Colbert Zhou [MSFT]

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top