The page previously fires the event from the server side.When the new design is applied to the site the server side events are not firing.What may be the problem.Got struck from 2 days.Please help me in solving the issue.

Thanks In Advance,
Sushmaja Arumalla

Recommended Answers

All 9 Replies

When the new design is applied to the site the server side events are not firing.

What do you mean by new design?

If the events are firing, it could be that they are not being wired/handled.

For example if you are writing asp.net/vb.net code, your subroutines require that you use the handles keyword to wire the event to the control.

Protected Sub btn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click

However, if you are writing asp.net/c#, your control would require the onclick property and would you not use the handles keyword. In your aspx page decleration, you need to make sure that you include AutoEventWireup="true"

Your control would look like...

<asp:Button ID="btn1" runat="server" Text="Button" OnClick="btn1_Click" />

and your code behind...

protected void btn1_Click(object sender, EventArgs e)

The new design include many Javascript files and bootstrap.I think after including the javascript ,the server side events are not fired. So does the javascript effects the events on server side to be fired?

the javascript files included are
bootstrap.min.js
jquery-1.8.1.min.js
html5.js
prettyCheckable.js
custom-form-elements.js

So does the javascript effects the events on server side to be fired?

Javascript is handled client side by the browser. asp.net scripting is handled server side.

The only thing i can think of is that you can change the behavior of certain elements, say a button where it would normally trigger a post back and using javascript/jQuery, you can prevent that event from happening client side.

I would start by using your browser's dev tools (F12), look at the javascript console for any clues to client side errors.

Yes JorgeM, I observed the difference between the two pages befor applying the design and after applying the design. I got the error in Javascript that says
"TypeError: Sys.Extended is undefined". Is this the problem for the server side events for not firing??

I am not familiar with that error message, but with regard to the server side events, if this client side error is interferring with the post back process, then yes. If not, I dont see how it would interfer.

as JorgeM mentioned be carefull that AutoEventWireup="true"

also ensure that your events are registered to an event handler in the design template. Visual Studio however helps a lot by doing this automatically when creating a new event.

I Am getting the error namely "Empty string passed to getElementById()" when i clicked the button or any element that needs to fire the server side events.
The error message comes from jquery library included i.e., jquery-1.8.1.min.js Do anyone have any idea how to resolve this...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.